function it_is_triggered_pre_bind($factory, $feeCalculatorRegistry, FeeCalculatorInterface $feeCalculator, FormEvent $event, FormInterface $configurationForm, FormInterface $form, PaymentMethodInterface $paymentMethod)
 {
     $event->getData()->willReturn(array('feeCalculator' => 'test'))->shouldBeCalled();
     $event->getForm()->willReturn($form)->shouldBeCalled();
     $paymentMethod->getFeeCalculator()->willReturn('test');
     $paymentMethod->getFeeCalculatorConfiguration()->willReturn(array());
     $feeCalculatorRegistry->get('test')->willReturn($feeCalculator)->shouldBeCalled();
     $feeCalculator->getType()->willReturn('test');
     $factory->createNamed('feeCalculatorConfiguration', 'sylius_fee_calculator_test', array(), array('auto_initialize' => false))->willReturn($configurationForm)->shouldBeCalled();
     $form->add($configurationForm)->shouldBeCalled();
     $this->preBind($event);
 }
 private function addTranslatedFields(PaymentMethodInterface $method, $translatedNames)
 {
     foreach ($translatedNames as $locale => $name) {
         $method->setCurrentLocale($locale);
         $method->setFallbackLocale($locale);
         $method->setName($name);
         $method->setDescription($this->fakers[$locale]->paragraph);
     }
     $method->setCurrentLocale($this->defaultLocale);
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function hasPaymentMethod(PaymentMethodInterface $paymentMethod)
 {
     if (!$this->hasElement('payment_method')) {
         return false;
     }
     return false !== strpos($this->getElement('payment_method')->getText(), $paymentMethod->getName());
 }
Esempio n. 4
0
 /**
  * @Given I should be informed with :paymentMethod payment method instructions
  */
 public function iShouldBeInformedWithPaymentMethodInstructions(PaymentMethodInterface $paymentMethod)
 {
     Assert::same($this->thankYouPage->getInstructions(), $paymentMethod->getInstructions());
 }
Esempio n. 5
0
 /**
  * @Given the payment method :paymentMethod is disabled
  */
 public function theStoreHasAPaymentMethodDisabled(PaymentMethodInterface $paymentMethod)
 {
     $paymentMethod->disable();
     $this->objectManager->flush();
 }
 /**
  * @Then /^(this payment method) should no longer exist in the registry$/
  */
 public function thisPaymentMethodShouldNoLongerExistInTheRegistry(PaymentMethodInterface $paymentMethod)
 {
     Assert::false($this->indexPage->isSingleResourceOnPage(['code' => $paymentMethod->getCode(), 'name' => $paymentMethod->getName()]), sprintf('Payment method %s should no longer exist in the registry', $paymentMethod->getName()));
 }
Esempio n. 7
0
 /**
  * @Given /^(it) has instructions "([^"]+)"$/
  */
 public function itHasInstructions(PaymentMethodInterface $paymentMethod, $instructions)
 {
     $paymentMethod->setInstructions($instructions);
     $this->objectManager->flush();
 }