2018-11-04 13:14:11 +01:00
|
|
|
<?php
|
|
|
|
|
2019-01-20 10:41:58 +01:00
|
|
|
namespace Attribut;
|
2018-11-04 13:14:11 +01:00
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2019-01-20 10:41:58 +01:00
|
|
|
use App\Attribut\ChildsAttributeInterface;
|
|
|
|
use App\Attribut\ChildsAttribut;
|
2018-11-04 13:14:11 +01:00
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
|
|
|
|
class ChildsAttributTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var ChildsAttributeInterface
|
|
|
|
*/
|
|
|
|
protected $childs;
|
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
$this->childs = new class() implements ChildsAttributeInterface {
|
|
|
|
use ChildsAttribut;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
|
|
|
$this->expectException(\TypeError::class);
|
|
|
|
$this->childs->getChilds();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testAccessors(): void
|
|
|
|
{
|
|
|
|
$childs = new ArrayCollection();
|
|
|
|
$this->assertNull($this->childs->setChilds($childs));
|
|
|
|
$this->assertEquals($childs, $this->childs->getChilds());
|
|
|
|
}
|
|
|
|
}
|