Implemented ActionType

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

No files matched your search

@@ -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',
];
}
@@ -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';
@@ -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()));
}
}