mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 06:01:35 +01:00
Implemented Tests for grant attribut
This commit is contained in:
parent
a3d10ac9af
commit
d2ffabec14
35
application/tests/Unit/Entity/Attribut/GrantAttributTest.php
Normal file
35
application/tests/Unit/Entity/Attribut/GrantAttributTest.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Entity\Attribut;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Entity\Attribut\GrantAttribut;
|
||||
use App\Entity\Attribut\GrantAttributInterface;
|
||||
|
||||
class GrantAttributTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var GrantAttributInterface
|
||||
*/
|
||||
protected $grant;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->grant = new class() implements GrantAttributInterface {
|
||||
use GrantAttribut;
|
||||
};
|
||||
}
|
||||
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$this->expectException(\TypeError::class);
|
||||
$this->grant->getGrant();
|
||||
}
|
||||
|
||||
public function testAccessors(): void
|
||||
{
|
||||
$grant = true;
|
||||
$this->assertNull($this->grant->setGrant($grant));
|
||||
$this->assertEquals($grant, $this->grant->getGrant());
|
||||
}
|
||||
}
|
@ -28,6 +28,7 @@ class RightTest extends TestCase
|
||||
public function testConstructorGeneral(): void
|
||||
{
|
||||
$this->assertEquals($this->right, $this->right->getReciever()->getRight());
|
||||
$this->assertTrue($this->right->getGrant());
|
||||
$this->expectException(\TypeError::class);
|
||||
$this->assertNull($this->right->getLaw());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user