function it_tries_to_pay_again(SharedStorageInterface $sharedStorage, OrderRepositoryInterface $orderRepository, PaypalApiMocker $paypalApiMocker, OrderPaymentsPageInterface $orderPaymentsPage, OrderInterface $order, CustomerInterface $customer, UserInterface $user, PaymentInterface $payment) { $sharedStorage->get('user')->willReturn($user); $user->getCustomer()->willReturn($customer); $orderRepository->findByCustomer($customer)->willReturn([$order]); $order->getLastPayment()->willReturn($payment); $paypalApiMocker->mockApiPaymentInitializeResponse()->shouldBeCalled(); $orderPaymentsPage->clickPayButtonForGivenPayment($payment)->shouldBeCalled(); $this->iTryToPayAgain(); }
/** * @When I try to pay again */ public function iTryToPayAgain() { $order = $this->getLastOrder(); $payment = $order->getLastPayment(); $this->paypalApiMocker->mockApiPaymentInitializeResponse(); $this->orderPaymentsPage->clickPayButtonForGivenPayment($payment); }