Skip to content

Commit

Permalink
Merge pull request #10136 from kinglozzer/fix-tests-10113
Browse files Browse the repository at this point in the history
MNT Fix broken tests
  • Loading branch information
emteknetnz authored Nov 4, 2021
2 parents b8d37f9 + d6866af commit e217a3d
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 e217a3d

Please sign in to comment.