mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Implemented ActionTypeAttribut
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Entity\Attribut;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Exception\NoValidChoiceException;
|
||||
use App\Entity\Attribut\ActionTypeAttributInterface;
|
||||
use App\Entity\Attribut\ActionTypeAttribut;
|
||||
use App\DBAL\Types\ActionType;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class ActionTypeAttributTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var ActionTypeAttributInterface
|
||||
*/
|
||||
protected $actionTypeAttribut;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->actionTypeAttribut = new class() implements ActionTypeAttributInterface {
|
||||
use ActionTypeAttribut;
|
||||
};
|
||||
}
|
||||
|
||||
public function testConstructor(): void
|
||||
{
|
||||
$this->expectException(\TypeError::class);
|
||||
$this->actionTypeAttribut->getActionType();
|
||||
}
|
||||
|
||||
public function testAccessors(): void
|
||||
{
|
||||
foreach (ActionType::getChoices() as $enum) {
|
||||
$this->assertNull($this->actionTypeAttribut->setActionType($enum));
|
||||
$this->assertEquals($enum, $this->actionTypeAttribut->getActionType());
|
||||
}
|
||||
$this->expectException(NoValidChoiceException::class);
|
||||
$this->actionTypeAttribut->setActionType('NoneValidType');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user