Implemented tests for relation

This commit is contained in:
Kevin Frantz 2018-11-04 13:05:35 +01:00
parent 7d8a15e8ae
commit 2e9b33c82b
2 changed files with 29 additions and 2 deletions

View File

@ -14,8 +14,7 @@ use Doctrine\Common\Collections\Collection;
/**
* This class represents a relation.
* It allows a better right management of the meta informations.
* Also it is used to capsel the logic relation to an own logical unit.
* A relationship represents the creators and the created objects.
*
* @author kevinfrantz
*

View File

@ -0,0 +1,28 @@
<?php
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;
public function setUp():void{
$this->relation = new Relation();
}
public function testConstructor():void {
$this->assertInstanceOf(Collection::class, $this->relation->getChilds());
$this->assertInstanceOf(Collection::class, $this->relation->getParents());
$this->expectException(\TypeError::class);
$this->relation->getSource();
}
}