Adapted test for ParentRelation

This commit is contained in:
Kevin Frantz
2018-11-25 23:46:13 +01:00
parent 0c5f6af4c7
commit 960af1961a

View File

@@ -0,0 +1,30 @@
<?php
namespace tests\Unit\Entity\Meta;
use PHPUnit\Framework\TestCase;
use Doctrine\Common\Collections\Collection;
use App\Entity\Meta\Relation\Parent\AbstractParentRelation;
use App\Entity\Meta\Relation\Parent\ParentRelationInterface;
class AbstractParentRelationTest extends TestCase
{
/**
* @var ParentRelationInterface
*/
protected $relation;
public function setUp(): void
{
$this->relation = new class extends AbstractParentRelation{};
}
public function testConstructor(): void
{
$this->assertInstanceOf(Collection::class, $this->relation->getChilds());
$this->assertInstanceOf(Collection::class, $this->relation->getParents());
$this->assertEquals(0, $this->relation->getVersion());
$this->expectException(\TypeError::class);
$this->relation->getSource();
}
}