function it_builds_prototypes_forms_for_calculators($calculatorRegistry, FormBuilder $builder, FormBuilder $flatRateFormBuilder, Form $flatRateForm, FlatRateCalculator $flatRateCalculator, FormBuilder $perItemFormBuilder, Form $perItemForm, PerItemRateCalculator $perItemRateCalculator)
 {
     $builder->add(Argument::any(), Argument::cetera())->willReturn($builder);
     $builder->addEventSubscriber(Argument::any())->willReturn($builder);
     $flatRateCalculator->getConfigurationFormType()->willReturn('sylius_shipping_calculator_flat_rate_configuration');
     $flatRateCalculator->isConfigurable()->willReturn(true);
     $perItemRateCalculator->getConfigurationFormType()->willReturn('sylius_shipping_calculator_per_item_rate_configuration');
     $perItemRateCalculator->isConfigurable()->willReturn(true);
     $calculatorRegistry->getCalculators()->willReturn(array('flat_rate' => $flatRateCalculator, 'per_item_rate' => $perItemRateCalculator));
     $flatRateFormBuilder->getForm()->willReturn($flatRateForm);
     $builder->create('configuration', 'sylius_shipping_calculator_flat_rate_configuration')->willReturn($flatRateFormBuilder);
     $perItemFormBuilder->getForm()->willReturn($perItemForm);
     $builder->create('configuration', 'sylius_shipping_calculator_per_item_rate_configuration')->willReturn($perItemFormBuilder);
     $builder->setAttribute('prototypes', array('calculators' => array('flat_rate' => $flatRateForm, 'per_item_rate' => $perItemForm), 'rules' => array()))->shouldBeCalled();
     $this->buildForm($builder, array());
 }
 function it_builds_prototypes_forms_for_calculators($calculatorRegistry, FormBuilder $builder, FormBuilder $flatRateFormBuilder, Form $flatRateForm, FlatRateCalculator $flatRateCalculator, FormBuilder $perUnitFormBuilder, Form $perUnitForm, PerUnitRateCalculator $perUnitRateCalculator, $formRegistry)
 {
     $builder->add(Argument::any(), Argument::cetera())->willReturn($builder);
     $builder->addEventSubscriber(Argument::any())->willReturn($builder);
     $flatRateCalculator->getType()->willReturn('flat_rate');
     $perUnitRateCalculator->getType()->willReturn('per_unit_rate');
     $calculatorRegistry->all()->willReturn(['flat_rate' => $flatRateCalculator, 'per_unit_rate' => $perUnitRateCalculator]);
     $flatRateFormBuilder->getForm()->willReturn($flatRateForm);
     $builder->create('configuration', 'sylius_shipping_calculator_flat_rate')->willReturn($flatRateFormBuilder);
     $perUnitFormBuilder->getForm()->willReturn($perUnitForm);
     $builder->create('configuration', 'sylius_shipping_calculator_per_unit_rate')->willReturn($perUnitFormBuilder);
     $formRegistry->hasType('sylius_shipping_calculator_per_unit_rate')->shouldBeCalled()->willReturn(true);
     $formRegistry->hasType('sylius_shipping_calculator_flat_rate')->shouldBeCalled()->willReturn(true);
     $builder->setAttribute('prototypes', ['calculators' => ['flat_rate' => $flatRateForm, 'per_unit_rate' => $perUnitForm], 'rules' => []])->shouldBeCalled();
     $this->buildForm($builder, []);
 }