mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Implemented test for law entity
This commit is contained in:
parent
df359a26e8
commit
4678e14b34
@ -9,7 +9,8 @@ use App\Entity\AbstractEntity;
|
|||||||
*/
|
*/
|
||||||
abstract class AbstractMeta extends AbstractEntity implements MetaInterface
|
abstract class AbstractMeta extends AbstractEntity implements MetaInterface
|
||||||
{
|
{
|
||||||
public function __construct(){
|
public function __construct()
|
||||||
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
33
application/tests/unit/Entity/Meta/LawTest.php
Normal file
33
application/tests/unit/Entity/Meta/LawTest.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity\Meta;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
|
||||||
|
class LawTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var LawInterface
|
||||||
|
*/
|
||||||
|
protected $law;
|
||||||
|
|
||||||
|
public function setUp(): void
|
||||||
|
{
|
||||||
|
$this->law = new Law();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testConstruct(): void
|
||||||
|
{
|
||||||
|
$this->assertInstanceOf(Collection::class, $this->law->getRights());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testRights(): void
|
||||||
|
{
|
||||||
|
$right = new Right();
|
||||||
|
$rights = new ArrayCollection([$right, new Right(), new Right()]);
|
||||||
|
$this->assertNull($this->law->setRights($rights));
|
||||||
|
$this->assertEquals($right, $this->law->getRights()->get(0));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user