Made user for UserAttribut optional

This commit is contained in:
Kevin Frantz
2019-02-03 00:30:53 +01:00
parent aa735367d9
commit bd2318ab5b
3 changed files with 33 additions and 1 deletions

View File

@@ -7,6 +7,9 @@ use App\Attribut\UserAttributInterface;
use App\Attribut\UserAttribut;
use App\Entity\UserInterface;
/**
* @author kevinfrantz
*/
class UserAttributTest extends TestCase
{
/**
@@ -23,6 +26,7 @@ class UserAttributTest extends TestCase
public function testConstructor(): void
{
$this->assertFalse($this->user->hasUser());
$this->expectException(\TypeError::class);
$this->user->getUser();
}
@@ -32,5 +36,6 @@ class UserAttributTest extends TestCase
$user = $this->createMock(UserInterface::class);
$this->assertNull($this->user->setUser($user));
$this->assertEquals($user, $this->user->getUser());
$this->assertTrue($this->user->hasUser());
}
}