mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 05:47:11 +02:00
Renamed TypeAttribut to CrudAttribut
This commit is contained in:
@@ -3,36 +3,36 @@
|
||||
namespace Tests\Unit\Entity\Attribut;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Entity\Attribut\TypeAttributInterface;
|
||||
use App\Entity\Attribut\TypeAttribut;
|
||||
use App\Entity\Attribut\CrudAttributInterface;
|
||||
use App\Entity\Attribut\CrudAttribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class TypeAttributTest extends TestCase
|
||||
class CrudAttributTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var TypeAttributInterface
|
||||
* @var CrudAttributInterface
|
||||
*/
|
||||
protected $typeAttribut;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->typeAttribut = new class() implements TypeAttributInterface {
|
||||
use TypeAttribut;
|
||||
$this->typeAttribut = new class() implements CrudAttributInterface {
|
||||
use CrudAttribut;
|
||||
};
|
||||
}
|
||||
|
||||
public function testConstructor(): void
|
||||
{
|
||||
$this->expectException(\TypeError::class);
|
||||
$this->typeAttribut->getType();
|
||||
$this->typeAttribut->getCrud();
|
||||
}
|
||||
|
||||
public function testAccessors(): void
|
||||
{
|
||||
$type = 'Hello World!';
|
||||
$this->assertNull($this->typeAttribut->setType($type));
|
||||
$this->assertEquals($type, $this->typeAttribut->getType());
|
||||
$this->assertNull($this->typeAttribut->setCrud($type));
|
||||
$this->assertEquals($type, $this->typeAttribut->getCrud());
|
||||
}
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ class RightTest extends TestCase
|
||||
public function testConstructorType(): void
|
||||
{
|
||||
$this->expectException(\TypeError::class);
|
||||
$this->assertNull($this->right->getType());
|
||||
$this->assertNull($this->right->getCrud());
|
||||
}
|
||||
|
||||
public function testLaw(): void
|
||||
@@ -74,11 +74,11 @@ class RightTest extends TestCase
|
||||
public function testRight(): void
|
||||
{
|
||||
foreach (CRUDType::getChoices() as $key => $value) {
|
||||
$this->assertNull($this->right->setType($key));
|
||||
$this->assertEquals($key, $this->right->getType());
|
||||
$this->assertNull($this->right->setCrud($key));
|
||||
$this->assertEquals($key, $this->right->getCrud());
|
||||
}
|
||||
$this->expectException(NoValidChoiceException::class);
|
||||
$this->right->setType('NoneValidType');
|
||||
$this->right->setCrud('NoneValidType');
|
||||
}
|
||||
|
||||
public function testLayer(): void
|
||||
@@ -104,13 +104,13 @@ class RightTest extends TestCase
|
||||
$this->right->setSource($source);
|
||||
$this->right->setReciever($reciever);
|
||||
$this->right->setGrant($grant);
|
||||
$this->right->setType($type);
|
||||
$this->right->setCrud($type);
|
||||
$this->right->setLayer($layer);
|
||||
$rightClone = clone $this->right;
|
||||
$this->assertEquals($source, $rightClone->getSource());
|
||||
$this->assertEquals($reciever, $rightClone->getReciever());
|
||||
$this->assertEquals($grant, $rightClone->getGrant());
|
||||
$this->assertEquals($type, $rightClone->getType());
|
||||
$this->assertEquals($type, $rightClone->getCrud());
|
||||
$this->assertEquals($layer, $rightClone->getLayer());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user