Applied rectors phpunit 9 migrations to tests

This commit is contained in:
Jan Böhmer 2023-06-11 15:15:55 +02:00
parent 684334ba22
commit fcbb1849ec
22 changed files with 162 additions and 187 deletions

View file

@ -47,7 +47,7 @@ class SamlUserFactoryTest extends WebTestCase
$this->assertInstanceOf(User::class, $user);
$this->assertEquals('sso_user', $user->getUserIdentifier());
$this->assertSame('sso_user', $user->getUserIdentifier());
//User must not change his password
$this->assertFalse($user->isNeedPwChange());
//And must not be disabled
@ -56,10 +56,10 @@ class SamlUserFactoryTest extends WebTestCase
$this->assertSame('!!SAML!!', $user->getPassword());
//Info should be set
$this->assertEquals('John', $user->getFirstName());
$this->assertEquals('Doe', $user->getLastName());
$this->assertEquals('IT', $user->getDepartment());
$this->assertEquals('j.doe@invalid.invalid', $user->getEmail());
$this->assertSame('John', $user->getFirstName());
$this->assertSame('Doe', $user->getLastName());
$this->assertSame('IT', $user->getDepartment());
$this->assertSame('j.doe@invalid.invalid', $user->getEmail());
}
public function testMapSAMLRolesToLocalGroupID(): void
@ -80,10 +80,10 @@ class SamlUserFactoryTest extends WebTestCase
$this->assertSame(1, $this->service->mapSAMLRolesToLocalGroupID(['employee', 'does_not_matter', 'manager'], $mapping));
$this->assertSame(3, $this->service->mapSAMLRolesToLocalGroupID(['administrator', 'does_not_matter', 'manager'], $mapping));
//Test if mapping is case-sensitive
$this->assertEquals(4, $this->service->mapSAMLRolesToLocalGroupID(['ADMIN'], $mapping));
$this->assertSame(4, $this->service->mapSAMLRolesToLocalGroupID(['ADMIN'], $mapping));
//Test that wildcard mapping works
$this->assertEquals(4, $this->service->mapSAMLRolesToLocalGroupID(['entry1', 'entry2'], $mapping));
$this->assertEquals(4, $this->service->mapSAMLRolesToLocalGroupID([], $mapping));
$this->assertSame(4, $this->service->mapSAMLRolesToLocalGroupID(['entry1', 'entry2'], $mapping));
$this->assertSame(4, $this->service->mapSAMLRolesToLocalGroupID([], $mapping));
}
}