Commit 2c4708f8 authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

fix tests

parent 38278f8d
......@@ -273,10 +273,26 @@ class AuthorizerTest extends TestCase
* @throws \Source\Exceptions\EntityNotFoundException
* @throws \Source\Exceptions\EntityExistsException
*/
public function admin_users_cannot_modify_their_admin_privileges(): void
{
$this->expectException(AuthorizationException::class);
$adminGroup = $this->groups->create($group = new Group(0, Permissions::ADMIN, ''));
$user = $this->createUserWithPerms([Permissions::ADMIN]);
$this->authorizer->protectAdminRights($user->getId(), $adminGroup->getId());
}
/**
* @test
* @throws \Source\Exceptions\AuthorizationException
* @throws \Source\Exceptions\EntityExistsException
* @throws \Source\Exceptions\EntityNotFoundException
*/
public function protect_admin_rights_admins_have_rights_for_admin_group(): void
{
$adminGroup = $this->groups->create($group = new Group(0, Permissions::ADMIN, ''));
$user = $this->createUserWithPerms([Permissions::ADMIN]);
$this->createUserWithPerms([Permissions::ADMIN]);
$this->authorizer->protectAdminRights($user->getId(), $adminGroup->getId());
$this->assertTrue(true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment