Implemented more layers

This commit is contained in:
Kevin Frantz 2019-01-05 18:06:50 +01:00
parent 19dd487c91
commit 36f8e597f7
5 changed files with 72 additions and 9 deletions

View File

@ -0,0 +1,30 @@
<?php
namespace App\Controller\API\Meta;
use App\Controller\API\AbstractAPIController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class HeredityApiController extends AbstractAPIController
{
public function read(Request $request, $identifier): Response
{
}
public function create(Request $request): Response
{
}
public function update(Request $request, $identifier): Response
{
}
public function list(Request $request): Response
{
}
public function delete(Request $request, $identifier): Response
{
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Controller\API\Meta;
use App\Controller\API\AbstractAPIController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class MemberApiController extends AbstractAPIController
{
public function read(Request $request, $identifier): Response
{
}
public function create(Request $request): Response
{
}
public function update(Request $request, $identifier): Response
{
}
public function list(Request $request): Response
{
}
public function delete(Request $request, $identifier): Response
{
}
}

View File

@ -9,7 +9,9 @@ use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;
*/
final class LayerType extends AbstractEnumType
{
public const RELATION = 'relation';
public const HEREDITY = 'heredity';
public const RIGHT = 'right';
public const SOURCE = 'source';
@ -17,9 +19,14 @@ final class LayerType extends AbstractEnumType
public const MEMBER = 'member';
/**
* @var array Ordered by the importants of implementation
*/
protected static $choices = [
self::RELATION => 'relation',
self::LAW => 'law',
self::SOURCE => 'source',
self::LAW => 'law',
self::RIGHT => 'right',
self::MEMBER => 'member',
self::HEREDITY => 'heredity',
];
}

View File

@ -41,7 +41,7 @@ class RightCheckerTest extends TestCase
public function setUp(): void
{
$this->layer = LayerType::RELATION;
$this->layer = LayerType::MEMBER;
$this->type = CRUDType::READ;
$this->source = new PureSource();
$this->right = new Right();

View File

@ -29,11 +29,7 @@ class LayerAttributTest extends TestCase
public function testAccessors(): void
{
foreach ([
LayerType::LAW,
LayerType::RELATION,
LayerType::SOURCE,
] as $value) {
foreach (LayerType::getChoices() as $value) {
$this->assertNull($this->layer->setLayer($value));
$this->assertEquals($value, $this->layer->getLayer());
}