2018-11-04 23:58:14 +01:00
|
|
|
<?php
|
2018-11-06 20:08:28 +01:00
|
|
|
|
2018-11-04 23:58:14 +01:00
|
|
|
namespace Tests\Unit\Entity\Attribut;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
use App\Entity\Attribut\RecieverAttributInterface;
|
|
|
|
use App\Entity\Attribut\RecieverAttribut;
|
2018-12-14 10:10:28 +01:00
|
|
|
use App\Entity\Source\AbstractSource;
|
2018-11-04 23:58:14 +01:00
|
|
|
|
|
|
|
class RecieverAttributTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var RecieverAttributInterface
|
|
|
|
*/
|
|
|
|
protected $reciever;
|
2018-11-06 20:08:28 +01:00
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
$this->reciever = new class() implements RecieverAttributInterface {
|
2018-11-04 23:58:14 +01:00
|
|
|
use RecieverAttribut;
|
|
|
|
};
|
|
|
|
}
|
2018-11-06 20:08:28 +01:00
|
|
|
|
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
2018-11-04 23:58:14 +01:00
|
|
|
$this->expectException(\TypeError::class);
|
|
|
|
$this->reciever->getReciever();
|
|
|
|
}
|
2018-11-06 20:08:28 +01:00
|
|
|
|
|
|
|
public function testAccessors(): void
|
|
|
|
{
|
2018-12-14 10:10:28 +01:00
|
|
|
$reciever = $this->createMock(AbstractSource::class);
|
2018-11-04 23:58:14 +01:00
|
|
|
$this->assertNull($this->reciever->setReciever($reciever));
|
|
|
|
$this->assertEquals($reciever, $this->reciever->getReciever());
|
|
|
|
}
|
|
|
|
}
|