Complex classes like CheckoutContext often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use CheckoutContext, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
41 | final class CheckoutContext implements Context |
||
42 | { |
||
43 | /** |
||
44 | * @var SharedStorageInterface |
||
45 | */ |
||
46 | private $sharedStorage; |
||
47 | |||
48 | /** |
||
49 | * @var HomePageInterface |
||
50 | */ |
||
51 | private $homePage; |
||
52 | |||
53 | /** |
||
54 | * @var AddressPageInterface |
||
55 | */ |
||
56 | private $addressPage; |
||
57 | |||
58 | /** |
||
59 | * @var SelectPaymentPageInterface |
||
60 | */ |
||
61 | private $selectPaymentPage; |
||
62 | |||
63 | /** |
||
64 | * @var ThankYouPageInterface |
||
65 | */ |
||
66 | private $thankYouPage; |
||
67 | |||
68 | /** |
||
69 | * @var SelectShippingPageInterface |
||
70 | */ |
||
71 | private $selectShippingPage; |
||
72 | |||
73 | /** |
||
74 | * @var CompletePageInterface |
||
75 | */ |
||
76 | private $completePage; |
||
77 | |||
78 | /** |
||
79 | * @var ShowPageInterface |
||
80 | */ |
||
81 | private $orderDetails; |
||
82 | |||
83 | /** |
||
84 | * @var OrderRepositoryInterface |
||
85 | */ |
||
86 | private $orderRepository; |
||
87 | |||
88 | /** |
||
89 | * @var FactoryInterface |
||
90 | */ |
||
91 | private $addressFactory; |
||
92 | |||
93 | /** |
||
94 | * @var CurrentPageResolverInterface |
||
95 | */ |
||
96 | private $currentPageResolver; |
||
97 | |||
98 | /** |
||
99 | * @var AddressComparatorInterface |
||
100 | */ |
||
101 | private $addressComparator; |
||
102 | |||
103 | /** |
||
104 | * @param SharedStorageInterface $sharedStorage |
||
105 | * @param HomePageInterface $homePage |
||
106 | * @param AddressPageInterface $addressPage |
||
107 | * @param SelectPaymentPageInterface $selectPaymentPage |
||
108 | * @param ThankYouPageInterface $thankYouPage |
||
109 | * @param SelectShippingPageInterface $selectShippingPage |
||
110 | * @param CompletePageInterface $completePage |
||
111 | * @param ShowPageInterface $orderDetails |
||
112 | * @param OrderRepositoryInterface $orderRepository |
||
113 | * @param FactoryInterface $addressFactory |
||
114 | * @param CurrentPageResolverInterface $currentPageResolver |
||
115 | * @param AddressComparatorInterface $addressComparator |
||
116 | */ |
||
117 | public function __construct( |
||
118 | SharedStorageInterface $sharedStorage, |
||
119 | HomePageInterface $homePage, |
||
120 | AddressPageInterface $addressPage, |
||
121 | SelectPaymentPageInterface $selectPaymentPage, |
||
122 | ThankYouPageInterface $thankYouPage, |
||
123 | SelectShippingPageInterface $selectShippingPage, |
||
124 | CompletePageInterface $completePage, |
||
125 | ShowPageInterface $orderDetails, |
||
126 | OrderRepositoryInterface $orderRepository, |
||
127 | FactoryInterface $addressFactory, |
||
128 | CurrentPageResolverInterface $currentPageResolver, |
||
129 | AddressComparatorInterface $addressComparator |
||
130 | ) { |
||
131 | $this->sharedStorage = $sharedStorage; |
||
132 | $this->homePage = $homePage; |
||
133 | $this->addressPage = $addressPage; |
||
134 | $this->selectPaymentPage = $selectPaymentPage; |
||
135 | $this->thankYouPage = $thankYouPage; |
||
136 | $this->selectShippingPage = $selectShippingPage; |
||
137 | $this->completePage = $completePage; |
||
138 | $this->orderDetails = $orderDetails; |
||
139 | $this->orderRepository = $orderRepository; |
||
140 | $this->addressFactory = $addressFactory; |
||
141 | $this->currentPageResolver = $currentPageResolver; |
||
142 | $this->addressComparator = $addressComparator; |
||
143 | } |
||
144 | |||
145 | /** |
||
146 | * @Given I was at the checkout summary step |
||
147 | */ |
||
148 | public function iWasAtTheCheckoutSummaryStep() |
||
149 | { |
||
150 | $this->iSpecifiedTheShippingAddress($this->createDefaultAddress()); |
||
151 | $this->iProceedOrderWithShippingMethodAndPayment('Free', 'Offline'); |
||
152 | } |
||
153 | |||
154 | /** |
||
155 | * @Given I have proceeded selecting :shippingMethodName shipping method |
||
156 | */ |
||
157 | public function iHaveProceededSelectingShippingMethod($shippingMethodName) |
||
162 | |||
163 | /** |
||
164 | * @Given I am at the checkout addressing step |
||
165 | * @When I go back to addressing step of the checkout |
||
166 | */ |
||
167 | public function iAmAtTheCheckoutAddressingStep() |
||
171 | |||
172 | /** |
||
173 | * @When I try to open checkout addressing page |
||
174 | */ |
||
175 | public function iTryToOpenCheckoutAddressingPage() |
||
179 | |||
180 | /** |
||
181 | * @When I try to open checkout shipping page |
||
182 | */ |
||
183 | public function iTryToOpenCheckoutShippingPage() |
||
187 | |||
188 | /** |
||
189 | * @When I try to open checkout payment page |
||
190 | */ |
||
191 | public function iTryToOpenCheckoutPaymentPage() |
||
195 | |||
196 | /** |
||
197 | * @When I try to open checkout complete page |
||
198 | */ |
||
199 | public function iTryToOpenCheckoutCompletePage() |
||
203 | |||
204 | /** |
||
205 | * @When /^I want to browse order details for (this order)$/ |
||
206 | */ |
||
207 | public function iWantToBrowseOrderDetailsForThisOrder(OrderInterface $order) |
||
211 | |||
212 | /** |
||
213 | * @When /^I choose ("[^"]+" street) for shipping address$/ |
||
214 | */ |
||
215 | public function iChooseForShippingAddress(AddressInterface $address) |
||
219 | |||
220 | /** |
||
221 | * @When /^I choose ("[^"]+" street) for billing address$/ |
||
222 | */ |
||
223 | public function iChooseForBillingAddress(AddressInterface $address) |
||
228 | |||
229 | /** |
||
230 | * @When /^I specify the shipping (address as "[^"]+", "[^"]+", "[^"]+", "[^"]+" for "[^"]+")$/ |
||
231 | * @When /^I specify the shipping (address for "[^"]+" from "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+")$/ |
||
232 | * @When /^I (do not specify any shipping address) information$/ |
||
233 | * @When /^I change the shipping (address to "[^"]+", "[^"]+", "[^"]+", "[^"]+" for "[^"]+")$/ |
||
234 | */ |
||
235 | public function iSpecifyTheShippingAddressAs(AddressInterface $address) |
||
246 | |||
247 | /** |
||
248 | * @When I specify shipping country province as :province |
||
249 | */ |
||
250 | public function iSpecifyShippingCountryProvinceAs($province) |
||
254 | |||
255 | /** |
||
256 | * @When I specify billing country province as :province |
||
257 | */ |
||
258 | public function iSpecifyBillingCountryProvinceAs($province) |
||
262 | |||
263 | /** |
||
264 | * @When /^I specify the billing (address as "([^"]+)", "([^"]+)", "([^"]+)", "([^"]+)" for "([^"]+)")$/ |
||
265 | * @When /^I specify the billing (address for "([^"]+)" from "([^"]+)", "([^"]+)", "([^"]+)", "([^"]+)", "([^"]+)")$/ |
||
266 | * @When /^I (do not specify any billing address) information$/ |
||
267 | */ |
||
268 | public function iSpecifyTheBillingAddressAs(AddressInterface $address) |
||
280 | |||
281 | /** |
||
282 | * @When /^I specified the shipping (address as "([^"]+)", "([^"]+)", "([^"]+)", "([^"]+)" for "([^"]+)")$/ |
||
283 | */ |
||
284 | public function iSpecifiedTheShippingAddress(AddressInterface $address) |
||
294 | |||
295 | /** |
||
296 | * @When I specify the email as :email |
||
297 | * @When I do not specify the email |
||
298 | */ |
||
299 | public function iSpecifyTheEmail($email = null) |
||
303 | |||
304 | /** |
||
305 | * @Given I have selected :shippingMethod shipping method |
||
306 | * @When I select :shippingMethod shipping method |
||
307 | */ |
||
308 | public function iSelectShippingMethod($shippingMethod) |
||
312 | |||
313 | /** |
||
314 | * @Then I should not be able to select :shippingMethodName shipping method |
||
315 | */ |
||
316 | public function iShouldNotBeAbleToSelectShippingMethod($shippingMethodName) |
||
323 | |||
324 | /** |
||
325 | * @Then I should have :shippingMethodName shipping method available as the first choice |
||
326 | */ |
||
327 | public function iShouldHaveShippingMethodAvailableAsFirstChoice($shippingMethodName) |
||
334 | |||
335 | /** |
||
336 | * @Then I should have :shippingMethodName shipping method available as the last choice |
||
337 | */ |
||
338 | public function iShouldHaveShippingMethodAvailableAsLastChoice($shippingMethodName) |
||
345 | |||
346 | /** |
||
347 | * @Then I should have :countryName selected as country |
||
348 | */ |
||
349 | public function iShouldHaveSelectedAsCountry($countryName) |
||
357 | |||
358 | /** |
||
359 | * @Then I should have no country selected |
||
360 | */ |
||
361 | public function iShouldHaveNoCountrySelected() |
||
369 | |||
370 | /** |
||
371 | * @When I complete the addressing step |
||
372 | * @When I try to complete the addressing step |
||
373 | */ |
||
374 | public function iCompleteTheAddressingStep() |
||
378 | |||
379 | /** |
||
380 | * @When I go back to store |
||
381 | */ |
||
382 | public function iGoBackToStore() |
||
386 | |||
387 | /** |
||
388 | * @When /^I(?:| try to) complete the shipping step$/ |
||
389 | */ |
||
390 | public function iCompleteTheShippingStep() |
||
394 | |||
395 | /** |
||
396 | * @When I decide to change my address |
||
397 | */ |
||
398 | public function iDecideToChangeMyAddress() |
||
402 | |||
403 | /** |
||
404 | * @When I decide to change order shipping method |
||
405 | */ |
||
406 | public function iDecideToChangeMyShippingMethod() |
||
410 | |||
411 | /** |
||
412 | * @When I go to the addressing step |
||
413 | */ |
||
414 | public function iGoToTheAddressingStep() |
||
436 | |||
437 | /** |
||
438 | * @When I go to the shipping step |
||
439 | */ |
||
440 | public function iGoToTheShippingStep() |
||
456 | |||
457 | /** |
||
458 | * @When I decide to change the payment method |
||
459 | */ |
||
460 | public function iGoToThePaymentStep() |
||
464 | |||
465 | /** |
||
466 | * @When /^I proceed selecting ("[^"]+" as shipping country)$/ |
||
467 | */ |
||
468 | public function iProceedSelectingShippingCountry(CountryInterface $shippingCountry = null) |
||
479 | |||
480 | /** |
||
481 | * @When /^I proceed selecting ("[^"]+" as shipping country) with "([^"]+)" method$/ |
||
482 | */ |
||
483 | public function iProceedSelectingShippingCountryAndShippingMethod(CountryInterface $shippingCountry = null, $shippingMethodName) |
||
490 | |||
491 | /** |
||
492 | * @When /^I proceed selecting "([^"]+)" shipping method$/ |
||
493 | * @Given /^I chose "([^"]*)" shipping method$/ |
||
494 | */ |
||
495 | public function iProceedSelectingShippingMethod($shippingMethodName) |
||
499 | |||
500 | /** |
||
501 | * @When /^I choose "([^"]*)" payment method$/ |
||
502 | */ |
||
503 | public function iChoosePaymentMethod($paymentMethodName) |
||
508 | |||
509 | /** |
||
510 | * @When I change payment method to :paymentMethodName |
||
511 | */ |
||
512 | public function iChangePaymentMethodTo($paymentMethodName) |
||
516 | |||
517 | /** |
||
518 | * @When I go back to shipping step of the checkout |
||
519 | */ |
||
520 | public function iGoBackToShippingStepOfTheCheckout() |
||
524 | |||
525 | /** |
||
526 | * @Given I have proceeded selecting :paymentMethodName payment method |
||
527 | * @When /^I (?:proceed|proceeded) selecting "([^"]+)" payment method$/ |
||
528 | */ |
||
529 | public function iProceedSelectingPaymentMethod($paymentMethodName = 'Offline') |
||
533 | |||
534 | /** |
||
535 | * @When /^I change shipping method to "([^"]*)"$/ |
||
536 | */ |
||
537 | public function iChangeShippingMethod($shippingMethodName) |
||
543 | |||
544 | /** |
||
545 | * @When /^I provide additional note like "([^"]+)"$/ |
||
546 | */ |
||
547 | public function iProvideAdditionalNotesLike($notes) |
||
552 | |||
553 | /** |
||
554 | * @When /^I proceed as guest "([^"]*)" with ("[^"]+" as shipping country)$/ |
||
555 | */ |
||
556 | public function iProceedLoggingAsGuestWithAsShippingCountry($email, CountryInterface $shippingCountry = null) |
||
568 | |||
569 | /** |
||
570 | * @When I return to the checkout summary step |
||
571 | */ |
||
572 | public function iReturnToTheCheckoutSummaryStep() |
||
576 | |||
577 | /** |
||
578 | * @When I want to complete checkout |
||
579 | */ |
||
580 | public function iWantToCompleteCheckout() |
||
584 | |||
585 | /** |
||
586 | * @When I confirm my order |
||
587 | */ |
||
588 | public function iConfirmMyOrder() |
||
592 | |||
593 | /** |
||
594 | * @When I specify the password as :password |
||
595 | */ |
||
596 | public function iSpecifyThePasswordAs($password) |
||
600 | |||
601 | /** |
||
602 | * @When I sign in |
||
603 | */ |
||
604 | public function iSignIn() |
||
608 | |||
609 | /** |
||
610 | * @Then I should see the thank you page |
||
611 | */ |
||
612 | public function iShouldSeeTheThankYouPage() |
||
619 | |||
620 | /** |
||
621 | * @Then I should not see the thank you page |
||
622 | */ |
||
623 | public function iShouldNotSeeTheThankYouPage() |
||
630 | |||
631 | /** |
||
632 | * @Given I should be informed with :paymentMethod payment method instructions |
||
633 | */ |
||
634 | public function iShouldBeInformedWithPaymentMethodInstructions(PaymentMethodInterface $paymentMethod) |
||
641 | |||
642 | /** |
||
643 | * @Then I should be on the checkout shipping step |
||
644 | */ |
||
645 | public function iShouldBeOnTheCheckoutShippingStep() |
||
652 | |||
653 | /** |
||
654 | * @Then I should be on the checkout payment step |
||
655 | */ |
||
656 | public function iShouldBeOnTheCheckoutPaymentStep() |
||
663 | |||
664 | /** |
||
665 | * @Then I should be on the checkout summary step |
||
666 | */ |
||
667 | public function iShouldBeOnTheCheckoutSummaryStep() |
||
674 | |||
675 | /** |
||
676 | * @Then /^I should(?:| also) be notified that the "([^"]+)" and the "([^"]+)" in (shipping|billing) details are required$/ |
||
677 | */ |
||
678 | public function iShouldBeNotifiedThatTheAndTheInShippingDetailsAreRequired($firstElement, $secondElement, $type) |
||
683 | |||
684 | /** |
||
685 | * @Then I should be informed that my order cannot be shipped to this address |
||
686 | */ |
||
687 | public function iShouldBeInformedThatMyOrderCannotBeShippedToThisAddress() |
||
694 | |||
695 | /** |
||
696 | * @Then I should be able to log in |
||
697 | */ |
||
698 | public function iShouldBeAbleToLogIn() |
||
705 | |||
706 | /** |
||
707 | * @Then the login form should no longer be accessible |
||
708 | */ |
||
709 | public function theLoginFormShouldNoLongerBeAccessible() |
||
716 | |||
717 | /** |
||
718 | * @Then I should be notified about bad credentials |
||
719 | */ |
||
720 | public function iShouldBeNotifiedAboutBadCredentials() |
||
727 | |||
728 | /** |
||
729 | * @Then my order's shipping address should be to :fullName |
||
730 | */ |
||
731 | public function iShouldSeeThisShippingAddressAsShippingAddress($fullName) |
||
739 | |||
740 | /** |
||
741 | * @Then my order's billing address should be to :fullName |
||
742 | */ |
||
743 | public function iShouldSeeThisBillingAddressAsBillingAddress($fullName) |
||
751 | |||
752 | /** |
||
753 | * @Then address to :fullName should be used for both shipping and billing of my order |
||
754 | */ |
||
755 | public function iShouldSeeThisShippingAddressAsShippingAndBillingAddress($fullName) |
||
760 | |||
761 | /** |
||
762 | * @When I go back to payment step of the checkout |
||
763 | */ |
||
764 | public function iAmAtTheCheckoutPaymentStep() |
||
768 | |||
769 | /** |
||
770 | * @When I complete the payment step |
||
771 | */ |
||
772 | public function iCompleteThePaymentStep() |
||
776 | |||
777 | /** |
||
778 | * @When I select :name payment method |
||
779 | */ |
||
780 | public function iSelectPaymentMethod($name) |
||
784 | |||
785 | /** |
||
786 | * @When /^I do not modify anything$/ |
||
787 | */ |
||
788 | public function iDoNotModifyAnything() |
||
792 | |||
793 | /** |
||
794 | * @Then I should not be able to select :paymentMethodName payment method |
||
795 | */ |
||
796 | public function iShouldNotBeAbleToSelectPaymentMethod($paymentMethodName) |
||
803 | |||
804 | /** |
||
805 | * @Then I should be able to select :paymentMethodName payment method |
||
806 | */ |
||
807 | public function iShouldBeAbleToSelectPaymentMethod($paymentMethodName) |
||
814 | |||
815 | /** |
||
816 | * @Given I have proceeded order with :shippingMethod shipping method and :paymentMethod payment |
||
817 | * @When I proceed with :shippingMethod shipping method and :paymentMethod payment |
||
818 | */ |
||
819 | public function iProceedOrderWithShippingMethodAndPayment($shippingMethod, $paymentMethod) |
||
826 | |||
827 | /** |
||
828 | * @Given I should have :quantity :productName products in the cart |
||
829 | */ |
||
830 | public function iShouldHaveProductsInTheCart($quantity, $productName) |
||
837 | |||
838 | /** |
||
839 | * @Then my order shipping should be :price |
||
840 | */ |
||
841 | public function myOrderShippingShouldBe($price) |
||
848 | |||
849 | /** |
||
850 | * @Then /^the ("[^"]+" product) should have unit price discounted by ("\$\d+")$/ |
||
851 | */ |
||
852 | public function theShouldHaveUnitPriceDiscountedFor(ProductInterface $product, $amount) |
||
859 | |||
860 | /** |
||
861 | * @Then /^my order total should be ("(?:\£|\$)\d+(?:\.\d+)?")$/ |
||
862 | */ |
||
863 | public function myOrderTotalShouldBe($total) |
||
870 | |||
871 | /** |
||
872 | * @Then my order promotion total should be :promotionTotal |
||
873 | */ |
||
874 | public function myOrderPromotionTotalShouldBe($promotionTotal) |
||
881 | |||
882 | /** |
||
883 | * @Then :promotionName should be applied to my order |
||
884 | */ |
||
885 | public function shouldBeAppliedToMyOrder($promotionName) |
||
892 | |||
893 | /** |
||
894 | * @Given my tax total should be :taxTotal |
||
895 | */ |
||
896 | public function myTaxTotalShouldBe($taxTotal) |
||
903 | |||
904 | /** |
||
905 | * @Then my order's shipping method should be :shippingMethod |
||
906 | */ |
||
907 | public function myOrderSShippingMethodShouldBe(ShippingMethodInterface $shippingMethod) |
||
914 | |||
915 | /** |
||
916 | * @Then my order's payment method should be :paymentMethod |
||
917 | */ |
||
918 | public function myOrderSPaymentMethodShouldBe(PaymentMethodInterface $paymentMethod) |
||
925 | |||
926 | /** |
||
927 | * @Then I should be redirected to the homepage |
||
928 | */ |
||
929 | public function iShouldBeRedirectedToTheHomepage() |
||
936 | |||
937 | /** |
||
938 | * @Then I should be redirected to the addressing step |
||
939 | */ |
||
940 | public function iShouldBeRedirectedToTheAddressingStep() |
||
947 | |||
948 | /** |
||
949 | * @Given I should be able to go to the shipping step again |
||
950 | */ |
||
951 | public function iShouldBeAbleToGoToTheShippingStepAgain() |
||
960 | |||
961 | /** |
||
962 | * @Then I should be redirected to the shipping step |
||
963 | */ |
||
964 | public function iShouldBeRedirectedToTheShippingStep() |
||
971 | |||
972 | /** |
||
973 | * @Then /^I should be able to pay(?| again)$/ |
||
974 | */ |
||
975 | public function iShouldBeAbleToPayAgain() |
||
982 | |||
983 | /** |
||
984 | * @Then I should not be able to pay |
||
985 | */ |
||
986 | public function iShouldNotBeAbleToPayAgain() |
||
993 | |||
994 | /** |
||
995 | * @Given I should be able to go to the payment step again |
||
996 | */ |
||
997 | public function iShouldBeAbleToGoToThePaymentStepAgain() |
||
1006 | |||
1007 | /** |
||
1008 | * @Then I should be redirected to the payment step |
||
1009 | */ |
||
1010 | public function iShouldBeRedirectedToThePaymentStep() |
||
1017 | |||
1018 | /** |
||
1019 | * @Given I should be able to go to the summary page again |
||
1020 | */ |
||
1021 | public function iShouldBeAbleToGoToTheSummaryPageAgain() |
||
1030 | |||
1031 | /** |
||
1032 | * @Given I should see shipping method :shippingMethodName with fee :fee |
||
1033 | */ |
||
1034 | public function iShouldSeeShippingFee($shippingMethodName, $fee) |
||
1041 | |||
1042 | /** |
||
1043 | * @Given /^I have completed addressing step with email "([^"]+)" and ("[^"]+" based shipping address)$/ |
||
1044 | * @When /^I complete addressing step with email "([^"]+)" and ("[^"]+" based shipping address)$/ |
||
1045 | */ |
||
1046 | public function iCompleteAddressingStepWithEmail($email, AddressInterface $address) |
||
1053 | |||
1054 | /** |
||
1055 | * @Then the subtotal of :item item should be :price |
||
1056 | */ |
||
1057 | public function theSubtotalOfItemShouldBe($item, $price) |
||
1068 | |||
1069 | /** |
||
1070 | * @Then the :product product should have unit price :price |
||
1071 | */ |
||
1072 | public function theProductShouldHaveUnitPrice(ProductInterface $product, $price) |
||
1079 | |||
1080 | /** |
||
1081 | * @Given /^I should be notified that (this product) does not have sufficient stock$/ |
||
1082 | */ |
||
1083 | public function iShouldBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product) |
||
1090 | |||
1091 | /** |
||
1092 | * @Then my order's locale should be :localeName |
||
1093 | */ |
||
1094 | public function myOrderSLocaleShouldBe($localeName) |
||
1101 | |||
1102 | /** |
||
1103 | * @Then /^I should not be notified that (this product) does not have sufficient stock$/ |
||
1104 | */ |
||
1105 | public function iShouldNotBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product) |
||
1112 | |||
1113 | /** |
||
1114 | * @Then I should be on the checkout addressing step |
||
1115 | */ |
||
1116 | public function iShouldBeOnTheCheckoutAddressingStep() |
||
1123 | |||
1124 | /** |
||
1125 | * @When I specify the province name manually as :provinceName for shipping address |
||
1126 | */ |
||
1127 | public function iSpecifyTheProvinceNameManuallyAsForShippingAddress($provinceName) |
||
1131 | |||
1132 | /** |
||
1133 | * @When I specify the province name manually as :provinceName for billing address |
||
1134 | */ |
||
1135 | public function iSpecifyTheProvinceNameManuallyAsForBillingAddress($provinceName) |
||
1139 | |||
1140 | /** |
||
1141 | * @Then I should not be able to specify province name manually for shipping address |
||
1142 | */ |
||
1143 | public function iShouldNotBeAbleToSpecifyProvinceNameManuallyForShippingAddress() |
||
1150 | |||
1151 | /** |
||
1152 | * @Then I should not be able to specify province name manually for billing address |
||
1153 | */ |
||
1154 | public function iShouldNotBeAbleToSpecifyProvinceNameManuallyForBillingAddress() |
||
1161 | |||
1162 | /** |
||
1163 | * @Then I should see :provinceName in the shipping address |
||
1164 | */ |
||
1165 | public function iShouldSeeInTheShippingAddress($provinceName) |
||
1172 | |||
1173 | /** |
||
1174 | * @Then I should see :provinceName in the billing address |
||
1175 | */ |
||
1176 | public function iShouldSeeInTheBillingAddress($provinceName) |
||
1183 | |||
1184 | /** |
||
1185 | * @Then there should be information about no available shipping methods |
||
1186 | */ |
||
1187 | public function thereShouldBeInformationAboutNoShippingMethodsAvailableForMyShippingAddress() |
||
1194 | |||
1195 | /** |
||
1196 | * @Then /^(address "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+") should be filled as shipping address$/ |
||
1197 | */ |
||
1198 | public function addressShouldBeFilledAsShippingAddress(AddressInterface $address) |
||
1202 | |||
1203 | /** |
||
1204 | * @Then /^(address "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+") should be filled as billing address$/ |
||
1205 | */ |
||
1206 | public function addressShouldBeFilledAsBillingAddress(AddressInterface $address) |
||
1210 | |||
1211 | /** |
||
1212 | * @Then I should have :paymentMethodName payment method available as the first choice |
||
1213 | */ |
||
1214 | public function iShouldHavePaymentMethodAvailableAsFirstChoice($paymentMethodName) |
||
1221 | |||
1222 | /** |
||
1223 | * @Then I should have :paymentMethodName payment method available as the last choice |
||
1224 | */ |
||
1225 | public function iShouldHavePaymentMethodAvailableAsLastChoice($paymentMethodName) |
||
1232 | |||
1233 | /** |
||
1234 | * @Then I should see :shippingMethodName shipping method |
||
1235 | */ |
||
1236 | public function iShouldSeeShippingMethod($shippingMethodName) |
||
1243 | |||
1244 | /** |
||
1245 | * @Then I should not see :shippingMethodName shipping method |
||
1246 | */ |
||
1247 | public function iShouldNotSeeShippingMethod($shippingMethodName) |
||
1254 | |||
1255 | /** |
||
1256 | * @Then I should be checking out as :email |
||
1257 | */ |
||
1258 | public function iShouldBeCheckingOutAs($email) |
||
1265 | |||
1266 | /** |
||
1267 | * @return AddressInterface |
||
1268 | */ |
||
1269 | private function createDefaultAddress() |
||
1283 | |||
1284 | /** |
||
1285 | * @param string $type |
||
1286 | * @param string $element |
||
1287 | * @param string $expectedMessage |
||
1288 | * |
||
1289 | * @throws \InvalidArgumentException |
||
1290 | */ |
||
1291 | private function assertElementValidationMessage($type, $element, $expectedMessage) |
||
1299 | |||
1300 | /** |
||
1301 | * @return SymfonyPageInterface |
||
1302 | */ |
||
1303 | private function resolveCurrentStepPage() |
||
1314 | } |
||
1315 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.