requestedActionFormBuilderService = self::$container->get(RequestedActionFormBuilderServiceInterface::class); $this->requestedEntity = self::$container->get(RequestedEntityServiceInterface::class); $this->requestedActionService = self::$container->get(RequestedActionServiceInterface::class); $this->requestedActionService->setActionType(ActionType::CREATE); } public function testCreate(): void { $class = PureSource::class; $this->requestedEntity->setClass($class); $result = $this->requestedActionFormBuilderService->create($this->requestedActionService); $this->assertInstanceOf(FormBuilderInterface::class, $result); $this->assertInstanceOf(Form::class, $result->getForm()); $this->assertTrue(method_exists($result->getForm(), 'isValid')); //Tests if the origine builder and the service function return the same value by the requestedActionService $this->assertEquals($this->requestedActionFormBuilderService->create($this->requestedActionService), $this->requestedActionFormBuilderService->createByService()); } }