mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Implemented tests for relation attribute trait
This commit is contained in:
parent
cf625f02a6
commit
98a868285f
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Tests\Unit\Entity\Attribut;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use App\Entity\Meta\RelationInterface;
|
||||||
|
use App\Entity\Attribut\RelationAttributInterface;
|
||||||
|
use App\Entity\Attribut\RelationAttribut;
|
||||||
|
|
||||||
|
class RelationAttributTest extends TestCase
|
||||||
|
{
|
||||||
|
/***
|
||||||
|
* @var RelationAttributInterface
|
||||||
|
*/
|
||||||
|
protected $relationAttribut;
|
||||||
|
|
||||||
|
public function setUp(): void
|
||||||
|
{
|
||||||
|
$this->relationAttribut = new class() implements RelationAttributInterface {
|
||||||
|
use RelationAttribut;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAccessors(): void
|
||||||
|
{
|
||||||
|
$relation = $this->createMock(RelationInterface::class);
|
||||||
|
$this->assertNull($this->relationAttribut->setRelation($relation));
|
||||||
|
$this->assertEquals($relation, $this->relationAttribut->getRelation());
|
||||||
|
}
|
||||||
|
}
|
@ -28,6 +28,11 @@ class AbstractSourceTest extends TestCase
|
|||||||
$this->source->setId(self::ID);
|
$this->source->setId(self::ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testConstructor(): void
|
||||||
|
{
|
||||||
|
$this->assertInstanceOf(RelationInterface::class, $this->source->getRelation());
|
||||||
|
}
|
||||||
|
|
||||||
public function testId()
|
public function testId()
|
||||||
{
|
{
|
||||||
$this->assertEquals($this->source->getId(), self::ID);
|
$this->assertEquals($this->source->getId(), self::ID);
|
||||||
@ -38,11 +43,6 @@ class AbstractSourceTest extends TestCase
|
|||||||
$this->assertInstanceOf(LawInterface::class, $this->source->getLaw());
|
$this->assertInstanceOf(LawInterface::class, $this->source->getLaw());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRelation()
|
|
||||||
{
|
|
||||||
$this->assertInstanceOf(RelationInterface::class, $this->source->getRelation());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGroups()
|
public function testGroups()
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf(Collection::class, $this->source->getGroupSources());
|
$this->assertInstanceOf(Collection::class, $this->source->getGroupSources());
|
||||||
|
Loading…
Reference in New Issue
Block a user