Fix broken tests

This commit is contained in:
Loz Calver 2021-11-04 10:53:42 +00:00
parent b8d37f9ae4
commit d6866af7e5

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) {