Made person identity optional for user

This commit is contained in:
Kevin Frantz
2018-11-22 21:54:57 +01:00
parent e63b265ee4
commit d67ffb2a50
4 changed files with 58 additions and 15 deletions

View File

@@ -23,7 +23,24 @@ class UserSourceTest extends TestCase
public function testConstructor(): void
{
$this->assertInstanceOf(Collection::class, $this->userSource->getMemberships());
}
public function testHasPersonIdentitySource(): void
{
$this->assertFalse($this->userSource->hasPersonIdentitySource());
$this->userSource->setPersonIdentitySource($this->createMock(PersonIdentitySourceInterface::class));
$this->assertTrue($this->userSource->hasPersonIdentitySource());
$this->assertInstanceOf(PersonIdentitySourceInterface::class, $this->userSource->getPersonIdentitySource());
}
public function testInitPersonIdentitySource(): void
{
$this->expectException(\TypeError::class);
$this->userSource->getPersonIdentitySource();
}
public function testInitUser(): void
{
$this->expectException(\TypeError::class);
$this->userSource->getUser();
}