2018-11-04 13:05:35 +01:00
|
|
|
<?php
|
2018-11-04 13:14:11 +01:00
|
|
|
|
2018-11-04 13:05:35 +01:00
|
|
|
namespace tests\Unit\Entity\Meta;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
use App\Entity\Meta\RelationInterface;
|
|
|
|
use App\Entity\Meta\Relation;
|
|
|
|
use Doctrine\Common\Collections\Collection;
|
|
|
|
|
|
|
|
class RelationTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var RelationInterface
|
|
|
|
*/
|
|
|
|
protected $relation;
|
2018-11-04 13:14:11 +01:00
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
2018-11-04 13:05:35 +01:00
|
|
|
$this->relation = new Relation();
|
|
|
|
}
|
2018-11-04 13:14:11 +01:00
|
|
|
|
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
2018-11-04 13:05:35 +01:00
|
|
|
$this->assertInstanceOf(Collection::class, $this->relation->getChilds());
|
|
|
|
$this->assertInstanceOf(Collection::class, $this->relation->getParents());
|
|
|
|
$this->expectException(\TypeError::class);
|
|
|
|
$this->relation->getSource();
|
|
|
|
}
|
|
|
|
}
|