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 |
||
| 39 | final class CheckoutContext implements Context |
||
| 40 | { |
||
| 41 | /** |
||
| 42 | * @var SharedStorageInterface |
||
| 43 | */ |
||
| 44 | private $sharedStorage; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @var HomePageInterface |
||
| 48 | */ |
||
| 49 | private $homePage; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @var AddressPageInterface |
||
| 53 | */ |
||
| 54 | private $addressPage; |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @var SelectPaymentPageInterface |
||
| 58 | */ |
||
| 59 | private $selectPaymentPage; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @var SelectShippingPageInterface |
||
| 63 | */ |
||
| 64 | private $selectShippingPage; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @var CompletePageInterface |
||
| 68 | */ |
||
| 69 | private $completePage; |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @var FactoryInterface |
||
| 73 | */ |
||
| 74 | private $addressFactory; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @var CurrentPageResolverInterface |
||
| 78 | */ |
||
| 79 | private $currentPageResolver; |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @var AddressComparatorInterface |
||
| 83 | */ |
||
| 84 | private $addressComparator; |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @param SharedStorageInterface $sharedStorage |
||
| 88 | * @param HomePageInterface $homePage |
||
| 89 | * @param AddressPageInterface $addressPage |
||
| 90 | * @param SelectPaymentPageInterface $selectPaymentPage |
||
| 91 | * @param SelectShippingPageInterface $selectShippingPage |
||
| 92 | * @param CompletePageInterface $completePage |
||
| 93 | * @param FactoryInterface $addressFactory |
||
| 94 | * @param CurrentPageResolverInterface $currentPageResolver |
||
| 95 | * @param AddressComparatorInterface $addressComparator |
||
| 96 | */ |
||
| 97 | public function __construct( |
||
| 118 | |||
| 119 | /** |
||
| 120 | * @Given I was at the checkout summary step |
||
| 121 | */ |
||
| 122 | public function iWasAtTheCheckoutSummaryStep() |
||
| 127 | |||
| 128 | /** |
||
| 129 | * @Given I have proceeded selecting :shippingMethodName shipping method |
||
| 130 | */ |
||
| 131 | public function iHaveProceededSelectingShippingMethod($shippingMethodName) |
||
| 136 | |||
| 137 | /** |
||
| 138 | * @Given I am at the checkout addressing step |
||
| 139 | * @When I go back to addressing step of the checkout |
||
| 140 | */ |
||
| 141 | public function iAmAtTheCheckoutAddressingStep() |
||
| 145 | |||
| 146 | /** |
||
| 147 | * @When I try to open checkout addressing page |
||
| 148 | */ |
||
| 149 | public function iTryToOpenCheckoutAddressingPage() |
||
| 153 | |||
| 154 | /** |
||
| 155 | * @When I try to open checkout shipping page |
||
| 156 | */ |
||
| 157 | public function iTryToOpenCheckoutShippingPage() |
||
| 161 | |||
| 162 | /** |
||
| 163 | * @When I try to open checkout payment page |
||
| 164 | */ |
||
| 165 | public function iTryToOpenCheckoutPaymentPage() |
||
| 169 | |||
| 170 | /** |
||
| 171 | * @When I try to open checkout complete page |
||
| 172 | */ |
||
| 173 | public function iTryToOpenCheckoutCompletePage() |
||
| 177 | |||
| 178 | /** |
||
| 179 | * @When /^I choose ("[^"]+" street) for shipping address$/ |
||
| 180 | */ |
||
| 181 | public function iChooseForShippingAddress(AddressInterface $address) |
||
| 185 | |||
| 186 | /** |
||
| 187 | * @When /^I choose ("[^"]+" street) for billing address$/ |
||
| 188 | */ |
||
| 189 | public function iChooseForBillingAddress(AddressInterface $address) |
||
| 194 | |||
| 195 | /** |
||
| 196 | * @When /^I specify the shipping (address as "[^"]+", "[^"]+", "[^"]+", "[^"]+" for "[^"]+")$/ |
||
| 197 | * @When /^I specify the shipping (address for "[^"]+" from "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+")$/ |
||
| 198 | * @When /^I (do not specify any shipping address) information$/ |
||
| 199 | * @When /^I change the shipping (address to "[^"]+", "[^"]+", "[^"]+", "[^"]+" for "[^"]+")$/ |
||
| 200 | */ |
||
| 201 | public function iSpecifyTheShippingAddressAs(AddressInterface $address) |
||
| 212 | |||
| 213 | /** |
||
| 214 | * @When I specify shipping country province as :province |
||
| 215 | */ |
||
| 216 | public function iSpecifyShippingCountryProvinceAs($province) |
||
| 220 | |||
| 221 | /** |
||
| 222 | * @When I specify billing country province as :province |
||
| 223 | */ |
||
| 224 | public function iSpecifyBillingCountryProvinceAs($province) |
||
| 228 | |||
| 229 | /** |
||
| 230 | * @When /^I specify the billing (address as "([^"]+)", "([^"]+)", "([^"]+)", "([^"]+)" for "([^"]+)")$/ |
||
| 231 | * @When /^I specify the billing (address for "([^"]+)" from "([^"]+)", "([^"]+)", "([^"]+)", "([^"]+)", "([^"]+)")$/ |
||
| 232 | * @When /^I (do not specify any billing address) information$/ |
||
| 233 | */ |
||
| 234 | public function iSpecifyTheBillingAddressAs(AddressInterface $address) |
||
| 247 | |||
| 248 | /** |
||
| 249 | * @When /^I specified the shipping (address as "[^"]+", "[^"]+", "[^"]+", "[^"]+" for "[^"]+")$/ |
||
| 250 | */ |
||
| 251 | public function iSpecifiedTheShippingAddress(AddressInterface $address) |
||
| 261 | |||
| 262 | /** |
||
| 263 | * @When I specify the email as :email |
||
| 264 | * @When I do not specify the email |
||
| 265 | */ |
||
| 266 | public function iSpecifyTheEmail($email = null) |
||
| 270 | |||
| 271 | /** |
||
| 272 | * @Given I have selected :shippingMethod shipping method |
||
| 273 | * @When I select :shippingMethod shipping method |
||
| 274 | */ |
||
| 275 | public function iSelectShippingMethod($shippingMethod) |
||
| 279 | |||
| 280 | /** |
||
| 281 | * @Then I should not be able to select :shippingMethodName shipping method |
||
| 282 | */ |
||
| 283 | public function iShouldNotBeAbleToSelectShippingMethod($shippingMethodName) |
||
| 290 | |||
| 291 | /** |
||
| 292 | * @Then I should have :shippingMethodName shipping method available as the first choice |
||
| 293 | */ |
||
| 294 | public function iShouldHaveShippingMethodAvailableAsFirstChoice($shippingMethodName) |
||
| 301 | |||
| 302 | /** |
||
| 303 | * @Then I should have :shippingMethodName shipping method available as the last choice |
||
| 304 | */ |
||
| 305 | public function iShouldHaveShippingMethodAvailableAsLastChoice($shippingMethodName) |
||
| 312 | |||
| 313 | /** |
||
| 314 | * @Then I should have :countryName selected as country |
||
| 315 | */ |
||
| 316 | public function iShouldHaveSelectedAsCountry($countryName) |
||
| 324 | |||
| 325 | /** |
||
| 326 | * @Then I should have no country selected |
||
| 327 | */ |
||
| 328 | public function iShouldHaveNoCountrySelected() |
||
| 336 | |||
| 337 | /** |
||
| 338 | * @When I complete the addressing step |
||
| 339 | * @When I try to complete the addressing step |
||
| 340 | */ |
||
| 341 | public function iCompleteTheAddressingStep() |
||
| 345 | |||
| 346 | /** |
||
| 347 | * @When I go back to store |
||
| 348 | */ |
||
| 349 | public function iGoBackToStore() |
||
| 353 | |||
| 354 | /** |
||
| 355 | * @When /^I(?:| try to) complete the shipping step$/ |
||
| 356 | */ |
||
| 357 | public function iCompleteTheShippingStep() |
||
| 361 | |||
| 362 | /** |
||
| 363 | * @When I decide to change my address |
||
| 364 | */ |
||
| 365 | public function iDecideToChangeMyAddress() |
||
| 369 | |||
| 370 | /** |
||
| 371 | * @When I decide to change order shipping method |
||
| 372 | */ |
||
| 373 | public function iDecideToChangeMyShippingMethod() |
||
| 377 | |||
| 378 | /** |
||
| 379 | * @When I go to the addressing step |
||
| 380 | */ |
||
| 381 | public function iGoToTheAddressingStep() |
||
| 403 | |||
| 404 | /** |
||
| 405 | * @When I go to the shipping step |
||
| 406 | */ |
||
| 407 | public function iGoToTheShippingStep() |
||
| 423 | |||
| 424 | /** |
||
| 425 | * @When I decide to change the payment method |
||
| 426 | */ |
||
| 427 | public function iGoToThePaymentStep() |
||
| 431 | |||
| 432 | /** |
||
| 433 | * @When /^I proceed selecting ("[^"]+" as shipping country)$/ |
||
| 434 | */ |
||
| 435 | public function iProceedSelectingShippingCountry(CountryInterface $shippingCountry = null) |
||
| 446 | |||
| 447 | /** |
||
| 448 | * @When /^I proceed selecting ("[^"]+" as shipping country) with "([^"]+)" method$/ |
||
| 449 | */ |
||
| 450 | public function iProceedSelectingShippingCountryAndShippingMethod(CountryInterface $shippingCountry = null, $shippingMethodName = null) |
||
| 457 | |||
| 458 | /** |
||
| 459 | * @When /^I proceed selecting "([^"]+)" shipping method$/ |
||
| 460 | * @Given /^I chose "([^"]*)" shipping method$/ |
||
| 461 | */ |
||
| 462 | public function iProceedSelectingShippingMethod($shippingMethodName) |
||
| 466 | |||
| 467 | /** |
||
| 468 | * @When /^I choose "([^"]*)" payment method$/ |
||
| 469 | */ |
||
| 470 | public function iChoosePaymentMethod($paymentMethodName) |
||
| 475 | |||
| 476 | /** |
||
| 477 | * @When I go back to shipping step of the checkout |
||
| 478 | */ |
||
| 479 | public function iGoBackToShippingStepOfTheCheckout() |
||
| 483 | |||
| 484 | /** |
||
| 485 | * @Given I have proceeded selecting :paymentMethodName payment method |
||
| 486 | * @When /^I (?:proceed|proceeded) selecting "([^"]+)" payment method$/ |
||
| 487 | */ |
||
| 488 | public function iProceedSelectingPaymentMethod($paymentMethodName = 'Offline') |
||
| 493 | |||
| 494 | /** |
||
| 495 | * @When /^I change shipping method to "([^"]*)"$/ |
||
| 496 | */ |
||
| 497 | public function iChangeShippingMethod($shippingMethodName) |
||
| 503 | |||
| 504 | /** |
||
| 505 | * @When /^I provide additional note like "([^"]+)"$/ |
||
| 506 | */ |
||
| 507 | public function iProvideAdditionalNotesLike($notes) |
||
| 512 | |||
| 513 | /** |
||
| 514 | * @When /^I proceed as guest "([^"]*)" with ("[^"]+" as shipping country)$/ |
||
| 515 | */ |
||
| 516 | public function iProceedLoggingAsGuestWithAsShippingCountry($email, CountryInterface $shippingCountry = null) |
||
| 528 | |||
| 529 | /** |
||
| 530 | * @When I return to the checkout summary step |
||
| 531 | */ |
||
| 532 | public function iReturnToTheCheckoutSummaryStep() |
||
| 536 | |||
| 537 | /** |
||
| 538 | * @When I want to complete checkout |
||
| 539 | */ |
||
| 540 | public function iWantToCompleteCheckout() |
||
| 544 | |||
| 545 | /** |
||
| 546 | * @When I want to pay for order |
||
| 547 | */ |
||
| 548 | public function iWantToPayForOrder() |
||
| 552 | |||
| 553 | /** |
||
| 554 | * @When I confirm my order |
||
| 555 | */ |
||
| 556 | public function iConfirmMyOrder() |
||
| 560 | |||
| 561 | /** |
||
| 562 | * @When I specify the password as :password |
||
| 563 | */ |
||
| 564 | public function iSpecifyThePasswordAs($password) |
||
| 568 | |||
| 569 | /** |
||
| 570 | * @When I sign in |
||
| 571 | */ |
||
| 572 | public function iSignIn() |
||
| 576 | |||
| 577 | /** |
||
| 578 | * @Then I should be on the checkout shipping step |
||
| 579 | */ |
||
| 580 | public function iShouldBeOnTheCheckoutShippingStep() |
||
| 587 | |||
| 588 | /** |
||
| 589 | * @Then I should be on the checkout complete step |
||
| 590 | */ |
||
| 591 | public function iShouldBeOnTheCheckoutCompleteStep() |
||
| 595 | |||
| 596 | /** |
||
| 597 | * @Then I should be on the checkout payment step |
||
| 598 | */ |
||
| 599 | public function iShouldBeOnTheCheckoutPaymentStep() |
||
| 606 | |||
| 607 | /** |
||
| 608 | * @Then I should be on the checkout summary step |
||
| 609 | */ |
||
| 610 | public function iShouldBeOnTheCheckoutSummaryStep() |
||
| 617 | |||
| 618 | /** |
||
| 619 | * @Then /^I should(?:| also) be notified that the "([^"]+)" and the "([^"]+)" in (shipping|billing) details are required$/ |
||
| 620 | */ |
||
| 621 | public function iShouldBeNotifiedThatTheAndTheInShippingDetailsAreRequired($firstElement, $secondElement, $type) |
||
| 626 | |||
| 627 | /** |
||
| 628 | * @Then I should be informed that my order cannot be shipped to this address |
||
| 629 | */ |
||
| 630 | public function iShouldBeInformedThatMyOrderCannotBeShippedToThisAddress() |
||
| 637 | |||
| 638 | /** |
||
| 639 | * @Then I should be able to log in |
||
| 640 | */ |
||
| 641 | public function iShouldBeAbleToLogIn() |
||
| 648 | |||
| 649 | /** |
||
| 650 | * @Then the login form should no longer be accessible |
||
| 651 | */ |
||
| 652 | public function theLoginFormShouldNoLongerBeAccessible() |
||
| 659 | |||
| 660 | /** |
||
| 661 | * @Then I should be notified about bad credentials |
||
| 662 | */ |
||
| 663 | public function iShouldBeNotifiedAboutBadCredentials() |
||
| 670 | |||
| 671 | /** |
||
| 672 | * @Then my order's shipping address should be to :fullName |
||
| 673 | */ |
||
| 674 | public function iShouldSeeThisShippingAddressAsShippingAddress($fullName) |
||
| 682 | |||
| 683 | /** |
||
| 684 | * @Then my order's billing address should be to :fullName |
||
| 685 | */ |
||
| 686 | public function iShouldSeeThisBillingAddressAsBillingAddress($fullName) |
||
| 694 | |||
| 695 | /** |
||
| 696 | * @Then address to :fullName should be used for both shipping and billing of my order |
||
| 697 | */ |
||
| 698 | public function iShouldSeeThisShippingAddressAsShippingAndBillingAddress($fullName) |
||
| 703 | |||
| 704 | /** |
||
| 705 | * @When I go back to payment step of the checkout |
||
| 706 | */ |
||
| 707 | public function iAmAtTheCheckoutPaymentStep() |
||
| 711 | |||
| 712 | /** |
||
| 713 | * @When I complete the payment step |
||
| 714 | */ |
||
| 715 | public function iCompleteThePaymentStep() |
||
| 719 | |||
| 720 | /** |
||
| 721 | * @When I select :name payment method |
||
| 722 | */ |
||
| 723 | public function iSelectPaymentMethod($name) |
||
| 727 | |||
| 728 | /** |
||
| 729 | * @When /^I do not modify anything$/ |
||
| 730 | */ |
||
| 731 | public function iDoNotModifyAnything() |
||
| 735 | |||
| 736 | /** |
||
| 737 | * @Then I should not be able to select :paymentMethodName payment method |
||
| 738 | */ |
||
| 739 | public function iShouldNotBeAbleToSelectPaymentMethod($paymentMethodName) |
||
| 746 | |||
| 747 | /** |
||
| 748 | * @Then I should be able to select :paymentMethodName payment method |
||
| 749 | */ |
||
| 750 | public function iShouldBeAbleToSelectPaymentMethod($paymentMethodName) |
||
| 757 | |||
| 758 | /** |
||
| 759 | * @Given I have proceeded order with :shippingMethod shipping method and :paymentMethod payment |
||
| 760 | * @When I proceed with :shippingMethod shipping method and :paymentMethod payment |
||
| 761 | */ |
||
| 762 | public function iProceedOrderWithShippingMethodAndPayment($shippingMethod, $paymentMethod) |
||
| 769 | |||
| 770 | /** |
||
| 771 | * @When I proceed with :shippingMethod shipping method |
||
| 772 | */ |
||
| 773 | public function iProceedOrderWithShippingMethod($shippingMethod) |
||
| 778 | |||
| 779 | /** |
||
| 780 | * @Given I should have :quantity :productName products in the cart |
||
| 781 | */ |
||
| 782 | public function iShouldHaveProductsInTheCart($quantity, $productName) |
||
| 789 | |||
| 790 | /** |
||
| 791 | * @Then my order shipping should be :price |
||
| 792 | */ |
||
| 793 | public function myOrderShippingShouldBe($price) |
||
| 800 | |||
| 801 | /** |
||
| 802 | * @Then /^the ("[^"]+" product) should have unit price discounted by ("\$\d+")$/ |
||
| 803 | */ |
||
| 804 | public function theShouldHaveUnitPriceDiscountedFor(ProductInterface $product, $amount) |
||
| 811 | |||
| 812 | /** |
||
| 813 | * @Then /^my order total should be ("(?:\£|\$)\d+(?:\.\d+)?")$/ |
||
| 814 | */ |
||
| 815 | public function myOrderTotalShouldBe($total) |
||
| 822 | |||
| 823 | /** |
||
| 824 | * @Then my order promotion total should be :promotionTotal |
||
| 825 | */ |
||
| 826 | public function myOrderPromotionTotalShouldBe($promotionTotal) |
||
| 833 | |||
| 834 | /** |
||
| 835 | * @Then :promotionName should be applied to my order |
||
| 836 | */ |
||
| 837 | public function shouldBeAppliedToMyOrder($promotionName) |
||
| 844 | |||
| 845 | /** |
||
| 846 | * @Then :promotionName should be applied to my order shipping |
||
| 847 | */ |
||
| 848 | public function shouldBeAppliedToMyOrderShipping($promotionName) |
||
| 852 | |||
| 853 | /** |
||
| 854 | * @Given my tax total should be :taxTotal |
||
| 855 | */ |
||
| 856 | public function myTaxTotalShouldBe($taxTotal) |
||
| 863 | |||
| 864 | /** |
||
| 865 | * @Then my order's shipping method should be :shippingMethod |
||
| 866 | */ |
||
| 867 | public function myOrderSShippingMethodShouldBe(ShippingMethodInterface $shippingMethod) |
||
| 874 | |||
| 875 | /** |
||
| 876 | * @Then my order's payment method should be :paymentMethod |
||
| 877 | */ |
||
| 878 | public function myOrderSPaymentMethodShouldBe(PaymentMethodInterface $paymentMethod) |
||
| 885 | |||
| 886 | /** |
||
| 887 | * @Then I should be redirected to the homepage |
||
| 888 | */ |
||
| 889 | public function iShouldBeRedirectedToTheHomepage() |
||
| 896 | |||
| 897 | /** |
||
| 898 | * @Then I should be redirected to the addressing step |
||
| 899 | */ |
||
| 900 | public function iShouldBeRedirectedToTheAddressingStep() |
||
| 907 | |||
| 908 | /** |
||
| 909 | * @Then I should be able to go to the shipping step again |
||
| 910 | */ |
||
| 911 | public function iShouldBeAbleToGoToTheShippingStepAgain() |
||
| 920 | |||
| 921 | /** |
||
| 922 | * @Then I should be able to go to the complete step again |
||
| 923 | */ |
||
| 924 | public function iShouldBeAbleToGoToTheCompleteStepAgain() |
||
| 930 | |||
| 931 | /** |
||
| 932 | * @Then I should be redirected to the shipping step |
||
| 933 | */ |
||
| 934 | public function iShouldBeRedirectedToTheShippingStep() |
||
| 941 | |||
| 942 | /** |
||
| 943 | * @Given I should be able to go to the payment step again |
||
| 944 | */ |
||
| 945 | public function iShouldBeAbleToGoToThePaymentStepAgain() |
||
| 954 | |||
| 955 | /** |
||
| 956 | * @Then I should be redirected to the payment step |
||
| 957 | */ |
||
| 958 | public function iShouldBeRedirectedToThePaymentStep() |
||
| 965 | |||
| 966 | /** |
||
| 967 | * @Given I should be able to go to the summary page again |
||
| 968 | */ |
||
| 969 | public function iShouldBeAbleToGoToTheSummaryPageAgain() |
||
| 978 | |||
| 979 | /** |
||
| 980 | * @Given I should see shipping method :shippingMethodName with fee :fee |
||
| 981 | */ |
||
| 982 | public function iShouldSeeShippingFee($shippingMethodName, $fee) |
||
| 989 | |||
| 990 | /** |
||
| 991 | * @Given /^I have completed addressing step with email "([^"]+)" and ("[^"]+" based shipping address)$/ |
||
| 992 | * @When /^I complete addressing step with email "([^"]+)" and ("[^"]+" based shipping address)$/ |
||
| 993 | */ |
||
| 994 | public function iCompleteAddressingStepWithEmail($email, AddressInterface $address) |
||
| 1001 | |||
| 1002 | /** |
||
| 1003 | * @Then the subtotal of :item item should be :price |
||
| 1004 | */ |
||
| 1005 | public function theSubtotalOfItemShouldBe($item, $price) |
||
| 1016 | |||
| 1017 | /** |
||
| 1018 | * @Then the :product product should have unit price :price |
||
| 1019 | */ |
||
| 1020 | public function theProductShouldHaveUnitPrice(ProductInterface $product, $price) |
||
| 1027 | |||
| 1028 | /** |
||
| 1029 | * @Given /^I should be notified that (this product) does not have sufficient stock$/ |
||
| 1030 | */ |
||
| 1031 | public function iShouldBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product) |
||
| 1038 | |||
| 1039 | /** |
||
| 1040 | * @Then my order's locale should be :localeName |
||
| 1041 | */ |
||
| 1042 | public function myOrderSLocaleShouldBe($localeName) |
||
| 1049 | |||
| 1050 | /** |
||
| 1051 | * @Then /^I should not be notified that (this product) does not have sufficient stock$/ |
||
| 1052 | */ |
||
| 1053 | public function iShouldNotBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product) |
||
| 1060 | |||
| 1061 | /** |
||
| 1062 | * @Then I should be on the checkout addressing step |
||
| 1063 | */ |
||
| 1064 | public function iShouldBeOnTheCheckoutAddressingStep() |
||
| 1071 | |||
| 1072 | /** |
||
| 1073 | * @When I specify the province name manually as :provinceName for shipping address |
||
| 1074 | */ |
||
| 1075 | public function iSpecifyTheProvinceNameManuallyAsForShippingAddress($provinceName) |
||
| 1079 | |||
| 1080 | /** |
||
| 1081 | * @When I specify the province name manually as :provinceName for billing address |
||
| 1082 | */ |
||
| 1083 | public function iSpecifyTheProvinceNameManuallyAsForBillingAddress($provinceName) |
||
| 1087 | |||
| 1088 | /** |
||
| 1089 | * @Then I should not be able to specify province name manually for shipping address |
||
| 1090 | */ |
||
| 1091 | public function iShouldNotBeAbleToSpecifyProvinceNameManuallyForShippingAddress() |
||
| 1098 | |||
| 1099 | /** |
||
| 1100 | * @Then I should not be able to specify province name manually for billing address |
||
| 1101 | */ |
||
| 1102 | public function iShouldNotBeAbleToSpecifyProvinceNameManuallyForBillingAddress() |
||
| 1109 | |||
| 1110 | /** |
||
| 1111 | * @Then I should see :provinceName in the shipping address |
||
| 1112 | */ |
||
| 1113 | public function iShouldSeeInTheShippingAddress($provinceName) |
||
| 1120 | |||
| 1121 | /** |
||
| 1122 | * @Then I should see :provinceName in the billing address |
||
| 1123 | */ |
||
| 1124 | public function iShouldSeeInTheBillingAddress($provinceName) |
||
| 1131 | |||
| 1132 | /** |
||
| 1133 | * @Then there should be information about no available shipping methods |
||
| 1134 | */ |
||
| 1135 | public function thereShouldBeInformationAboutNoShippingMethodsAvailableForMyShippingAddress() |
||
| 1142 | |||
| 1143 | /** |
||
| 1144 | * @Then /^(address "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+") should be filled as shipping address$/ |
||
| 1145 | */ |
||
| 1146 | public function addressShouldBeFilledAsShippingAddress(AddressInterface $address) |
||
| 1150 | |||
| 1151 | /** |
||
| 1152 | * @Then /^(address "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+") should be filled as billing address$/ |
||
| 1153 | */ |
||
| 1154 | public function addressShouldBeFilledAsBillingAddress(AddressInterface $address) |
||
| 1158 | |||
| 1159 | /** |
||
| 1160 | * @Then I should have :paymentMethodName payment method available as the first choice |
||
| 1161 | */ |
||
| 1162 | public function iShouldHavePaymentMethodAvailableAsFirstChoice($paymentMethodName) |
||
| 1169 | |||
| 1170 | /** |
||
| 1171 | * @Then I should have :paymentMethodName payment method available as the last choice |
||
| 1172 | */ |
||
| 1173 | public function iShouldHavePaymentMethodAvailableAsLastChoice($paymentMethodName) |
||
| 1180 | |||
| 1181 | /** |
||
| 1182 | * @Then I should see :shippingMethodName shipping method |
||
| 1183 | */ |
||
| 1184 | public function iShouldSeeShippingMethod($shippingMethodName) |
||
| 1191 | |||
| 1192 | /** |
||
| 1193 | * @Then I should not see :shippingMethodName shipping method |
||
| 1194 | */ |
||
| 1195 | public function iShouldNotSeeShippingMethod($shippingMethodName) |
||
| 1202 | |||
| 1203 | /** |
||
| 1204 | * @Then I should be checking out as :email |
||
| 1205 | */ |
||
| 1206 | public function iShouldBeCheckingOutAs($email) |
||
| 1213 | |||
| 1214 | /** |
||
| 1215 | * @Then I should not see any information about payment method |
||
| 1216 | */ |
||
| 1217 | public function iShouldNotSeeAnyInformationAboutPaymentMethod() |
||
| 1224 | |||
| 1225 | /** |
||
| 1226 | * @Then /^(this promotion) should give "([^"]+)" discount$/ |
||
| 1227 | */ |
||
| 1228 | public function thisPromotionShouldGiveDiscount(PromotionInterface $promotion, $discount) |
||
| 1235 | |||
| 1236 | /** |
||
| 1237 | * @return AddressInterface |
||
| 1238 | */ |
||
| 1239 | private function createDefaultAddress() |
||
| 1253 | |||
| 1254 | /** |
||
| 1255 | * @param string $type |
||
| 1256 | * @param string $element |
||
| 1257 | * @param string $expectedMessage |
||
| 1258 | * |
||
| 1259 | * @throws \InvalidArgumentException |
||
| 1260 | */ |
||
| 1261 | private function assertElementValidationMessage($type, $element, $expectedMessage) |
||
| 1269 | |||
| 1270 | /** |
||
| 1271 | * @return SymfonyPageInterface |
||
| 1272 | */ |
||
| 1273 | private function resolveCurrentStepPage() |
||
| 1284 | } |
||
| 1285 |