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

40 lines
1.1 KiB
PHP
Raw Normal View History

2019-01-20 11:33:05 +01:00
<?php
namespace Tests\Unit\Attribut;
use Infinito\Attribut\RequestedEntityAttribut;
use Infinito\Attribut\RequestedEntityAttributInterface;
use Infinito\Domain\Request\Entity\RequestedEntityInterface;
2020-04-02 21:13:35 +02:00
use PHPUnit\Framework\TestCase;
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());
}
}