mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +01:00
Implemented test for NameSource
This commit is contained in:
parent
6e058e61b5
commit
cb0e3739b1
@ -6,6 +6,8 @@ use App\Entity\Source\SourceInterface;
|
|||||||
use App\Entity\Meta\LawInterface;
|
use App\Entity\Meta\LawInterface;
|
||||||
use App\Entity\Meta\RelationInterface;
|
use App\Entity\Meta\RelationInterface;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
use App\Entity\Source\AbstractSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -39,6 +41,10 @@ class AbstractSourceTest extends TestCase
|
|||||||
|
|
||||||
public function testGroups(){
|
public function testGroups(){
|
||||||
$this->assertInstanceOf(Collection::class,$this->source->getGroupSources());
|
$this->assertInstanceOf(Collection::class,$this->source->getGroupSources());
|
||||||
|
$group = new class extends AbstractSource{};
|
||||||
|
$groups = new ArrayCollection([$group]);
|
||||||
|
$this->source->setGroupSources($groups);
|
||||||
|
$this->assertEquals($group, $this->source->getGroupSources()->get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
34
application/tests/unit/Entity/Source/NameSourceTest.php
Normal file
34
application/tests/unit/Entity/Source/NameSourceTest.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
namespace tests\unit\Entity\Source;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use App\Entity\Source\NameSourceInterface;
|
||||||
|
use App\Entity\Source\NameSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author kevinfrantz
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class NameSourceTest extends TestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @var NameSourceInterface
|
||||||
|
*/
|
||||||
|
protected $nameSource;
|
||||||
|
|
||||||
|
public function setUp(): void
|
||||||
|
{
|
||||||
|
$this->nameSource = new NameSource();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testName():void{
|
||||||
|
$this->assertEquals('', $this->nameSource->getName());
|
||||||
|
$name = 'Hello World!';
|
||||||
|
$this->nameSource->setName($name);
|
||||||
|
$this->assertEquals($name, $this->nameSource->getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user