1 | <?php |
||
18 | final class CheckoutCompleteContext 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 | * @When I want to complete checkout |
||
43 | */ |
||
44 | public function iTryToOpenCheckoutCompletePage() |
||
48 | |||
49 | /** |
||
50 | * @When I decide to change the payment method |
||
51 | */ |
||
52 | public function iGoToThePaymentStep() |
||
56 | |||
57 | /** |
||
58 | * @When /^I provide additional note like "([^"]+)"$/ |
||
59 | */ |
||
60 | 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 confirm my order |
||
75 | */ |
||
76 | public function iConfirmMyOrder() |
||
80 | |||
81 | /** |
||
82 | * @Then I should be on the checkout complete step |
||
83 | * @Then I should be on the checkout summary step |
||
84 | */ |
||
85 | public function iShouldBeOnTheCheckoutCompleteStep() |
||
89 | |||
90 | /** |
||
91 | * @Then my order's shipping address should be to :fullName |
||
92 | */ |
||
93 | public function iShouldSeeThisShippingAddressAsShippingAddress($fullName) |
||
99 | |||
100 | /** |
||
101 | * @Then my order's billing address should be to :fullName |
||
102 | */ |
||
103 | public function iShouldSeeThisBillingAddressAsBillingAddress($fullName) |
||
109 | |||
110 | /** |
||
111 | * @Then address to :fullName should be used for both shipping and billing of my order |
||
112 | */ |
||
113 | public function iShouldSeeThisShippingAddressAsShippingAndBillingAddress($fullName) |
||
118 | |||
119 | /** |
||
120 | * @Then I should have :quantity :productName products in the cart |
||
121 | */ |
||
122 | public function iShouldHaveProductsInTheCart($quantity, $productName) |
||
126 | |||
127 | /** |
||
128 | * @Then my order shipping should be :price |
||
129 | */ |
||
130 | public function myOrderShippingShouldBe($price) |
||
134 | |||
135 | /** |
||
136 | * @Then /^the ("[^"]+" product) should have unit price discounted by ("\$\d+")$/ |
||
137 | */ |
||
138 | public function theShouldHaveUnitPriceDiscountedFor(ProductInterface $product, $amount) |
||
142 | |||
143 | /** |
||
144 | * @Then /^my order total should be ("(?:\£|\$)\d+(?:\.\d+)?")$/ |
||
145 | */ |
||
146 | public function myOrderTotalShouldBe($total) |
||
150 | |||
151 | /** |
||
152 | * @Then my order promotion total should be :promotionTotal |
||
153 | */ |
||
154 | public function myOrderPromotionTotalShouldBe($promotionTotal) |
||
158 | |||
159 | /** |
||
160 | * @Then :promotionName should be applied to my order |
||
161 | */ |
||
162 | public function shouldBeAppliedToMyOrder($promotionName) |
||
166 | |||
167 | /** |
||
168 | * @Then :promotionName should be applied to my order shipping |
||
169 | */ |
||
170 | public function shouldBeAppliedToMyOrderShipping($promotionName) |
||
174 | |||
175 | /** |
||
176 | * @Given my tax total should be :taxTotal |
||
177 | */ |
||
178 | public function myTaxTotalShouldBe($taxTotal) |
||
182 | |||
183 | /** |
||
184 | * @Then my order's shipping method should be :shippingMethod |
||
185 | */ |
||
186 | public function myOrdersShippingMethodShouldBe(ShippingMethodInterface $shippingMethod) |
||
190 | |||
191 | /** |
||
192 | * @Then my order's payment method should be :paymentMethod |
||
193 | */ |
||
194 | public function myOrdersPaymentMethodShouldBe(PaymentMethodInterface $paymentMethod) |
||
198 | |||
199 | /** |
||
200 | * @Then the :product product should have unit price :price |
||
201 | */ |
||
202 | public function theProductShouldHaveUnitPrice(ProductInterface $product, $price) |
||
206 | |||
207 | /** |
||
208 | * @Then /^I should be notified that (this product) does not have sufficient stock$/ |
||
209 | */ |
||
210 | public function iShouldBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product) |
||
214 | |||
215 | /** |
||
216 | * @Then /^I should not be notified that (this product) does not have sufficient stock$/ |
||
217 | */ |
||
218 | public function iShouldNotBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product) |
||
222 | |||
223 | /** |
||
224 | * @Then my order's locale should be :localeName |
||
225 | */ |
||
226 | public function myOrderLocaleShouldBe($localeName) |
||
230 | |||
231 | /** |
||
232 | * @Then I should see :provinceName in the shipping address |
||
233 | */ |
||
234 | public function iShouldSeeInTheShippingAddress($provinceName) |
||
238 | |||
239 | /** |
||
240 | * @Then I should see :provinceName in the billing address |
||
241 | */ |
||
242 | public function iShouldSeeInTheBillingAddress($provinceName) |
||
246 | |||
247 | /** |
||
248 | * @Then I should not see any information about payment method |
||
249 | */ |
||
250 | public function iShouldNotSeeAnyInformationAboutPaymentMethod() |
||
254 | |||
255 | /** |
||
256 | * @Then /^(this promotion) should give "([^"]+)" discount$/ |
||
257 | */ |
||
258 | public function thisPromotionShouldGiveDiscount(PromotionInterface $promotion, $discount) |
||
262 | } |
||
263 |