1 | <?php |
||
28 | final class ManagingPaymentMethodsContext implements Context |
||
29 | { |
||
30 | /** |
||
31 | * @var CreatePageInterface |
||
32 | */ |
||
33 | private $createPage; |
||
34 | |||
35 | /** |
||
36 | * @var IndexPageInterface |
||
37 | */ |
||
38 | private $indexPage; |
||
39 | |||
40 | /** |
||
41 | * @var UpdatePageInterface |
||
42 | */ |
||
43 | private $updatePage; |
||
44 | |||
45 | /** |
||
46 | * @var CurrentPageResolverInterface |
||
47 | */ |
||
48 | private $currentPageResolver; |
||
49 | |||
50 | /** |
||
51 | * @var NotificationCheckerInterface |
||
52 | */ |
||
53 | private $notificationChecker; |
||
54 | |||
55 | /** |
||
56 | * @param CreatePageInterface $createPage |
||
57 | * @param IndexPageInterface $indexPage |
||
58 | * @param UpdatePageInterface $updatePage |
||
59 | * @param CurrentPageResolverInterface $currentPageResolver |
||
60 | */ |
||
61 | public function __construct( |
||
74 | |||
75 | /** |
||
76 | * @Given I want to modify the :paymentMethod payment method |
||
77 | */ |
||
78 | public function iWantToModifyAPaymentMethod(PaymentMethodInterface $paymentMethod) |
||
82 | |||
83 | /** |
||
84 | * @When I name it :name in :language |
||
85 | * @When I rename it to :name in :language |
||
86 | * @When I remove its name from :language translation |
||
87 | */ |
||
88 | public function iNameItIn($name = null, $language) |
||
94 | |||
95 | /** |
||
96 | * @When I do not name it |
||
97 | */ |
||
98 | public function iDoNotNameIt() |
||
102 | |||
103 | /** |
||
104 | * @When I enable it |
||
105 | */ |
||
106 | public function iEnableIt() |
||
110 | |||
111 | /** |
||
112 | * @When I disable it |
||
113 | */ |
||
114 | public function iDisableIt() |
||
118 | |||
119 | /** |
||
120 | * @When I save my changes |
||
121 | * @When I try to save my changes |
||
122 | */ |
||
123 | public function iSaveMyChanges() |
||
127 | |||
128 | /** |
||
129 | * @When I delete the :paymentMethod payment method |
||
130 | * @When I try to delete the :paymentMethod payment method |
||
131 | */ |
||
132 | public function iDeletePaymentMethod(PaymentMethodInterface $paymentMethod) |
||
137 | |||
138 | /** |
||
139 | * @Then I should be notified that it is in use |
||
140 | */ |
||
141 | public function iShouldBeNotifiedThatItIsInUse() |
||
145 | |||
146 | /** |
||
147 | * @When I choose :gatewayName gateway |
||
148 | */ |
||
149 | public function iChooseGateway($gatewayName) |
||
155 | |||
156 | /** |
||
157 | * @Then this payment method :element should be :value |
||
158 | */ |
||
159 | public function thisPaymentMethodElementShouldBe($element, $value) |
||
166 | |||
167 | /** |
||
168 | * @Given I want to create a new payment method |
||
169 | */ |
||
170 | public function iWantToCreateANewPaymentMethod() |
||
174 | |||
175 | /** |
||
176 | * @When I specify its code as :code |
||
177 | * @When I do not specify its code |
||
178 | */ |
||
179 | public function iSpecifyItsCodeAs($code = null) |
||
183 | |||
184 | /** |
||
185 | * @When I describe it as :description in :language |
||
186 | */ |
||
187 | public function iDescribeItAsIn($description, $language) |
||
191 | |||
192 | /** |
||
193 | * @When make it available in channel :channel |
||
194 | */ |
||
195 | public function iMakeItAvailableInChannel($channel) |
||
199 | |||
200 | /** |
||
201 | * @Given I set its instruction as :instructions in :language |
||
202 | */ |
||
203 | public function iSetItsInstructionAsIn($instructions, $language) |
||
207 | |||
208 | /** |
||
209 | * @When I add it |
||
210 | * @When I try to add it |
||
211 | */ |
||
212 | public function iAddIt() |
||
216 | |||
217 | /** |
||
218 | * @Then the payment method :paymentMethodName should appear in the registry |
||
219 | * @Then the payment method :paymentMethodName should be in the registry |
||
220 | */ |
||
221 | public function thePaymentMethodShouldAppearInTheRegistry($paymentMethodName) |
||
230 | |||
231 | /** |
||
232 | * @Given /^(this payment method) should still be in the registry$/ |
||
233 | */ |
||
234 | public function thisPaymentMethodShouldStillBeInTheRegistry(PaymentMethodInterface $paymentMethod) |
||
238 | |||
239 | /** |
||
240 | * @Given I am browsing payment methods |
||
241 | * @When I browse payment methods |
||
242 | */ |
||
243 | public function iBrowsePaymentMethods() |
||
247 | |||
248 | /** |
||
249 | * @Then the first payment method on the list should have :field :value |
||
250 | */ |
||
251 | public function theFirstPaymentMethodOnTheListShouldHave($field, $value) |
||
261 | |||
262 | /** |
||
263 | * @Then the last payment method on the list should have :field :value |
||
264 | */ |
||
265 | public function theLastPaymentMethodOnTheListShouldHave($field, $value) |
||
276 | |||
277 | /** |
||
278 | * @When I switch the way payment methods are sorted by :field |
||
279 | * @When I start sorting payment methods by :field |
||
280 | * @Given the payment methods are already sorted by :field |
||
281 | */ |
||
282 | public function iSortPaymentMethodsBy($field) |
||
286 | |||
287 | /** |
||
288 | * @Then I should see :amount payment methods in the list |
||
289 | */ |
||
290 | public function iShouldSeePaymentMethodsInTheList($amount) |
||
300 | |||
301 | /** |
||
302 | * @Then I should be notified that :element is required |
||
303 | */ |
||
304 | public function iShouldBeNotifiedThatIsRequired($element) |
||
308 | |||
309 | /** |
||
310 | * @Then the payment method with :element :value should not be added |
||
311 | */ |
||
312 | public function thePaymentMethodWithElementValueShouldNotBeAdded($element, $value) |
||
321 | |||
322 | /** |
||
323 | * @Then /^(this payment method) should still be named "([^"]+)"$/ |
||
324 | */ |
||
325 | public function thisShippingMethodNameShouldBe(PaymentMethodInterface $paymentMethod, $paymentMethodName) |
||
337 | |||
338 | /** |
||
339 | * @param string $element |
||
340 | * @param string $expectedMessage |
||
341 | */ |
||
342 | private function assertFieldValidationMessage($element, $expectedMessage) |
||
349 | |||
350 | /** |
||
351 | * @Then the code field should be disabled |
||
352 | */ |
||
353 | public function theCodeFieldShouldBeDisabled() |
||
360 | |||
361 | /** |
||
362 | * @Then this payment method should be enabled |
||
363 | */ |
||
364 | public function thisPaymentMethodShouldBeEnabled() |
||
371 | |||
372 | /** |
||
373 | * @Then this payment method should be disabled |
||
374 | */ |
||
375 | public function thisPaymentMethodShouldBeDisabled() |
||
382 | |||
383 | /** |
||
384 | * @Given the payment method :paymentMethod should have instructions :instructions in :language |
||
385 | */ |
||
386 | public function thePaymentMethodShouldHaveInstructionsIn( |
||
398 | |||
399 | /** |
||
400 | * @Then the payment method :paymentMethod should be available in channel :channelName |
||
401 | */ |
||
402 | public function thePaymentMethodShouldBeAvailableInChannel( |
||
413 | |||
414 | /** |
||
415 | * @Then /^(this payment method) should no longer exist in the registry$/ |
||
416 | */ |
||
417 | public function thisPaymentMethodShouldNoLongerExistInTheRegistry(PaymentMethodInterface $paymentMethod) |
||
424 | |||
425 | /** |
||
426 | * @Then I should be notified that payment method with this code already exists |
||
427 | */ |
||
428 | public function iShouldBeNotifiedThatPaymentMethodWithThisCodeAlreadyExists() |
||
432 | |||
433 | /** |
||
434 | * @Then there should still be only one payment method with :element :code |
||
435 | */ |
||
436 | public function thereShouldStillBeOnlyOnePaymentMethodWith($element, $code) |
||
445 | } |
||
446 |