get('form.factory'); $entityManager = static::$kernel->getContainer() ->get('doctrine') ->getManager(); $security = $this->createMock(Security::class); $userSourceDirectorService = new UserSourceDirectorService($entityManager, $security); $requestedEntityService = new RequestedEntityService(); $requestedRightService = new RequestedRightService($requestedEntityService); $requestedUserService = new RequestedUserService($userSourceDirectorService, $requestedRightService); $this->requestedActionService = new RequestedActionService($requestedUserService); $this->requestedActionService->setActionType(ActionType::CREATE); $formClassNameService = new FormClassNameService(); $entityFormBuilderService = new RequestedActionFormBuilderService($formFactory, $formClassNameService, $this->requestedActionService); $this->request = new Request(); $requestStack = $this->createMock(RequestStack::class); $requestStack->method('getCurrentRequest')->willReturn($this->request); $layerRepositoryFactoryService = $this->createMock(LayerRepositoryFactoryServiceInterface::class); $secureRequestedRightChecker = $this->createMock(SecureRequestedRightCheckerInterface::class); $this->actionService = new ActionService($this->requestedActionService, $secureRequestedRightChecker, $requestStack, $layerRepositoryFactoryService, $entityFormBuilderService, $entityManager); $this->createSourceAction = new CreateSourceAction($this->actionService); } public function testCreateWithGuestUser(): void { $this->assertInstanceOf(PureSourceInterface::class, $this->createSourceAction->execute()); } // public function testCreatedWithKnownUser(): void // {} }