infinito/application/tests/Unit/Entity/Source/AbstractSourceTest.php

37 lines
942 B
PHP
Raw Normal View History

<?php
2018-10-29 19:01:00 +01:00
namespace tests\unit\Entity\Source;
use PHPUnit\Framework\TestCase;
use App\Entity\Source\SourceInterface;
use App\Entity\Meta\LawInterface;
use App\Entity\Meta\RelationInterface;
use Doctrine\Common\Collections\Collection;
2018-10-28 22:43:35 +01:00
use App\Entity\Source\AbstractSource;
use App\Entity\EntityInterface;
/**
* @author kevinfrantz
*/
class AbstractSourceTest extends TestCase
{
/**
* @var SourceInterface
*/
protected $source;
2018-10-29 19:01:00 +01:00
public function setUp()
{
$this->source = new class() extends AbstractSource {
2018-10-29 19:01:00 +01:00
};
}
2018-10-29 19:01:00 +01:00
public function testConstructor(): void
{
$this->assertInstanceOf(EntityInterface::class, $this->source);
$this->assertInstanceOf(RelationInterface::class, $this->source->getRelation());
$this->assertInstanceOf(Collection::class, $this->source->getMemberships());
2018-10-29 19:01:00 +01:00
$this->assertInstanceOf(LawInterface::class, $this->source->getLaw());
}
2018-11-01 22:34:26 +01:00
}