1 | <?php |
||
26 | final class PaypalContext implements Context |
||
27 | { |
||
28 | /** |
||
29 | * @var SharedStorageInterface |
||
30 | */ |
||
31 | private $sharedStorage; |
||
32 | |||
33 | /** |
||
34 | * @var PaypalExpressCheckoutPageInterface |
||
35 | */ |
||
36 | private $paypalExpressCheckoutPage; |
||
37 | |||
38 | /** |
||
39 | * @var ShowPageInterface |
||
40 | */ |
||
41 | private $orderDetails; |
||
42 | |||
43 | /** |
||
44 | * @var CompletePageInterface |
||
45 | */ |
||
46 | private $summaryPage; |
||
47 | |||
48 | /** |
||
49 | * @var PaypalApiMocker |
||
50 | */ |
||
51 | private $paypalApiMocker; |
||
52 | |||
53 | /** |
||
54 | * @var OrderRepositoryInterface |
||
55 | */ |
||
56 | private $orderRepository; |
||
57 | |||
58 | /** |
||
59 | * @param SharedStorageInterface $sharedStorage |
||
60 | * @param PaypalExpressCheckoutPageInterface $paypalExpressCheckoutPage |
||
61 | * @param ShowPageInterface $orderDetails |
||
62 | * @param CompletePageInterface $summaryPage |
||
63 | * @param PaypalApiMocker $paypalApiMocker |
||
64 | * @param OrderRepositoryInterface $orderRepository |
||
65 | */ |
||
66 | public function __construct( |
||
81 | |||
82 | /** |
||
83 | * @When /^I confirm my order with paypal payment$/ |
||
84 | * @Given /^I have confirmed my order with paypal payment$/ |
||
85 | */ |
||
86 | public function iConfirmMyOrderWithPaypalPayment() |
||
92 | |||
93 | /** |
||
94 | * @Then I should be redirected back to PayPal Express Checkout page |
||
95 | */ |
||
96 | public function iShouldBeRedirectedToPaypalExpressCheckoutPage() |
||
100 | |||
101 | /** |
||
102 | * @When I sign in to PayPal and pay successfully |
||
103 | */ |
||
104 | public function iSignInToPaypalAndPaySuccessfully() |
||
110 | |||
111 | /** |
||
112 | * @Given /^I have cancelled (?:|my )PayPal payment$/ |
||
113 | * @When /^I cancel (?:|my )PayPal payment$/ |
||
114 | */ |
||
115 | public function iCancelMyPaypalPayment() |
||
119 | |||
120 | /** |
||
121 | * @Given /^I tried to pay(?:| again)$/ |
||
122 | * @When /^I try to pay(?:| again)$/ |
||
123 | */ |
||
124 | public function iTryToPayAgain() |
||
130 | |||
131 | /** |
||
132 | * @Then I should be notified that my payment has been cancelled |
||
133 | */ |
||
134 | public function iShouldBeNotifiedThatMyPaymentHasBeenCancelled() |
||
139 | |||
140 | /** |
||
141 | * @Then I should be notified that my payment has been completed |
||
142 | */ |
||
143 | public function iShouldBeNotifiedThatMyPaymentHasBeenCompleted() |
||
147 | |||
148 | /** |
||
149 | * @param string $expectedNotification |
||
150 | */ |
||
151 | private function assertNotification($expectedNotification) |
||
165 | } |
||
166 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.