Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kinglozzer committed Nov 4, 2021
1 parent b8d37f9 commit d6866af
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Dev/SapphireTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1108,9 +1108,15 @@ protected function createMemberWithPermission($permCode)
$member = $this->cache_generatedMembers[$permCode];
} else {
// Generate group with these permissions
$group = Group::create();
$group->Title = "$permCode group";
$group->write();
$group = Group::get()->filterAny([
'Code' => "$permCode-group",
'Title' => "$permCode group",
])->first();
if (!$group || !$group->exists()) {
$group = Group::create();
$group->Title = "$permCode group";
$group->write();
}

// Create each individual permission
foreach ($permArray as $permArrayItem) {
Expand Down

0 comments on commit d6866af

Please sign in to comment.