1 | <?php |
||
31 | final class CheckoutContext implements Context |
||
32 | { |
||
33 | /** @var AddressPageInterface */ |
||
34 | private $addressPage; |
||
35 | |||
36 | /** @var SelectPaymentPageInterface */ |
||
37 | private $selectPaymentPage; |
||
38 | |||
39 | /** @var SelectShippingPageInterface */ |
||
40 | private $selectShippingPage; |
||
41 | |||
42 | /** @var CompletePageInterface */ |
||
43 | private $completePage; |
||
44 | |||
45 | /** @var RegisterPageInterface */ |
||
46 | private $registerPage; |
||
47 | |||
48 | /** @var RegisterElementInterface */ |
||
49 | private $registerElement; |
||
50 | |||
51 | /** @var CurrentPageResolverInterface */ |
||
52 | private $currentPageResolver; |
||
53 | |||
54 | /** @var CheckoutAddressingContext */ |
||
55 | private $addressingContext; |
||
56 | |||
57 | /** @var CheckoutShippingContext */ |
||
58 | private $shippingContext; |
||
59 | |||
60 | /** @var CheckoutPaymentContext */ |
||
61 | private $paymentContext; |
||
62 | |||
63 | public function __construct( |
||
86 | |||
87 | /** |
||
88 | * @Given I was at the checkout summary step |
||
89 | */ |
||
90 | public function iWasAtTheCheckoutSummaryStep() |
||
95 | |||
96 | /** |
||
97 | * @Given I chose :shippingMethodName shipping method |
||
98 | * @When I proceed selecting :shippingMethodName shipping method |
||
99 | */ |
||
100 | public function iProceedSelectingShippingMethod($shippingMethodName) |
||
104 | |||
105 | /** |
||
106 | * @Given I have proceeded selecting :paymentMethodName payment method |
||
107 | * @When I proceed selecting :paymentMethodName payment method |
||
108 | */ |
||
109 | public function iProceedSelectingPaymentMethod($paymentMethodName) |
||
114 | |||
115 | /** |
||
116 | * @Given I have proceeded order with :shippingMethodName shipping method and :paymentMethodName payment |
||
117 | * @When I proceed with :shippingMethodName shipping method and :paymentMethodName payment |
||
118 | */ |
||
119 | public function iProceedOrderWithShippingMethodAndPayment($shippingMethodName, $paymentMethodName) |
||
124 | |||
125 | /** |
||
126 | * @Given I have proceeded through checkout process in the :localeCode locale with email :email |
||
127 | * @When I proceed through checkout process |
||
128 | * @When I proceed through checkout process in the :localeCode locale |
||
129 | * @When I proceed through checkout process in the :localeCode locale with email :email |
||
130 | */ |
||
131 | public function iProceedThroughCheckoutProcess(string $localeCode = 'en_US', ?string $email = null): void |
||
137 | |||
138 | /** |
||
139 | * @When /^I proceed selecting ("[^"]+" as billing country) with "([^"]+)" method$/ |
||
140 | */ |
||
141 | public function iProceedSelectingBillingCountryAndShippingMethod(CountryInterface $shippingCountry = null, $shippingMethodName = null) |
||
146 | |||
147 | /** |
||
148 | * @When /^I change shipping method to "([^"]*)"$/ |
||
149 | */ |
||
150 | public function iChangeShippingMethod($shippingMethodName) |
||
155 | |||
156 | /** |
||
157 | * @When I go to the addressing step |
||
158 | */ |
||
159 | public function iGoToTheAddressingStep() |
||
181 | |||
182 | /** |
||
183 | * @When I go to the shipping step |
||
184 | */ |
||
185 | public function iGoToTheShippingStep() |
||
201 | |||
202 | /** |
||
203 | * @Then the subtotal of :item item should be :price |
||
204 | */ |
||
205 | public function theSubtotalOfItemShouldBe($item, $price) |
||
217 | |||
218 | /** |
||
219 | * @When I register with previously used :email email and :password password |
||
220 | */ |
||
221 | public function iRegisterWithPreviouslyUsedEmailAndPassword(string $email, string $password): void |
||
231 | } |
||
232 |
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: