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(); $this->requestStack = new RequestStack(); $this->requestStack->push($this->request); $layerRepositoryFactoryService = new LayerRepositoryFactoryService($entityManager); $rightTransformerService = new RightTransformerService(); $secureRequestedRightChecker = new SecureRequestedRightCheckerService($rightTransformerService); $this->actionService = new ActionDependenciesDAOService($this->requestedActionService, $secureRequestedRightChecker, $this->requestStack, $layerRepositoryFactoryService, $entityFormBuilderService, $entityManager); $this->createSourceAction = new CreateSourceAction($this->actionService); } public function testPreconditions(): void { $this->assertEquals($this->request, $this->requestStack->getCurrentRequest()); } public function testCreateWithGuestUser(): void { $this->request->setMethod(Request::METHOD_POST); $this->request->attributes->set(ClassAttributInterface::CLASS_ATTRIBUT_NAME, PureSource::class); $this->assertInstanceOf(PureSourceInterface::class, $this->createSourceAction->execute()); } // public function testCreatedWithKnownUser(): void // {} }