Implemented ActionType

This commit is contained in:
Kevin Frantz 2019-01-19 21:44:10 +01:00
parent 4a40f78e7d
commit 71c7a7f080
3 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace App\DBAL\Types;
use App\DBAL\Types\Meta\Right\CRUDType;
/**
* Containes all actions which can be done.
*
* @author kevinfrantz
*/
final class ActionType extends CRUDType
{
const LIST = 'list';
protected static $choices = [
parent::CREATE => 'create',
parent::READ => 'read',
parent::UPDATE => 'update',
parent::DELETE => 'delete',
self::LIST => 'list',
];
}

View File

@ -7,7 +7,7 @@ use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;
/**
* @author kevinfrantz
*/
final class CRUDType extends AbstractEnumType
class CRUDType extends AbstractEnumType
{
public const CREATE = 'create';

View File

@ -0,0 +1,17 @@
<?php
namespace tests\Unit\DBAL\Types;
use PHPUnit\Framework\TestCase;
use App\DBAL\Types\ActionType;
/**
* @author kevinfrantz
*/
class ActionTypeTest extends TestCase
{
public function testAmountOfActions(): void
{
$this->assertEquals(5, count(ActionType::getChoices()));
}
}