mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Implemented ActionType
This commit is contained in:
parent
4a40f78e7d
commit
71c7a7f080
23
application/symfony/src/DBAL/Types/ActionType.php
Normal file
23
application/symfony/src/DBAL/Types/ActionType.php
Normal 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',
|
||||||
|
];
|
||||||
|
}
|
@ -7,7 +7,7 @@ use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;
|
|||||||
/**
|
/**
|
||||||
* @author kevinfrantz
|
* @author kevinfrantz
|
||||||
*/
|
*/
|
||||||
final class CRUDType extends AbstractEnumType
|
class CRUDType extends AbstractEnumType
|
||||||
{
|
{
|
||||||
public const CREATE = 'create';
|
public const CREATE = 'create';
|
||||||
|
|
||||||
|
17
application/symfony/tests/Unit/DBAL/Types/ActionTypeTest.php
Normal file
17
application/symfony/tests/Unit/DBAL/Types/ActionTypeTest.php
Normal 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()));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user