$actions) { foreach ($actions as $action) { $requestedRight = new RequestedRight(); $userSourceDirector = $this->createMock(UserSourceDirectorInterface::class); $requestedUser = new RequestedUser($userSourceDirector, $requestedRight); $requestedAction = new RequestedAction($requestedUser); $actionService = $this->createMock(ActionServiceInterface::class); $actionService->method('getRequestedAction')->willReturn($requestedAction); $actionFactoryService = new ActionFactoryService($actionService); $requestedAction->setLayer($layer); $requestedAction->setActionType($action); $result = $actionFactoryService->create(); $this->assertInstanceOf(ActionInterface::class, $result); } } } }