From 05cd278dab63e15fd2820cbe23d8cf81f651da57 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sat, 26 Jan 2019 16:42:13 +0100 Subject: [PATCH] Added RequestedRightAttribut --- .../src/Attribut/RequestedRightAttribut.php | 34 ++++++++++++++++ .../RequestedRightAttributInterface.php | 21 ++++++++++ .../Attribut/RequestedRightAttributTest.php | 39 +++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 application/symfony/src/Attribut/RequestedRightAttribut.php create mode 100644 application/symfony/src/Attribut/RequestedRightAttributInterface.php create mode 100644 application/symfony/tests/Unit/Attribut/RequestedRightAttributTest.php diff --git a/application/symfony/src/Attribut/RequestedRightAttribut.php b/application/symfony/src/Attribut/RequestedRightAttribut.php new file mode 100644 index 0000000..8cc49c9 --- /dev/null +++ b/application/symfony/src/Attribut/RequestedRightAttribut.php @@ -0,0 +1,34 @@ +requestedRight = $requestedRight; + } + + /** + * @return RequestedRightInterface + */ + public function getRequestedRight(): RequestedRightInterface + { + return $this->requestedRight; + } +} diff --git a/application/symfony/src/Attribut/RequestedRightAttributInterface.php b/application/symfony/src/Attribut/RequestedRightAttributInterface.php new file mode 100644 index 0000000..9d0b3d0 --- /dev/null +++ b/application/symfony/src/Attribut/RequestedRightAttributInterface.php @@ -0,0 +1,21 @@ +requestedRightAttribut = new class() implements RequestedRightAttributInterface { + use RequestedRightAttribut; + }; + } + + public function testConstructor(): void + { + $this->expectException(\TypeError::class); + $this->requestedRightAttribut->getRequestedRight(); + } + + public function testAccessors(): void + { + $requestedRight = $this->createMock(RequestedRightInterface::class); + $this->assertNull($this->requestedRightAttribut->setRequestedRight($requestedRight)); + $this->assertEquals($reciever, $this->requestedRightAttribut->getRequestedRight()); + } +}