createMock(RequestedRightInterface::class); $this->requestedAction = new RequestedAction($requestedRight); $this->actionService = $this->createMock(ActionServiceInterface::class); $this->actionService->method('getRequestedAction')->willReturn($this->requestedAction); $this->actionFactoryService = new ActionFactoryService($this->actionService); } public function testCreate(): void { foreach (ActionType::getChoices() as $action) { foreach (LayerType::getChoices() as $layer) { $this->requestedAction->setLayer($layer); $this->requestedAction->setActionType($action); $result = $this->actionFactoryService->create(); $this->assertInstanceOf(ActionInterface::class, $result); } } } }