mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 14:27:28 +01:00
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Tests\Unit\Attribut;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Infinito\Attribut\RecieverAttributInterface;
|
|
use Infinito\Attribut\RecieverAttribut;
|
|
use Infinito\Entity\Source\AbstractSource;
|
|
|
|
class RecieverAttributTest extends TestCase
|
|
{
|
|
/**
|
|
* @var RecieverAttributInterface
|
|
*/
|
|
protected $reciever;
|
|
|
|
public function setUp(): void
|
|
{
|
|
$this->reciever = new class() implements RecieverAttributInterface {
|
|
use RecieverAttribut;
|
|
};
|
|
}
|
|
|
|
public function testConstructor(): void
|
|
{
|
|
$this->assertFalse($this->reciever->hasReciever());
|
|
$this->expectException(\TypeError::class);
|
|
$this->reciever->getReciever();
|
|
}
|
|
|
|
public function testAccessors(): void
|
|
{
|
|
$reciever = $this->createMock(AbstractSource::class);
|
|
$this->assertFalse($this->reciever->hasReciever());
|
|
$this->assertNull($this->reciever->setReciever($reciever));
|
|
$this->assertEquals($reciever, $this->reciever->getReciever());
|
|
$this->assertTrue($this->reciever->hasReciever());
|
|
}
|
|
}
|