protected function setUp() { parent::setUp(); // we test against "de_AT", so we need the full implementation IntlTestHelper::requireFullIntl($this); \Locale::setDefault('de_AT'); }
protected function setUp() { parent::setUp(); $this->factory = Forms::createFormFactoryBuilder()->addTypeExtension(new FormTypeValidatorExtension($this->getMock('Symfony\\Component\\Validator\\ValidatorInterface')))->addTypeGuesser($this->getMockBuilder('Symfony\\Component\\Form\\Extension\\Validator\\ValidatorTypeGuesser')->disableOriginalConstructor()->getMock())->getFormFactory(); $this->dispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface'); $this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory); }
protected function setUp() { parent::setUp(); if (!interface_exists('Neutron\\DataGridBundle\\DataGrid\\DataGridInterface')) { $this->markTestSkipped('DataGridBundle is not available'); } }
protected function setUp() { // we test against different locales, so we need the full // implementation IntlTestHelper::requireFullIntl($this); parent::setUp(); }
protected function 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 = DoctrineOrmTestCase::createTestEntityManager(); $this->emRegistry = $this->createRegistryMock('default', $this->em); parent::setUp(); $schemaTool = new SchemaTool($this->em); $classes = array($this->em->getClassMetadata(self::ITEM_GROUP_CLASS), $this->em->getClassMetadata(self::SINGLE_IDENT_CLASS), $this->em->getClassMetadata(self::SINGLE_STRING_IDENT_CLASS), $this->em->getClassMetadata(self::COMPOSITE_IDENT_CLASS), $this->em->getClassMetadata(self::COMPOSITE_STRING_IDENT_CLASS)); try { $schemaTool->dropSchema($classes); } catch (\Exception $e) { } try { $schemaTool->createSchema($classes); } catch (\Exception $e) { } }
/** * Set up test */ public function setUp() { if (!interface_exists('\\Metadata\\MetadataFactoryInterface') or !interface_exists('\\Doctrine\\ORM\\EntityManagerInterface')) { $this->markTestSkipped('Serializer and Doctrine has to be loaded to run this test'); } parent::setUp(); $this->class = 'Sonata\\CoreBundle\\Tests\\Form\\Type\\FakeMetadataClass'; }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); // redefine form factory and builder to add translatable field $this->builder->add('pim_translatable_field'); $this->builder->add('pim_number'); $this->builder->add('entity'); $this->builder->add('switch'); $this->factory = Forms::createFormFactoryBuilder()->addExtensions($this->getExtensions())->addTypeExtension(new FormTypeSelect2Extension())->addTypeExtension(new FormTypeValidatorExtension($this->getMock('Symfony\\Component\\Validator\\ValidatorInterface')))->addType(new TranslatableFieldType($this->getMock('Symfony\\Component\\Validator\\ValidatorInterface'), $this->getUserContextMock(), $this->getLocaleHelperMock()))->addType(new \Pim\Bundle\UIBundle\Form\Type\NumberType())->addType($this->createEntityType())->addType(new SwitchType())->getFormFactory(); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); // redefine form factory and builder to add translatable field $this->builder->add('pim_translatable_field'); $this->factory = Forms::createFormFactoryBuilder()->addTypeExtension(new FormTypeValidatorExtension($this->getMock('Symfony\\Component\\Validator\\ValidatorInterface')))->addType(new TranslatableFieldType($this->getMock('Symfony\\Component\\Validator\\ValidatorInterface'), $this->getUserContextMock(), $this->getLocaleHelperMock()))->getFormFactory(); // Create form type $this->type = new TranslatableFieldType($this->getMock('Symfony\\Component\\Validator\\ValidatorInterface'), $this->getUserContextMock(), $this->getLocaleHelperMock()); $this->options = $this->buildOptions(self::OPT_ENTITY_CLASS, self::OPT_NAME, self::OPT_TRANSLATION_CLASS); $this->form = $this->factory->create($this->type, null, $this->options); }
protected function setUp() { if (!class_exists('Symfony\\Component\\Validator\\Constraint')) { $this->markTestSkipped('The "Validator" component is not available'); } $this->validator = $this->getMock('Symfony\\Component\\Validator\\ValidatorInterface'); $metadataFactory = $this->getMock('Symfony\\Component\\Validator\\MetadataFactoryInterface'); $this->validator->expects($this->once())->method('getMetadataFactory')->will($this->returnValue($metadataFactory)); $metadata = $this->getMockBuilder('Symfony\\Component\\Validator\\Mapping\\ClassMetadata')->disableOriginalConstructor()->getMock(); $metadataFactory->expects($this->once())->method('getMetadataFor')->will($this->returnValue($metadata)); parent::setUp(); }
protected function setUp() { parent::setUp(); $this->objectChoices = array( (object) array('id' => 1, 'name' => 'Bernhard'), (object) array('id' => 2, 'name' => 'Fabien'), (object) array('id' => 3, 'name' => 'Kris'), (object) array('id' => 4, 'name' => 'Jon'), (object) array('id' => 5, 'name' => 'Roman'), ); }
protected function setUp() { IntlTestHelper::requireIntl($this); parent::setUp(); $this->defaultTimezone = date_default_timezone_get(); }
protected function setUp() { $this->csrfProvider = $this->getMock('Symfony\\Component\\Form\\Extension\\Csrf\\CsrfProvider\\CsrfProviderInterface'); parent::setUp(); }
protected function setUp() { parent::setUp(); $this->valueListeService = $this->getMockBuilder('BF13\\Component\\ValueList\\ValueList')->disableOriginalConstructor()->setMethods(array('getListValues'))->getMock(); }
protected function setUp() { $this->filter = $this->getMock('DMS\\Bundle\\FilterBundle\\Service\\Filter'); parent::setUp(); }
protected function setUp() { parent::setUp(); }
public function setUp() { parent::setUp(); $this->session = $this->getMock('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface'); $this->type = new AuthenticationType($this->session); }
public function setUp() { parent::setUp(); \Locale::setDefault('en'); }
protected function setUp() { IntlTestHelper::requireIntl($this); parent::setUp(); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->type = new MediaType(); $this->form = $this->factory->create($this->type); }
public function setUp() { parent::setUp(); $this->factory->addType(new CkeditorType($this->get('service_container'))); }