mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Implemented tests for relation
This commit is contained in:
parent
7d8a15e8ae
commit
2e9b33c82b
@ -14,8 +14,7 @@ use Doctrine\Common\Collections\Collection;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a relation.
|
* This class represents a relation.
|
||||||
* It allows a better right management of the meta informations.
|
* A relationship represents the creators and the created objects.
|
||||||
* Also it is used to capsel the logic relation to an own logical unit.
|
|
||||||
*
|
*
|
||||||
* @author kevinfrantz
|
* @author kevinfrantz
|
||||||
*
|
*
|
||||||
|
28
application/tests/Unit/Entity/Meta/RelationTest.php
Normal file
28
application/tests/Unit/Entity/Meta/RelationTest.php
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user