From 36f8e597f795d7bfc5f46e0b7c38f6c239e55136 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sat, 5 Jan 2019 18:06:50 +0100 Subject: [PATCH] Implemented more layers --- .../API/Meta/HeredityApiController.php | 30 +++++++++++++++++++ .../API/Meta/MemberApiController.php | 30 +++++++++++++++++++ .../src/DBAL/Types/Meta/Right/LayerType.php | 13 ++++++-- .../RightManagement/RightCheckerTest.php | 2 +- .../Entity/Attribut/LayerAttributTest.php | 6 +--- 5 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 application/src/Controller/API/Meta/HeredityApiController.php create mode 100644 application/src/Controller/API/Meta/MemberApiController.php diff --git a/application/src/Controller/API/Meta/HeredityApiController.php b/application/src/Controller/API/Meta/HeredityApiController.php new file mode 100644 index 0000000..ae0c607 --- /dev/null +++ b/application/src/Controller/API/Meta/HeredityApiController.php @@ -0,0 +1,30 @@ + 'relation', - self::LAW => 'law', self::SOURCE => 'source', + self::LAW => 'law', + self::RIGHT => 'right', + self::MEMBER => 'member', + self::HEREDITY => 'heredity', ]; } diff --git a/application/tests/Unit/Domain/RightManagement/RightCheckerTest.php b/application/tests/Unit/Domain/RightManagement/RightCheckerTest.php index c0be286..1f13485 100644 --- a/application/tests/Unit/Domain/RightManagement/RightCheckerTest.php +++ b/application/tests/Unit/Domain/RightManagement/RightCheckerTest.php @@ -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(); diff --git a/application/tests/Unit/Entity/Attribut/LayerAttributTest.php b/application/tests/Unit/Entity/Attribut/LayerAttributTest.php index 13affff..8c022b5 100644 --- a/application/tests/Unit/Entity/Attribut/LayerAttributTest.php +++ b/application/tests/Unit/Entity/Attribut/LayerAttributTest.php @@ -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()); }