In between commit refactoring and implementing tests

This commit is contained in:
Kevin Frantz
2018-10-28 20:28:29 +01:00
parent 89396dfef3
commit de51649d63
21 changed files with 105 additions and 148 deletions

View File

@@ -0,0 +1,44 @@
<?php
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;
/**
*
* @author kevinfrantz
*
*/
class AbstractSourceTest extends TestCase
{
const ID = 123;
/**
* @var SourceInterface
*/
protected $source;
public function setUp(){
$this->source = new class extends \App\Entity\Source\AbstractSource{};
$this->source->setId(self::ID);
}
public function testId(){
$this->assertEquals($this->source->getId(),self::ID);
}
public function testLaw(){
$this->assertInstanceOf(LawInterface::class,$this->source->getLaw());
}
public function testRelation(){
$this->assertInstanceOf(RelationInterface::class,$this->source->getRelation());
}
public function testGroups(){
$this->assertInstanceOf(Collection::class,$this->source->getGroupSources());
}
}