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

37 lines
890 B
PHP
Raw Normal View History

<?php
2018-11-06 20:08:28 +01:00
2019-01-20 10:41:58 +01:00
namespace Tests\Unit\Attribut;
use PHPUnit\Framework\TestCase;
2019-01-20 10:41:58 +01:00
use App\Attribut\RecieverAttributInterface;
use App\Attribut\RecieverAttribut;
2018-12-14 10:10:28 +01:00
use App\Entity\Source\AbstractSource;
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 {
use RecieverAttribut;
};
}
2018-11-06 20:08:28 +01:00
public function testConstructor(): void
{
$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);
$this->assertNull($this->reciever->setReciever($reciever));
$this->assertEquals($reciever, $this->reciever->getReciever());
}
}