/** * Clear all ACL settings before starting tests. */ public static function setUpBeforeClass() { foreach (AclResource::find() as $resource) { $resource->delete(); } foreach (AclRole::find() as $role) { $role->delete(); } $resource = new AclResource(); $resource->create(['name' => Resource::WILDCARD, 'description' => 'All in all (built-in)']); (new AclResourceAccess())->create(['name' => Resource::ACCESS_WILDCARD, 'description' => 'All in all (built-in)', 'acl_resource_id' => $resource->id]); }
/** * @return mixed */ public function removeResources() { foreach (AclResource::find() as $resource) { $resource->delete(); } }