function it_builds_a_form(FormBuilderInterface $builder, OptionInterface $option)
 {
     $option->getId()->shouldBeCalled()->willReturn(3);
     $option->getName()->shouldBeCalled()->willReturn('option_name');
     $builder->add('3', 'sylius_varibale_name_option_value_choice', array('label' => 'option_name', 'option' => $option, 'property_path' => '[0]'))->shouldBeCalled();
     $this->buildForm($builder, array('options' => array($option)));
 }
 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));
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function addToCartWithOption(OptionInterface $option, $optionValue)
 {
     $select = $this->getDocument()->find('css', sprintf('select#sylius_cart_item_variant_%s', $option->getCode()));
     $this->getDocument()->selectFieldOption($select->getAttribute('name'), $optionValue);
     $this->getDocument()->pressButton('Add to cart');
 }
 /**
  * @Given /^(this product option) has(?:| also) the "([^"]+)" option value with code "([^"]+)"$/
  */
 public function thisProductOptionHasTheOptionValueWithCode(OptionInterface $productOption, $productOptionValueName, $productOptionValueCode)
 {
     $productOptionValue = $this->createProductOptionValue($productOptionValueName, $productOptionValueCode);
     $productOption->addValue($productOptionValue);
     $this->objectManager->flush();
 }
 /**
  * @Then /^(this product option) should still be named "([^"]+)"$/
  * @Then /^(this product option) name should be "([^"]+)"$/
  */
 public function thisProductOptionNameShouldStillBe(OptionInterface $productOption, $productOptionName)
 {
     $this->iBrowseProductOptions();
     Assert::true($this->indexPage->isSingleResourceOnPage(['code' => $productOption->getCode(), 'name' => $productOptionName]), sprintf('Product option name %s has not been assigned properly.', $productOptionName));
 }