diff --git a/application/symfony/src/Domain/ActionManagement/ActionService.php b/application/symfony/src/Domain/ActionManagement/ActionService.php new file mode 100644 index 0000000..a41ed8e --- /dev/null +++ b/application/symfony/src/Domain/ActionManagement/ActionService.php @@ -0,0 +1,51 @@ +requestedAction = $requestedAction; + $this->secureRequestedRightChecker = $secureRequestedRightChecker; + } + + /** + * {@inheritdoc} + * + * @see \App\Domain\ActionManagement\ActionServiceInterface::getRequestedAction() + */ + public function getRequestedAction(): RequestedActionInterface + { + return $this->requestedAction; + } + + /** + * {@inheritdoc} + * + * @see \App\Domain\ActionManagement\ActionServiceInterface::isRequestedActionSecure() + */ + public function isRequestedActionSecure(): bool + { + return $this->secureRequestedRightChecker->check($this->requestedAction); + } +} diff --git a/application/symfony/src/Domain/ActionManagement/ActionServiceInterface.php b/application/symfony/src/Domain/ActionManagement/ActionServiceInterface.php new file mode 100644 index 0000000..7250d5f --- /dev/null +++ b/application/symfony/src/Domain/ActionManagement/ActionServiceInterface.php @@ -0,0 +1,23 @@ +createMock(RequestedActionInterface::class); + $secureRequestedRightChecker = $this->createMock(SecureRequestedRightCheckerInterface::class); + $secureRequestedRightChecker->method('check')->willReturn(true); + $actionService = new ActionService($requestedAction, $secureRequestedRightChecker); + $this->assertTrue($actionService->isRequestedActionSecure()); + } + + public function testRequestedActionGetter() + { + $requestedAction = $this->createMock(RequestedActionInterface::class); + $secureRequestedRightChecker = $this->createMock(SecureRequestedRightCheckerInterface::class); + $actionService = new ActionService($requestedAction, $secureRequestedRightChecker); + $this->assertInstanceOf(RequestedActionInterface::class, $actionService->getRequestedAction()); + } +}