protected function setUp() { parent::setUp(); if (!class_exists('Symfony\\Component\\Form\\Form')) { $this->markTestSkipped('The "Form" component is not available'); } if (!class_exists('Doctrine\\DBAL\\Platforms\\MySqlPlatform')) { $this->markTestSkipped('Doctrine DBAL is not available.'); } if (!class_exists('Doctrine\\Common\\Version')) { $this->markTestSkipped('Doctrine Common is not available.'); } if (!class_exists('Doctrine\\ORM\\EntityManager')) { $this->markTestSkipped('Doctrine ORM is not available.'); } $this->em = DoctrineTestHelper::createTestEntityManager(); $this->emRegistry = $this->createRegistryMock('default', $this->em); $this->items = array(); $schemaTool = new SchemaTool($this->em); $classes = array($this->em->getClassMetadata(self::SINGLE_INT_ID_CLASS)); try { $schemaTool->dropSchema($classes); } catch (\Exception $e) { } try { $schemaTool->createSchema($classes); } catch (\Exception $e) { } $this->createEntities(); $this->factory = Forms::createFormFactoryBuilder()->addExtensions($this->getExtensions())->addTypeExtension(new ChoiceSelect2TypeExtension($this->dispatcher, $this->requestStack, $this->router, $this->getExtensionTypeName(), 10))->addType(new EntityType($this->emRegistry))->addTypeExtension(new EntitySelect2TypeExtension())->getFormFactory(); $this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory); }
protected function setUp() { parent::setUp(); /* @var EventDispatcherInterface $dispatcher */ $dispatcher = $this->dispatcher; /* @var RouterInterface $router */ $router = $this->router; $this->factory = Forms::createFormFactoryBuilder()->addExtensions($this->getExtensions())->addTypeExtension(new ChoiceSelect2TypeExtension($dispatcher, $this->requestStack, $router, ChoiceType::class, 10))->addTypeExtension(new ChoiceSelect2TypeExtension($dispatcher, $this->requestStack, $router, CurrencyType::class, 10))->addTypeExtension(new BaseChoiceSelect2TypeExtension(CurrencyType::class))->addTypeExtension(new CollectionSelect2TypeExtension(10))->getFormFactory(); $this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory); }