infinito/application/symfony/tests/Unit/Attribut/RequestedRightAttributTest.php

40 lines
1.1 KiB
PHP
Raw Normal View History

2019-01-26 16:42:13 +01:00
<?php
namespace Tests\Unit\Attribut;
use PHPUnit\Framework\TestCase;
use Infinito\Domain\RequestManagement\Right\RequestedRightInterface;
use Infinito\Attribut\RequestedRightAttributInterface;
use Infinito\Attribut\RequestedRightAttribut;
2019-01-26 16:42:13 +01:00
/**
* @author kevinfrantz
*/
class RequestedRightAttributTest extends TestCase
{
/**
* @var RequestedRightAttributInterface
*/
protected $requestedRightAttribut;
public function setUp(): void
{
$this->requestedRightAttribut = new class() implements RequestedRightAttributInterface {
use RequestedRightAttribut;
};
}
public function testConstructor(): void
{
$this->expectException(\TypeError::class);
$this->requestedRightAttribut->getRequestedRight();
}
public function testAccessors(): void
{
$requestedRight = $this->createMock(RequestedRightInterface::class);
$this->assertNull($this->requestedRightAttribut->setRequestedRight($requestedRight));
$this->assertEquals($requestedRight, $this->requestedRightAttribut->getRequestedRight());
2019-01-26 16:42:13 +01:00
}
}