1 | <?php |
||
18 | final class CompleteContext implements Context |
||
19 | { |
||
20 | /** |
||
21 | * @var SharedStorageInterface |
||
22 | */ |
||
23 | private $sharedStorage; |
||
24 | |||
25 | /** |
||
26 | * @var CompletePageInterface |
||
27 | */ |
||
28 | private $completePage; |
||
29 | |||
30 | /** |
||
31 | * @param SharedStorageInterface $sharedStorage |
||
32 | * @param CompletePageInterface $completePage |
||
33 | */ |
||
34 | public function __construct(SharedStorageInterface $sharedStorage, CompletePageInterface $completePage) |
||
39 | |||
40 | /** |
||
41 | * @When I try to open checkout complete page |
||
42 | */ |
||
43 | public function iTryToOpenCheckoutCompletePage() |
||
47 | |||
48 | /** |
||
49 | * @When I decide to change the payment method |
||
50 | */ |
||
51 | public function iGoToThePaymentStep() |
||
55 | |||
56 | /** |
||
57 | * @When /^I provide additional note like "([^"]+)"$/ |
||
58 | */ |
||
59 | public function iProvideAdditionalNotesLike($notes) |
||
64 | |||
65 | /** |
||
66 | * @When I return to the checkout summary step |
||
67 | */ |
||
68 | public function iReturnToTheCheckoutSummaryStep() |
||
72 | |||
73 | /** |
||
74 | * @When I want to complete checkout |
||
75 | */ |
||
76 | public function iWantToCompleteCheckout() |
||
80 | |||
81 | /** |
||
82 | * @When I confirm my order |
||
83 | */ |
||
84 | public function iConfirmMyOrder() |
||
88 | |||
89 | /** |
||
90 | * @Then I should be on the checkout complete step |
||
91 | * @Then I should be on the checkout summary step |
||
92 | */ |
||
93 | public function iShouldBeOnTheCheckoutCompleteStep() |
||
97 | |||
98 | /** |
||
99 | * @Then my order's shipping address should be to :fullName |
||
100 | */ |
||
101 | public function iShouldSeeThisShippingAddressAsShippingAddress($fullName) |
||
107 | |||
108 | /** |
||
109 | * @Then my order's billing address should be to :fullName |
||
110 | */ |
||
111 | public function iShouldSeeThisBillingAddressAsBillingAddress($fullName) |
||
117 | |||
118 | /** |
||
119 | * @Then address to :fullName should be used for both shipping and billing of my order |
||
120 | */ |
||
121 | public function iShouldSeeThisShippingAddressAsShippingAndBillingAddress($fullName) |
||
126 | |||
127 | /** |
||
128 | * @Given I should have :quantity :productName products in the cart |
||
129 | */ |
||
130 | public function iShouldHaveProductsInTheCart($quantity, $productName) |
||
134 | |||
135 | /** |
||
136 | * @Then my order shipping should be :price |
||
137 | */ |
||
138 | public function myOrderShippingShouldBe($price) |
||
142 | |||
143 | /** |
||
144 | * @Then /^the ("[^"]+" product) should have unit price discounted by ("\$\d+")$/ |
||
145 | */ |
||
146 | public function theShouldHaveUnitPriceDiscountedFor(ProductInterface $product, $amount) |
||
150 | |||
151 | /** |
||
152 | * @Then /^my order total should be ("(?:\£|\$)\d+(?:\.\d+)?")$/ |
||
153 | */ |
||
154 | public function myOrderTotalShouldBe($total) |
||
158 | |||
159 | /** |
||
160 | * @Then my order promotion total should be :promotionTotal |
||
161 | */ |
||
162 | public function myOrderPromotionTotalShouldBe($promotionTotal) |
||
166 | |||
167 | /** |
||
168 | * @Then :promotionName should be applied to my order |
||
169 | */ |
||
170 | public function shouldBeAppliedToMyOrder($promotionName) |
||
174 | |||
175 | /** |
||
176 | * @Then :promotionName should be applied to my order shipping |
||
177 | */ |
||
178 | public function shouldBeAppliedToMyOrderShipping($promotionName) |
||
182 | |||
183 | /** |
||
184 | * @Given my tax total should be :taxTotal |
||
185 | */ |
||
186 | public function myTaxTotalShouldBe($taxTotal) |
||
190 | |||
191 | /** |
||
192 | * @Then my order's shipping method should be :shippingMethod |
||
193 | */ |
||
194 | public function myOrderSShippingMethodShouldBe(ShippingMethodInterface $shippingMethod) |
||
198 | |||
199 | /** |
||
200 | * @Then my order's payment method should be :paymentMethod |
||
201 | */ |
||
202 | public function myOrderSPaymentMethodShouldBe(PaymentMethodInterface $paymentMethod) |
||
206 | |||
207 | /** |
||
208 | * @Then the :product product should have unit price :price |
||
209 | */ |
||
210 | public function theProductShouldHaveUnitPrice(ProductInterface $product, $price) |
||
214 | |||
215 | /** |
||
216 | * @Given /^I should be notified that (this product) does not have sufficient stock$/ |
||
217 | */ |
||
218 | public function iShouldBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product) |
||
222 | |||
223 | /** |
||
224 | * @Then my order's locale should be :localeName |
||
225 | */ |
||
226 | public function myOrderSLocaleShouldBe($localeName) |
||
230 | |||
231 | /** |
||
232 | * @Then /^I should not be notified that (this product) does not have sufficient stock$/ |
||
233 | */ |
||
234 | public function iShouldNotBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product) |
||
238 | |||
239 | /** |
||
240 | * @Then I should see :provinceName in the shipping address |
||
241 | */ |
||
242 | public function iShouldSeeInTheShippingAddress($provinceName) |
||
246 | |||
247 | /** |
||
248 | * @Then I should see :provinceName in the billing address |
||
249 | */ |
||
250 | public function iShouldSeeInTheBillingAddress($provinceName) |
||
254 | |||
255 | /** |
||
256 | * @Then I should not see any information about payment method |
||
257 | */ |
||
258 | public function iShouldNotSeeAnyInformationAboutPaymentMethod() |
||
262 | |||
263 | /** |
||
264 | * @Then /^(this promotion) should give "([^"]+)" discount$/ |
||
265 | */ |
||
266 | public function thisPromotionShouldGiveDiscount(PromotionInterface $promotion, $discount) |
||
270 | } |
||
271 |