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) |
||
65 | |||
66 | /** |
||
67 | * @When I return to the checkout summary step |
||
68 | */ |
||
69 | public function iReturnToTheCheckoutSummaryStep() |
||
73 | |||
74 | /** |
||
75 | * @When I confirm my order |
||
76 | */ |
||
77 | public function iConfirmMyOrder() |
||
81 | |||
82 | /** |
||
83 | * @Then I should be on the checkout complete step |
||
84 | * @Then I should be on the checkout summary step |
||
85 | */ |
||
86 | public function iShouldBeOnTheCheckoutCompleteStep() |
||
90 | |||
91 | /** |
||
92 | * @Then my order's shipping address should be to :fullName |
||
93 | */ |
||
94 | public function iShouldSeeThisShippingAddressAsShippingAddress($fullName) |
||
100 | |||
101 | /** |
||
102 | * @Then my order's billing address should be to :fullName |
||
103 | */ |
||
104 | public function iShouldSeeThisBillingAddressAsBillingAddress($fullName) |
||
110 | |||
111 | /** |
||
112 | * @Then address to :fullName should be used for both shipping and billing of my order |
||
113 | */ |
||
114 | public function iShouldSeeThisShippingAddressAsShippingAndBillingAddress($fullName) |
||
119 | |||
120 | /** |
||
121 | * @Then I should have :quantity :productName products in the cart |
||
122 | */ |
||
123 | public function iShouldHaveProductsInTheCart($quantity, $productName) |
||
127 | |||
128 | /** |
||
129 | * @Then my order shipping should be :price |
||
130 | */ |
||
131 | public function myOrderShippingShouldBe($price) |
||
135 | |||
136 | /** |
||
137 | * @Then /^the ("[^"]+" product) should have unit price discounted by ("\$\d+")$/ |
||
138 | */ |
||
139 | public function theShouldHaveUnitPriceDiscountedFor(ProductInterface $product, $amount) |
||
143 | |||
144 | /** |
||
145 | * @Then /^my order total should be ("(?:\£|\$)\d+(?:\.\d+)?")$/ |
||
146 | */ |
||
147 | public function myOrderTotalShouldBe($total) |
||
151 | |||
152 | /** |
||
153 | * @Then my order promotion total should be :promotionTotal |
||
154 | */ |
||
155 | public function myOrderPromotionTotalShouldBe($promotionTotal) |
||
159 | |||
160 | /** |
||
161 | * @Then :promotionName should be applied to my order |
||
162 | */ |
||
163 | public function shouldBeAppliedToMyOrder($promotionName) |
||
167 | |||
168 | /** |
||
169 | * @Then :promotionName should be applied to my order shipping |
||
170 | */ |
||
171 | public function shouldBeAppliedToMyOrderShipping($promotionName) |
||
175 | |||
176 | /** |
||
177 | * @Given my tax total should be :taxTotal |
||
178 | */ |
||
179 | public function myTaxTotalShouldBe($taxTotal) |
||
183 | |||
184 | /** |
||
185 | * @Then my order's shipping method should be :shippingMethod |
||
186 | */ |
||
187 | public function myOrdersShippingMethodShouldBe(ShippingMethodInterface $shippingMethod) |
||
191 | |||
192 | /** |
||
193 | * @Then my order's payment method should be :paymentMethod |
||
194 | */ |
||
195 | public function myOrdersPaymentMethodShouldBe(PaymentMethodInterface $paymentMethod) |
||
199 | |||
200 | /** |
||
201 | * @Then the :product product should have unit price :price |
||
202 | */ |
||
203 | public function theProductShouldHaveUnitPrice(ProductInterface $product, $price) |
||
207 | |||
208 | /** |
||
209 | * @Then /^I should be notified that (this product) does not have sufficient stock$/ |
||
210 | */ |
||
211 | public function iShouldBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product) |
||
215 | |||
216 | /** |
||
217 | * @Then /^I should not be notified that (this product) does not have sufficient stock$/ |
||
218 | */ |
||
219 | public function iShouldNotBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product) |
||
223 | |||
224 | /** |
||
225 | * @Then my order's locale should be :localeName |
||
226 | */ |
||
227 | public function myOrderLocaleShouldBe($localeName) |
||
231 | |||
232 | /** |
||
233 | * @Then I should see :provinceName in the shipping address |
||
234 | */ |
||
235 | public function iShouldSeeInTheShippingAddress($provinceName) |
||
239 | |||
240 | /** |
||
241 | * @Then I should see :provinceName in the billing address |
||
242 | */ |
||
243 | public function iShouldSeeInTheBillingAddress($provinceName) |
||
247 | |||
248 | /** |
||
249 | * @Then I should not see any information about payment method |
||
250 | */ |
||
251 | public function iShouldNotSeeAnyInformationAboutPaymentMethod() |
||
255 | |||
256 | /** |
||
257 | * @Then /^(this promotion) should give "([^"]+)" discount$/ |
||
258 | */ |
||
259 | public function thisPromotionShouldGiveDiscount(PromotionInterface $promotion, $discount) |
||
263 | } |
||
264 |