mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2026-10-30 09:12:09 +00:00
Optimized for SPA
This commit is contained in:
1 parent
9e685260e9
commit
bccd6efaff
393 files changed
+253
-37
No files matched your search
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace tests\unit\Entity\Meta;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Entity\Meta\LawInterface;
|
||||
use App\Entity\Meta\Law;
|
||||
use App\Entity\Meta\Right;
|
||||
|
||||
class LawTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var LawInterface
|
||||
*/
|
||||
protected $law;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->law = new Law();
|
||||
}
|
||||
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$this->assertFalse($this->law->getGrant());
|
||||
$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));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user