1 | <?php |
||
31 | final class CheckoutContext implements Context |
||
32 | { |
||
33 | /** |
||
34 | * @var AddressPageInterface |
||
35 | */ |
||
36 | private $addressPage; |
||
37 | |||
38 | /** |
||
39 | * @var SelectPaymentPageInterface |
||
40 | */ |
||
41 | private $selectPaymentPage; |
||
42 | |||
43 | /** |
||
44 | * @var SelectShippingPageInterface |
||
45 | */ |
||
46 | private $selectShippingPage; |
||
47 | |||
48 | /** |
||
49 | * @var CompletePageInterface |
||
50 | */ |
||
51 | private $completePage; |
||
52 | |||
53 | /** |
||
54 | * @var CurrentPageResolverInterface |
||
55 | */ |
||
56 | private $currentPageResolver; |
||
57 | |||
58 | /** |
||
59 | * @var AddressingContext |
||
60 | */ |
||
61 | private $addressingContext; |
||
62 | |||
63 | /** |
||
64 | * @var ShippingContext |
||
65 | */ |
||
66 | private $shippingContext; |
||
67 | |||
68 | /** |
||
69 | * @var PaymentContext |
||
70 | */ |
||
71 | private $paymentContext; |
||
72 | |||
73 | /** |
||
74 | * @param AddressPageInterface $addressPage |
||
75 | * @param SelectPaymentPageInterface $selectPaymentPage |
||
76 | * @param SelectShippingPageInterface $selectShippingPage |
||
77 | * @param CompletePageInterface $completePage |
||
78 | * @param CurrentPageResolverInterface $currentPageResolver |
||
79 | * @param AddressingContext $addressingContext |
||
80 | * @param ShippingContext $shippingContext |
||
81 | * @param PaymentContext $paymentContext |
||
82 | */ |
||
83 | public function __construct( |
||
102 | |||
103 | /** |
||
104 | * @Given I was at the checkout summary step |
||
105 | */ |
||
106 | public function iWasAtTheCheckoutSummaryStep() |
||
111 | |||
112 | /** |
||
113 | * @When I go to the addressing step |
||
114 | */ |
||
115 | public function iGoToTheAddressingStep() |
||
137 | |||
138 | /** |
||
139 | * @When I go to the shipping step |
||
140 | */ |
||
141 | public function iGoToTheShippingStep() |
||
157 | |||
158 | /** |
||
159 | * @When /^I proceed selecting ("[^"]+" as shipping country) with "([^"]+)" method$/ |
||
160 | */ |
||
161 | public function iProceedSelectingShippingCountryAndShippingMethod(CountryInterface $shippingCountry = null, $shippingMethodName = null) |
||
167 | |||
168 | /** |
||
169 | * @When /^I proceed selecting "([^"]+)" shipping method$/ |
||
170 | * @Given /^I chose "([^"]*)" shipping method$/ |
||
171 | */ |
||
172 | public function iProceedSelectingShippingMethod($shippingMethodName) |
||
176 | |||
177 | /** |
||
178 | * @Given I have proceeded selecting :paymentMethodName payment method |
||
179 | * @When /^I (?:proceed|proceeded) selecting "([^"]+)" payment method$/ |
||
180 | */ |
||
181 | public function iProceedSelectingPaymentMethod($paymentMethodName = 'Offline') |
||
186 | |||
187 | /** |
||
188 | * @When /^I change shipping method to "([^"]*)"$/ |
||
189 | */ |
||
190 | public function iChangeShippingMethod($shippingMethodName) |
||
195 | |||
196 | /** |
||
197 | * @When /^I do not modify anything$/ |
||
198 | */ |
||
199 | public function iDoNotModifyAnything() |
||
203 | |||
204 | /** |
||
205 | * @Given I have proceeded order with :shippingMethod shipping method and :paymentMethod payment |
||
206 | * @When I proceed with :shippingMethod shipping method and :paymentMethod payment |
||
207 | */ |
||
208 | public function iProceedOrderWithShippingMethodAndPayment($shippingMethod, $paymentMethod) |
||
213 | |||
214 | /** |
||
215 | * @When I proceed with :shippingMethod shipping method |
||
216 | */ |
||
217 | public function iProceedOrderWithShippingMethod($shippingMethod) |
||
221 | |||
222 | /** |
||
223 | * @Then the subtotal of :item item should be :price |
||
224 | */ |
||
225 | public function theSubtotalOfItemShouldBe($item, $price) |
||
232 | |||
233 | /** |
||
234 | * @return AddressPageInterface|SelectPaymentPageInterface|SelectShippingPageInterface|CompletePageInterface |
||
235 | */ |
||
236 | private function resolveCurrentStepPage() |
||
245 | } |
||
246 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: