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