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

37 lines
837 B
PHP
Raw Normal View History

<?php
2019-01-20 10:41:58 +01:00
namespace Attribut;
use PHPUnit\Framework\TestCase;
2019-02-07 13:14:55 +01:00
use App\Attribut\ChildsAttributInterface;
2019-01-20 10:41:58 +01:00
use App\Attribut\ChildsAttribut;
use Doctrine\Common\Collections\ArrayCollection;
class ChildsAttributTest extends TestCase
{
/**
2019-02-07 13:14:55 +01:00
* @var ChildsAttributInterface
*/
protected $childs;
public function setUp(): void
{
2019-02-07 13:14:55 +01:00
$this->childs = new class() implements ChildsAttributInterface {
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());
}
}