Merge pull request #10136 from kinglozzer/fix-tests-10113

MNT Fix broken tests
This commit is contained in:
Steve Boyd 2021-11-05 09:27:33 +13:00 committed by GitHub
commit e217a3d9cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1108,9 +1108,15 @@ if (class_exists(IsEqualCanonicalizing::class)) {
$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) {