requestedEntity = $this->createMock(RequestedEntityInterface::class); $this->requestedAction = $this->createMock(RequestedActionInterface::class); $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->method('getLayer')->willReturn($layer); $this->requestedAction->method('getActionType')->willReturn($action); $action = $this->actionFactoryService->create(); $this->assertInstanceOf(ActionInterface::class, $action); } } } }