1 | <?php |
||
27 | final class ManagingPaymentMethodsContext implements Context |
||
28 | { |
||
29 | /** |
||
30 | * @var CreatePageInterface |
||
31 | */ |
||
32 | private $createPage; |
||
33 | |||
34 | /** |
||
35 | * @var IndexPageInterface |
||
36 | */ |
||
37 | private $indexPage; |
||
38 | |||
39 | /** |
||
40 | * @var UpdatePageInterface |
||
41 | */ |
||
42 | private $updatePage; |
||
43 | |||
44 | /** |
||
45 | * @var CurrentPageResolverInterface |
||
46 | */ |
||
47 | private $currentPageResolver; |
||
48 | |||
49 | /** |
||
50 | * @param CreatePageInterface $createPage |
||
51 | * @param IndexPageInterface $indexPage |
||
52 | * @param UpdatePageInterface $updatePage |
||
53 | * @param CurrentPageResolverInterface $currentPageResolver |
||
54 | */ |
||
55 | public function __construct( |
||
66 | |||
67 | /** |
||
68 | * @Given I want to modify the :paymentMethod payment method |
||
69 | */ |
||
70 | public function iWantToModifyAPaymentMethod(PaymentMethodInterface $paymentMethod) |
||
74 | |||
75 | /** |
||
76 | * @When I name it :name in :language |
||
77 | * @When I rename it to :name in :language |
||
78 | * @When I remove its name from :language translation |
||
79 | */ |
||
80 | public function iNameItIn($name = null, $language) |
||
86 | |||
87 | /** |
||
88 | * @When I do not name it |
||
89 | */ |
||
90 | public function iDoNotNameIt() |
||
94 | |||
95 | /** |
||
96 | * @When I enable it |
||
97 | */ |
||
98 | public function iEnableIt() |
||
102 | |||
103 | /** |
||
104 | * @When I disable it |
||
105 | */ |
||
106 | public function iDisableIt() |
||
110 | |||
111 | /** |
||
112 | * @When I save my changes |
||
113 | * @When I try to save my changes |
||
114 | */ |
||
115 | public function iSaveMyChanges() |
||
119 | |||
120 | /** |
||
121 | * @When I delete the :paymentMethod payment method |
||
122 | */ |
||
123 | public function iDeletePaymentMethod(PaymentMethodInterface $paymentMethod) |
||
128 | |||
129 | /** |
||
130 | * @When I choose :gatewayName gateway |
||
131 | */ |
||
132 | public function iChooseGateway($gatewayName) |
||
138 | |||
139 | /** |
||
140 | * @Then this payment method :element should be :value |
||
141 | */ |
||
142 | public function thisPaymentMethodElementShouldBe($element, $value) |
||
149 | |||
150 | /** |
||
151 | * @Given I want to create a new payment method |
||
152 | */ |
||
153 | public function iWantToCreateANewPaymentMethod() |
||
157 | |||
158 | /** |
||
159 | * @When I specify its code as :code |
||
160 | * @When I do not specify its code |
||
161 | */ |
||
162 | public function iSpecifyItsCodeAs($code = null) |
||
166 | |||
167 | /** |
||
168 | * @When I describe it as :description in :language |
||
169 | */ |
||
170 | public function iDescribeItAsIn($description, $language) |
||
174 | |||
175 | /** |
||
176 | * @When make it available in channel :channel |
||
177 | */ |
||
178 | public function iMakeItAvailableInChannel($channel) |
||
182 | |||
183 | /** |
||
184 | * @Given I set its instruction as :instructions in :language |
||
185 | */ |
||
186 | public function iSetItsInstructionAsIn($instructions, $language) |
||
190 | |||
191 | /** |
||
192 | * @When I add it |
||
193 | * @When I try to add it |
||
194 | */ |
||
195 | public function iAddIt() |
||
199 | |||
200 | /** |
||
201 | * @Then the payment method :paymentMethodName should appear in the registry |
||
202 | * @Then the payment method :paymentMethodName should be in the registry |
||
203 | */ |
||
204 | public function thePaymentMethodShouldAppearInTheRegistry($paymentMethodName) |
||
213 | |||
214 | /** |
||
215 | * @Given I am browsing payment methods |
||
216 | * @When I browse payment methods |
||
217 | */ |
||
218 | public function iBrowsePaymentMethods() |
||
222 | |||
223 | /** |
||
224 | * @Then the first payment method on the list should have :field :value |
||
225 | */ |
||
226 | public function theFirstPaymentMethodOnTheListShouldHave($field, $value) |
||
236 | |||
237 | /** |
||
238 | * @When I switch the way payment methods are sorted by :field |
||
239 | * @When I start sorting payment methods by :field |
||
240 | * @Given the payment methods are already sorted by :field |
||
241 | */ |
||
242 | public function iSortPaymentMethodsBy($field) |
||
246 | |||
247 | /** |
||
248 | * @Then I should see :amount payment methods in the list |
||
249 | */ |
||
250 | public function iShouldSeePaymentMethodsInTheList($amount) |
||
260 | |||
261 | /** |
||
262 | * @Then I should be notified that :element is required |
||
263 | */ |
||
264 | public function iShouldBeNotifiedThatIsRequired($element) |
||
268 | |||
269 | /** |
||
270 | * @Then the payment method with :element :value should not be added |
||
271 | */ |
||
272 | public function thePaymentMethodWithElementValueShouldNotBeAdded($element, $value) |
||
281 | |||
282 | /** |
||
283 | * @Then /^(this payment method) should still be named "([^"]+)"$/ |
||
284 | */ |
||
285 | public function thisShippingMethodNameShouldBe(PaymentMethodInterface $paymentMethod, $paymentMethodName) |
||
297 | |||
298 | /** |
||
299 | * @param string $element |
||
300 | * @param string $expectedMessage |
||
301 | */ |
||
302 | private function assertFieldValidationMessage($element, $expectedMessage) |
||
309 | |||
310 | /** |
||
311 | * @Then the code field should be disabled |
||
312 | */ |
||
313 | public function theCodeFieldShouldBeDisabled() |
||
320 | |||
321 | /** |
||
322 | * @Then this payment method should be enabled |
||
323 | */ |
||
324 | public function thisPaymentMethodShouldBeEnabled() |
||
331 | |||
332 | /** |
||
333 | * @Then this payment method should be disabled |
||
334 | */ |
||
335 | public function thisPaymentMethodShouldBeDisabled() |
||
342 | |||
343 | /** |
||
344 | * @Given the payment method :paymentMethod should have instructions :instructions in :language |
||
345 | */ |
||
346 | public function thePaymentMethodShouldHaveInstructionsIn( |
||
358 | |||
359 | /** |
||
360 | * @Then the payment method :paymentMethod should be available in channel :channelName |
||
361 | */ |
||
362 | public function thePaymentMethodShouldBeAvailableInChannel( |
||
373 | |||
374 | /** |
||
375 | * @Then /^(this payment method) should no longer exist in the registry$/ |
||
376 | */ |
||
377 | public function thisPaymentMethodShouldNoLongerExistInTheRegistry(PaymentMethodInterface $paymentMethod) |
||
384 | |||
385 | /** |
||
386 | * @Then I should be notified that payment method with this code already exists |
||
387 | */ |
||
388 | public function iShouldBeNotifiedThatPaymentMethodWithThisCodeAlreadyExists() |
||
392 | |||
393 | /** |
||
394 | * @Then there should still be only one payment method with :element :code |
||
395 | */ |
||
396 | public function thereShouldStillBeOnlyOnePaymentMethodWith($element, $code) |
||
405 | } |
||
406 |
If you place a parameter with a default value before a parameter with a default value, the default value of the first parameter will never be used as it will always need to be passed anyway: