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');
     }
 }
Esempio n. 3
0
 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()
 {
     // we test against different locales, so we need the full
     // implementation
     IntlTestHelper::requireFullIntl($this);
     parent::setUp();
 }
 /**
  * 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);
 }
Esempio n. 8
0
 protected function getExtensions()
 {
     return array_merge(parent::getExtensions(), array(new ValidatorExtension($this->validator)));
 }
Esempio n. 9
0
 protected function getExtensions()
 {
     return array_merge(parent::getExtensions(), array(new DoctrineOrmExtension($this->createRegistryMock('default', $this->em))));
 }
Esempio n. 10
0
 protected function setUp()
 {
     IntlTestHelper::requireIntl($this);
     parent::setUp();
     $this->defaultTimezone = date_default_timezone_get();
 }
Esempio n. 11
0
 protected function getExtensions()
 {
     return array_merge(parent::getExtensions(), array(new CsrfExtension($this->csrfProvider)));
 }
Esempio n. 12
0
 protected function tearDown()
 {
     parent::tearDown();
     $this->objectChoices = null;
 }
 protected function getExtensions()
 {
     return array_merge(parent::getExtensions(), array(new CmfCoreExtension()));
 }
Esempio n. 14
0
 protected function getExtensions()
 {
     return array_merge(parent::getExtensions(), array(new FilterExtension($this->filter, $this->autoFilter)));
 }
Esempio n. 15
0
 public function setUp()
 {
     parent::setUp();
     $this->session = $this->getMock('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface');
     $this->type = new AuthenticationType($this->session);
 }
Esempio n. 16
0
 protected function setUp()
 {
     parent::setUp();
     $this->valueListeService = $this->getMockBuilder('BF13\\Component\\ValueList\\ValueList')->disableOriginalConstructor()->setMethods(array('getListValues'))->getMock();
 }
Esempio n. 17
0
 public function setUp()
 {
     parent::setUp();
     \Locale::setDefault('en');
 }
Esempio n. 18
0
 protected function getExtensions()
 {
     return array_merge(parent::getExtensions(), array(new DoctrineOrmExtension($this->emRegistry)));
 }
Esempio n. 19
0
 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')));
 }