public function assertOptionsNotChangedForNonAccountUser()
 {
     $token = $this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface');
     $token->expects($this->once())->method('getUser');
     $this->tokenStorage->expects($this->once())->method('getToken')->will($this->returnValue($token));
     /** @var \PHPUnit_Framework_MockObject_MockObject|OptionsResolver $resolver */
     $resolver = $this->getMockBuilder('Symfony\\Component\\OptionsResolver\\OptionsResolver')->disableOriginalConstructor()->getMock();
     $resolver->expects($this->never())->method($this->anything());
     $this->extension->configureOptions($resolver);
 }
 public function finishView(FormView $view, FormInterface $form, array $options)
 {
     parent::finishView($view, $form, $options);
     $format = $options['format'];
     if (is_int($format)) {
         $formatter = new \IntlDateFormatter(\Locale::getDefault(), $format, \IntlDateFormatter::NONE);
         $format = $formatter->getPattern();
     }
     $view->vars['locale'] = \Locale::getDefault();
     $view->vars['format_php'] = $format;
     if ($this->convertPhpFormatToJQueryUI('yyyy') == 'y') {
         die('nan');
     }
     $format = $this->convertPhpFormatToJQueryUI($format);
     $view->vars['format_js'] = $format;
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->addModelTransformer(new DateTimeImmutableToMutableTransformer(), true);
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     // TODO: Change the autogenerated stub
     $builder->addEventListener(FormEvents::POST_SUBMIT, [$this, 'onPostSubmit']);
 }
 /**
  * @param AbstractTypeExtension $extension
  * @param array $options
  */
 private function finishView(AbstractTypeExtension $extension, array $options = [])
 {
     $resolver = new OptionsResolver();
     $extension->configureOptions($resolver);
     $extension->finishView($this->view->reveal(), $this->form->reveal(), $resolver->resolve($options));
 }
Пример #6
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('locales', LocaleChoiceType::class, ['label' => 'sylius.form.channel.locales', 'required' => false, 'multiple' => true])->add('defaultLocale', LocaleChoiceType::class, ['label' => 'sylius.form.channel.locale_default', 'required' => true, 'placeholder' => null])->add('currencies', CurrencyChoiceType::class, ['label' => 'sylius.form.channel.currencies', 'required' => false, 'multiple' => true])->add('defaultTaxZone', ZoneChoiceType::class, ['required' => false, 'label' => 'sylius.form.channel.tax_zone_default'])->add('taxCalculationStrategy', TaxCalculationStrategyChoiceType::class, ['label' => 'sylius.form.channel.tax_calculation_strategy'])->add('themeName', ThemeNameChoiceType::class, ['label' => 'sylius.form.channel.theme', 'required' => false, 'empty_data' => null, 'placeholder' => 'sylius.ui.no_theme'])->addEventSubscriber(new AddBaseCurrencySubscriber())->addEventSubscriber(new ChannelFormSubscriber());
 }