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

37 lines
864 B
PHP
Raw Normal View History

2018-11-04 13:19:35 +01:00
<?php
2019-01-20 10:41:58 +01:00
namespace Attribut;
2018-11-04 13:19:35 +01:00
use Doctrine\Common\Collections\ArrayCollection;
2020-04-02 21:13:35 +02:00
use Infinito\Attribut\ParentsAttribut;
use Infinito\Attribut\ParentsAttributInterface;
use PHPUnit\Framework\TestCase;
2018-11-04 13:19:35 +01:00
class ParentsAttributTest extends TestCase
{
/**
* @var ParentsAttributInterface
*/
protected $parents;
public function setUp(): void
{
$this->parents = new class() implements ParentsAttributInterface {
use ParentsAttribut;
};
}
public function testConstructor(): void
{
$this->expectException(\TypeError::class);
$this->parents->getParents();
}
public function testAccessors(): void
{
$parents = new ArrayCollection();
$this->assertNull($this->parents->setParents($parents));
$this->assertEquals($parents, $this->parents->getParents());
}
}