1 | <?php |
||
30 | final class CheckoutContext implements Context |
||
31 | { |
||
32 | /** |
||
33 | * @var AddressPageInterface |
||
34 | */ |
||
35 | private $addressPage; |
||
36 | |||
37 | /** |
||
38 | * @var SelectPaymentPageInterface |
||
39 | */ |
||
40 | private $selectPaymentPage; |
||
41 | |||
42 | /** |
||
43 | * @var SelectShippingPageInterface |
||
44 | */ |
||
45 | private $selectShippingPage; |
||
46 | |||
47 | /** |
||
48 | * @var CompletePageInterface |
||
49 | */ |
||
50 | private $completePage; |
||
51 | |||
52 | /** |
||
53 | * @var CurrentPageResolverInterface |
||
54 | */ |
||
55 | private $currentPageResolver; |
||
56 | |||
57 | /** |
||
58 | * @var CheckoutAddressingContext |
||
59 | */ |
||
60 | private $addressingContext; |
||
61 | |||
62 | /** |
||
63 | * @var CheckoutShippingContext |
||
64 | */ |
||
65 | private $shippingContext; |
||
66 | |||
67 | /** |
||
68 | * @var CheckoutPaymentContext |
||
69 | */ |
||
70 | private $paymentContext; |
||
71 | |||
72 | /** |
||
73 | * @param AddressPageInterface $addressPage |
||
74 | * @param SelectPaymentPageInterface $selectPaymentPage |
||
75 | * @param SelectShippingPageInterface $selectShippingPage |
||
76 | * @param CompletePageInterface $completePage |
||
77 | * @param CurrentPageResolverInterface $currentPageResolver |
||
78 | * @param CheckoutAddressingContext $addressingContext |
||
79 | * @param CheckoutShippingContext $shippingContext |
||
80 | * @param CheckoutPaymentContext $paymentContext |
||
81 | */ |
||
82 | public function __construct( |
||
101 | |||
102 | /** |
||
103 | * @Given I was at the checkout summary step |
||
104 | */ |
||
105 | public function iWasAtTheCheckoutSummaryStep() |
||
110 | |||
111 | /** |
||
112 | * @Given I chose :shippingMethodName shipping method |
||
113 | * @When I proceed selecting :shippingMethodName shipping method |
||
114 | */ |
||
115 | public function iProceedSelectingShippingMethod($shippingMethodName) |
||
119 | |||
120 | /** |
||
121 | * @Given I have proceeded selecting :paymentMethodName payment method |
||
122 | * @When I proceed selecting :paymentMethodName payment method |
||
123 | */ |
||
124 | public function iProceedSelectingPaymentMethod($paymentMethodName) |
||
129 | |||
130 | /** |
||
131 | * @Given I have proceeded order with :shippingMethodName shipping method and :paymentMethodName payment |
||
132 | * @When I proceed with :shippingMethodName shipping method and :paymentMethodName payment |
||
133 | */ |
||
134 | public function iProceedOrderWithShippingMethodAndPayment($shippingMethodName, $paymentMethodName) |
||
139 | |||
140 | /** |
||
141 | * @When /^I proceed selecting ("[^"]+" as shipping country) with "([^"]+)" method$/ |
||
142 | */ |
||
143 | public function iProceedSelectingShippingCountryAndShippingMethod(CountryInterface $shippingCountry = null, $shippingMethodName = null) |
||
148 | |||
149 | /** |
||
150 | * @When /^I change shipping method to "([^"]*)"$/ |
||
151 | */ |
||
152 | public function iChangeShippingMethod($shippingMethodName) |
||
157 | |||
158 | /** |
||
159 | * @When I go to the addressing step |
||
160 | */ |
||
161 | public function iGoToTheAddressingStep() |
||
183 | |||
184 | /** |
||
185 | * @When I go to the shipping step |
||
186 | */ |
||
187 | public function iGoToTheShippingStep() |
||
203 | |||
204 | /** |
||
205 | * @Then the subtotal of :item item should be :price |
||
206 | */ |
||
207 | public function theSubtotalOfItemShouldBe($item, $price) |
||
221 | } |
||
222 |
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: