Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->zoneProvider = $this->getMock('Silvestra\\Component\\Banner\\Provider\\BannerZoneProviderInterface');
     $this->factory = Forms::createFormFactoryBuilder()->addTypeExtension($this->createValidatorExtension())->addTypeGuesser($this->getMockValidatorTypeGuesser())->addTypes(array(new BannerZoneType('Silvestra\\Component\\Banner\\Model\\BannerZone', $this->zoneProvider)))->getFormFactory();
     $this->builder = $this->createFormBuilder();
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $localeHelper = $this->getMockBuilder('Silvestra\\Component\\Locale\\Helper\\LocaleHelper')->disableOriginalConstructor()->getMock();
     $localeHelper->expects($this->any())->method('getDisplayLocales')->willReturn(array('en' => 'English'));
     $imageDefaultConfig = $this->getMockBuilder('Silvestra\\Component\\Media\\Image\\Config\\ImageDefaultConfig')->disableOriginalConstructor()->getMock();
     $tokenGenerator = $this->getMockBuilder('Silvestra\\Component\\Media\\Token\\TokenGenerator')->disableOriginalConstructor()->getMock();
     $transformer = $this->getMockBuilder('Silvestra\\Component\\Media\\Form\\DataTransformer\\ImageTransformer')->disableOriginalConstructor()->getMock();
     $this->factory = Forms::createFormFactoryBuilder()->addTypeExtension($this->createValidatorExtension())->addTypeGuesser($this->getMockValidatorTypeGuesser())->addTypes(array(new BannerType('Silvestra\\Component\\Banner\\Model\\Banner', $localeHelper), new ImageType('Silvestra\\Component\\Media\\Model\\Image', 'silvestra.png', $imageDefaultConfig, $tokenGenerator, $transformer)))->getFormFactory();
     $this->builder = $this->createFormBuilder();
 }