2019-01-20 11:33:05 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Unit\Attribut;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2019-02-17 14:33:19 +01:00
|
|
|
use Infinito\Attribut\RequestedEntityAttribut;
|
|
|
|
use Infinito\Attribut\RequestedEntityAttributInterface;
|
2019-05-30 16:52:02 +02:00
|
|
|
use Infinito\Domain\Request\Entity\RequestedEntityInterface;
|
2019-01-20 11:33:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
|
|
|
class RequestedEntityAttributTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var RequestedEntityAttributInterface
|
|
|
|
*/
|
|
|
|
protected $requestedEntityAttribut;
|
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
$this->requestedEntityAttribut = new class() implements RequestedEntityAttributInterface {
|
|
|
|
use RequestedEntityAttribut;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
|
|
|
$this->expectException(\TypeError::class);
|
|
|
|
$this->requestedEntityAttribut->getRequestedEntity();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testAccessors(): void
|
|
|
|
{
|
|
|
|
$requestedEntity = $this->createMock(RequestedEntityInterface::class);
|
|
|
|
$this->assertNull($this->requestedEntityAttribut->setRequestedEntity($requestedEntity));
|
|
|
|
$this->assertEquals($requestedEntity, $this->requestedEntityAttribut->getRequestedEntity());
|
|
|
|
}
|
|
|
|
}
|