function it_builds_a_form(FormBuilderInterface $builder, VariableInterface $variable, OptionInterface $option) { $variable->getOptions()->shouldBeCalled()->willReturn([$option]); $option->getName()->shouldBeCalled()->willReturn('option_name'); $builder->add('option-name', 'sylius_varibale_name_option_value_choice', ['label' => 'option_name', 'option' => $option, 'property_path' => '[0]'])->shouldBeCalled(); $builder->addModelTransformer(Argument::type(VariantToCombinationTransformer::class))->shouldBeCalled(); $this->buildForm($builder, ['variable' => $variable]); }
function it_builds_a_form(FormBuilderInterface $builder, VariableInterface $variable, OptionInterface $option) { $variable->getOptions()->shouldBeCalled()->willReturn(array($option)); $option->getName()->shouldBeCalled()->willReturn('option_name'); $option->getPresentation()->shouldBeCalled()->willReturn('option_presentation'); $builder->add('option-name', 'sylius_varibale_name_option_value_choice', array('label' => 'option_presentation', 'option' => $option, 'property_path' => '[0]'))->shouldBeCalled(); $builder->addModelTransformer(Argument::type('Sylius\\Bundle\\VariationBundle\\Form\\DataTransformer\\VariantToCombinationTransformer'))->shouldBeCalled(); $this->buildForm($builder, array('variable' => $variable)); }
function it_build_a_form($manager, FormBuilderInterface $builder, ObjectRepository $repository) { $manager->getRepository('class')->willReturn($repository); $builder->addModelTransformer(Argument::type(ObjectToIdentifierTransformer::class))->shouldBeCalled(); $this->buildForm($builder, array('class' => 'class', 'identifier' => 'identifier')); }