Complex classes like ManagingProductsContext 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 ManagingProductsContext, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 39 | final class ManagingProductsContext implements Context |
||
| 40 | { |
||
| 41 | /** @var SharedStorageInterface */ |
||
| 42 | private $sharedStorage; |
||
| 43 | |||
| 44 | /** @var CreateSimpleProductPageInterface */ |
||
| 45 | private $createSimpleProductPage; |
||
| 46 | |||
| 47 | /** @var CreateConfigurableProductPageInterface */ |
||
| 48 | private $createConfigurableProductPage; |
||
| 49 | |||
| 50 | /** @var IndexPageInterface */ |
||
| 51 | private $indexPage; |
||
| 52 | |||
| 53 | /** @var UpdateSimpleProductPageInterface */ |
||
| 54 | private $updateSimpleProductPage; |
||
| 55 | |||
| 56 | /** @var UpdateConfigurableProductPageInterface */ |
||
| 57 | private $updateConfigurableProductPage; |
||
| 58 | |||
| 59 | /** @var ProductReviewIndexPageInterface */ |
||
| 60 | private $productReviewIndexPage; |
||
| 61 | |||
| 62 | /** @var IndexPerTaxonPageInterface */ |
||
| 63 | private $indexPerTaxonPage; |
||
| 64 | |||
| 65 | /** @var VariantCreatePageInterface */ |
||
| 66 | private $variantCreatePage; |
||
| 67 | |||
| 68 | /** @var GeneratePageInterface */ |
||
| 69 | private $variantGeneratePage; |
||
| 70 | |||
| 71 | /** @var CurrentPageResolverInterface */ |
||
| 72 | private $currentPageResolver; |
||
| 73 | |||
| 74 | /** @var NotificationCheckerInterface */ |
||
| 75 | private $notificationChecker; |
||
| 76 | |||
| 77 | public function __construct( |
||
| 104 | |||
| 105 | /** |
||
| 106 | * @Given I want to create a new simple product |
||
| 107 | */ |
||
| 108 | public function iWantToCreateANewSimpleProduct() |
||
| 112 | |||
| 113 | /** |
||
| 114 | * @Given I want to create a new configurable product |
||
| 115 | */ |
||
| 116 | public function iWantToCreateANewConfigurableProduct() |
||
| 120 | |||
| 121 | /** |
||
| 122 | * @When I specify its code as :code |
||
| 123 | * @When I do not specify its code |
||
| 124 | */ |
||
| 125 | public function iSpecifyItsCodeAs($code = null) |
||
| 131 | |||
| 132 | /** |
||
| 133 | * @When I name it :name in :language |
||
| 134 | * @When I rename it to :name in :language |
||
| 135 | */ |
||
| 136 | public function iRenameItToIn($name, $language) |
||
| 142 | |||
| 143 | /** |
||
| 144 | * @When I add it |
||
| 145 | * @When I try to add it |
||
| 146 | */ |
||
| 147 | public function iAddIt() |
||
| 154 | |||
| 155 | /** |
||
| 156 | * @When I disable its inventory tracking |
||
| 157 | */ |
||
| 158 | public function iDisableItsTracking() |
||
| 162 | |||
| 163 | /** |
||
| 164 | * @When I enable its inventory tracking |
||
| 165 | */ |
||
| 166 | public function iEnableItsTracking() |
||
| 170 | |||
| 171 | /** |
||
| 172 | * @When /^I set its(?:| default) price to "(?:€|£|\$)([^"]+)" for "([^"]+)" channel$/ |
||
| 173 | */ |
||
| 174 | public function iSetItsPriceTo(string $price, string $channelName) |
||
| 178 | |||
| 179 | /** |
||
| 180 | * @When /^I set its original price to "(?:€|£|\$)([^"]+)" for "([^"]+)" channel$/ |
||
| 181 | */ |
||
| 182 | public function iSetItsOriginalPriceTo(int $originalPrice, $channelName) |
||
| 186 | |||
| 187 | /** |
||
| 188 | * @When I make it available in channel :channel |
||
| 189 | */ |
||
| 190 | public function iMakeItAvailableInChannel(ChannelInterface $channel) |
||
| 194 | |||
| 195 | /** |
||
| 196 | * @When I assign it to channel :channel |
||
| 197 | */ |
||
| 198 | public function iAssignItToChannel(ChannelInterface $channel) |
||
| 203 | |||
| 204 | /** |
||
| 205 | * @When I choose :calculatorName calculator |
||
| 206 | */ |
||
| 207 | public function iChooseCalculator($calculatorName) |
||
| 211 | |||
| 212 | /** |
||
| 213 | * @When I set its slug to :slug |
||
| 214 | * @When I set its slug to :slug in :language |
||
| 215 | * @When I remove its slug |
||
| 216 | */ |
||
| 217 | public function iSetItsSlugToIn(?string $slug = null, $language = 'en_US') |
||
| 221 | |||
| 222 | /** |
||
| 223 | * @When I choose to show this product in the :channel channel |
||
| 224 | */ |
||
| 225 | public function iChooseToShowThisProductInTheChannel(string $channel): void |
||
| 229 | |||
| 230 | /** |
||
| 231 | * @When I choose to show this product in this channel |
||
| 232 | */ |
||
| 233 | public function iChooseToShowThisProductInThisChannel(): void |
||
| 237 | |||
| 238 | /** |
||
| 239 | * @When I enable slug modification |
||
| 240 | * @When I enable slug modification in :localeCode |
||
| 241 | */ |
||
| 242 | public function iEnableSlugModification($localeCode = 'en_US') |
||
| 247 | |||
| 248 | /** |
||
| 249 | * @Then I should see the product :productName in the list |
||
| 250 | * @Then the product :productName should appear in the store |
||
| 251 | * @Then the product :productName should be in the shop |
||
| 252 | * @Then this product should still be named :productName |
||
| 253 | */ |
||
| 254 | public function theProductShouldAppearInTheShop(string $productName): void |
||
| 260 | |||
| 261 | /** |
||
| 262 | * @Given I am browsing products |
||
| 263 | * @When I browse products |
||
| 264 | * @When I want to browse products |
||
| 265 | */ |
||
| 266 | public function iWantToBrowseProducts() |
||
| 270 | |||
| 271 | /** |
||
| 272 | * @When /^I am browsing products from ("([^"]+)" taxon)$/ |
||
| 273 | */ |
||
| 274 | public function iAmBrowsingProductsFromTaxon(TaxonInterface $taxon) |
||
| 278 | |||
| 279 | /** |
||
| 280 | * @When I filter them by :taxonName taxon |
||
| 281 | */ |
||
| 282 | public function iFilterThemByTaxon($taxonName) |
||
| 286 | |||
| 287 | /** |
||
| 288 | * @When I check (also) the :productName product |
||
| 289 | */ |
||
| 290 | public function iCheckTheProduct(string $productName): void |
||
| 294 | |||
| 295 | /** |
||
| 296 | * @When I delete them |
||
| 297 | */ |
||
| 298 | public function iDeleteThem(): void |
||
| 302 | |||
| 303 | /** |
||
| 304 | * @Then I should( still) see a product with :field :value |
||
| 305 | */ |
||
| 306 | public function iShouldSeeProductWith($field, $value) |
||
| 310 | |||
| 311 | /** |
||
| 312 | * @Then I should not see any product with :field :value |
||
| 313 | */ |
||
| 314 | public function iShouldNotSeeAnyProductWith($field, $value) |
||
| 318 | |||
| 319 | /** |
||
| 320 | * @Then the first product on the list should have :field :value |
||
| 321 | */ |
||
| 322 | public function theFirstProductOnTheListShouldHave($field, $value) |
||
| 328 | |||
| 329 | /** |
||
| 330 | * @Then the last product on the list should have :field :value |
||
| 331 | */ |
||
| 332 | public function theLastProductOnTheListShouldHave($field, $value) |
||
| 338 | |||
| 339 | /** |
||
| 340 | * @When I switch the way products are sorted by :field |
||
| 341 | * @When I start sorting products by :field |
||
| 342 | * @Given the products are already sorted by :field |
||
| 343 | */ |
||
| 344 | public function iSortProductsBy($field) |
||
| 348 | |||
| 349 | /** |
||
| 350 | * @Then I should see a single product in the list |
||
| 351 | * @Then I should see :numberOfProducts products in the list |
||
| 352 | */ |
||
| 353 | public function iShouldSeeProductsInTheList(int $numberOfProducts = 1): void |
||
| 357 | |||
| 358 | /** |
||
| 359 | * @When I delete the :product product |
||
| 360 | * @When I try to delete the :product product |
||
| 361 | */ |
||
| 362 | public function iDeleteProduct(ProductInterface $product) |
||
| 369 | |||
| 370 | /** |
||
| 371 | * @Then /^(this product) should not exist in the product catalog$/ |
||
| 372 | */ |
||
| 373 | public function productShouldNotExist(ProductInterface $product) |
||
| 379 | |||
| 380 | /** |
||
| 381 | * @Then I should be notified that this product is in use and cannot be deleted |
||
| 382 | */ |
||
| 383 | public function iShouldBeNotifiedOfFailure() |
||
| 390 | |||
| 391 | /** |
||
| 392 | * @Then /^(this product) should still exist in the product catalog$/ |
||
| 393 | */ |
||
| 394 | public function productShouldExistInTheProductCatalog(ProductInterface $product) |
||
| 398 | |||
| 399 | /** |
||
| 400 | * @When I want to modify the :product product |
||
| 401 | * @When /^I want to modify (this product)$/ |
||
| 402 | * @When I modify the :product product |
||
| 403 | */ |
||
| 404 | public function iWantToModifyAProduct(ProductInterface $product): void |
||
| 416 | |||
| 417 | /** |
||
| 418 | * @Then the code field should be disabled |
||
| 419 | */ |
||
| 420 | public function theCodeFieldShouldBeDisabled() |
||
| 426 | |||
| 427 | /** |
||
| 428 | * @Then the slug field should not be editable |
||
| 429 | * @Then the slug field in :localeCode (also )should not be editable |
||
| 430 | */ |
||
| 431 | public function theSlugFieldShouldNotBeEditable($localeCode = 'en_US') |
||
| 435 | |||
| 436 | /** |
||
| 437 | * @Then this product name should be :name |
||
| 438 | */ |
||
| 439 | public function thisProductElementShouldBe($name) |
||
| 443 | |||
| 444 | /** |
||
| 445 | * @Then /^I should be notified that (code|name|slug) is required$/ |
||
| 446 | */ |
||
| 447 | public function iShouldBeNotifiedThatIsRequired($element) |
||
| 451 | |||
| 452 | /** |
||
| 453 | * @When I save my changes |
||
| 454 | * @When I try to save my changes |
||
| 455 | */ |
||
| 456 | public function iSaveMyChanges() |
||
| 462 | |||
| 463 | /** |
||
| 464 | * @When /^I change its price to (?:€|£|\$)([^"]+) for "([^"]+)" channel$/ |
||
| 465 | */ |
||
| 466 | public function iChangeItsPriceTo(string $price, $channelName) |
||
| 470 | |||
| 471 | /** |
||
| 472 | * @When /^I change its original price to "(?:€|£|\$)([^"]+)" for "([^"]+)" channel$/ |
||
| 473 | */ |
||
| 474 | public function iChangeItsOriginalPriceTo(string $price, $channelName) |
||
| 478 | |||
| 479 | /** |
||
| 480 | * @Given I add the :optionName option to it |
||
| 481 | */ |
||
| 482 | public function iAddTheOptionToIt($optionName) |
||
| 486 | |||
| 487 | /** |
||
| 488 | * @When I set its :attribute attribute to :value |
||
| 489 | * @When I set its :attribute attribute to :value in :language |
||
| 490 | * @When I do not set its :attribute attribute in :language |
||
| 491 | */ |
||
| 492 | public function iSetItsAttributeTo($attribute, $value = null, $language = 'en_US') |
||
| 496 | |||
| 497 | /** |
||
| 498 | * @When I remove its :attribute attribute |
||
| 499 | * @When I remove its :attribute attribute from :language |
||
| 500 | */ |
||
| 501 | public function iRemoveItsAttribute($attribute, $language = 'en_US') |
||
| 505 | |||
| 506 | /** |
||
| 507 | * @When I try to add new attributes |
||
| 508 | */ |
||
| 509 | public function iTryToAddNewAttributes() |
||
| 513 | |||
| 514 | /** |
||
| 515 | * @When I do not want to have shipping required for this product |
||
| 516 | */ |
||
| 517 | public function iDoNotWantToHaveShippingRequiredForThisProduct() |
||
| 521 | |||
| 522 | /** |
||
| 523 | * @Then attribute :attributeName of product :product should be :value |
||
| 524 | * @Then attribute :attributeName of product :product should be :value in :language |
||
| 525 | */ |
||
| 526 | public function itsAttributeShouldBe($attributeName, ProductInterface $product, $value, $language = 'en_US') |
||
| 532 | |||
| 533 | /** |
||
| 534 | * @Then /^(product "[^"]+") should not have a "([^"]+)" attribute$/ |
||
| 535 | */ |
||
| 536 | public function productShouldNotHaveAttribute(ProductInterface $product, $attribute) |
||
| 542 | |||
| 543 | /** |
||
| 544 | * @Then /^product "[^"]+" should not have any attributes$/ |
||
| 545 | * @Then /^product "[^"]+" should have (\d+) attributes?$/ |
||
| 546 | */ |
||
| 547 | public function productShouldNotHaveAnyAttributes($count = 0) |
||
| 551 | |||
| 552 | /** |
||
| 553 | * @Given product with :element :value should not be added |
||
| 554 | */ |
||
| 555 | public function productWithNameShouldNotBeAdded($element, $value) |
||
| 561 | |||
| 562 | /** |
||
| 563 | * @When I remove its name from :language translation |
||
| 564 | */ |
||
| 565 | public function iRemoveItsNameFromTranslation($language) |
||
| 571 | |||
| 572 | /** |
||
| 573 | * @Then /^this product should have (?:a|an) "([^"]+)" option$/ |
||
| 574 | */ |
||
| 575 | public function thisProductShouldHaveOption($productOption) |
||
| 579 | |||
| 580 | /** |
||
| 581 | * @Then the option field should be disabled |
||
| 582 | */ |
||
| 583 | public function theOptionFieldShouldBeDisabled() |
||
| 587 | |||
| 588 | /** |
||
| 589 | * @When /^I choose main (taxon "[^"]+")$/ |
||
| 590 | */ |
||
| 591 | public function iChooseMainTaxon(TaxonInterface $taxon) |
||
| 597 | |||
| 598 | /** |
||
| 599 | * @Then /^the slug of the ("[^"]+" product) should(?:| still) be "([^"]+)"$/ |
||
| 600 | * @Then /^the slug of the ("[^"]+" product) should(?:| still) be "([^"]+)" (in the "[^"]+" locale)$/ |
||
| 601 | */ |
||
| 602 | public function productSlugShouldBe(ProductInterface $product, $slug, $locale = 'en_US') |
||
| 608 | |||
| 609 | /** |
||
| 610 | * @Then /^(this product) main taxon should be "([^"]+)"$/ |
||
| 611 | * @Then /^main taxon of (product "[^"]+") should be "([^"]+)"$/ |
||
| 612 | */ |
||
| 613 | public function thisProductMainTaxonShouldBe(ProductInterface $product, $taxonName) |
||
| 620 | |||
| 621 | /** |
||
| 622 | * @Then /^inventory of (this product) should not be tracked$/ |
||
| 623 | */ |
||
| 624 | public function thisProductShouldNotBeTracked(ProductInterface $product) |
||
| 630 | |||
| 631 | /** |
||
| 632 | * @Then /^inventory of (this product) should be tracked$/ |
||
| 633 | */ |
||
| 634 | public function thisProductShouldBeTracked(ProductInterface $product) |
||
| 640 | |||
| 641 | /** |
||
| 642 | * @When I attach the :path image with :type type |
||
| 643 | * @When I attach the :path image |
||
| 644 | */ |
||
| 645 | public function iAttachImageWithType($path, $type = null) |
||
| 651 | |||
| 652 | /** |
||
| 653 | * @When I associate as :productAssociationType the :productName product |
||
| 654 | * @When I associate as :productAssociationType the :firstProductName and :secondProductName products |
||
| 655 | */ |
||
| 656 | public function iAssociateProductsAsProductAssociation( |
||
| 664 | |||
| 665 | /** |
||
| 666 | * @When I remove an associated product :productName from :productAssociationType |
||
| 667 | */ |
||
| 668 | public function iRemoveAnAssociatedProductFromProductAssociation( |
||
| 676 | |||
| 677 | /** |
||
| 678 | * @When I go to the variants list |
||
| 679 | */ |
||
| 680 | public function iGoToTheVariantsList(): void |
||
| 684 | |||
| 685 | /** |
||
| 686 | * @When I go to the variant creation page |
||
| 687 | */ |
||
| 688 | public function iGoToTheVariantCreationPage(): void |
||
| 692 | |||
| 693 | /** |
||
| 694 | * @When I go to the variant generation page |
||
| 695 | */ |
||
| 696 | public function iGoToTheVariantGenerationPage(): void |
||
| 700 | |||
| 701 | /** |
||
| 702 | * @Then /^(?:this product|the product "[^"]+"|it) should(?:| also) have an image with "([^"]*)" type$/ |
||
| 703 | */ |
||
| 704 | public function thisProductShouldHaveAnImageWithType($type) |
||
| 710 | |||
| 711 | /** |
||
| 712 | * @Then /^the (product "[^"]+") should still have an accessible image$/ |
||
| 713 | */ |
||
| 714 | public function productShouldStillHaveAnAccessibleImage(ProductInterface $product): void |
||
| 718 | |||
| 719 | /** |
||
| 720 | * @Then /^(?:this product|it)(?:| also) should not have any images with "([^"]*)" type$/ |
||
| 721 | */ |
||
| 722 | public function thisProductShouldNotHaveAnyImagesWithType($code) |
||
| 728 | |||
| 729 | /** |
||
| 730 | * @When I change the image with the :type type to :path |
||
| 731 | */ |
||
| 732 | public function iChangeItsImageToPathForTheType($type, $path) |
||
| 738 | |||
| 739 | /** |
||
| 740 | * @When /^I(?:| also) remove an image with "([^"]*)" type$/ |
||
| 741 | */ |
||
| 742 | public function iRemoveAnImageWithType($code) |
||
| 748 | |||
| 749 | /** |
||
| 750 | * @When I remove the first image |
||
| 751 | */ |
||
| 752 | public function iRemoveTheFirstImage() |
||
| 758 | |||
| 759 | /** |
||
| 760 | * @When I change the first image type to :type |
||
| 761 | */ |
||
| 762 | public function iChangeTheFirstImageTypeTo($type) |
||
| 768 | |||
| 769 | /** |
||
| 770 | * @Then /^(this product) should not have any images$/ |
||
| 771 | */ |
||
| 772 | public function thisProductShouldNotHaveImages(ProductInterface $product) |
||
| 780 | |||
| 781 | /** |
||
| 782 | * @Then /^(this product) should(?:| still) have (?:only one|(\d+)) images?$/ |
||
| 783 | */ |
||
| 784 | public function thereShouldStillBeOnlyOneImageInThisProduct(ProductInterface $product, $count = 1) |
||
| 792 | |||
| 793 | /** |
||
| 794 | * @Then /^there should be no reviews of (this product)$/ |
||
| 795 | */ |
||
| 796 | public function thereAreNoProductReviews(ProductInterface $product) |
||
| 802 | |||
| 803 | /** |
||
| 804 | * @Then this product should( also) have an association :productAssociationType with product :productName |
||
| 805 | * @Then this product should( also) have an association :productAssociationType with products :firstProductName and :secondProductName |
||
| 806 | */ |
||
| 807 | public function theProductShouldHaveAnAssociationWithProducts( |
||
| 822 | |||
| 823 | /** |
||
| 824 | * @Then this product should not have an association :productAssociationType with product :productName |
||
| 825 | */ |
||
| 826 | public function theProductShouldNotHaveAnAssociationWithProduct( |
||
| 832 | |||
| 833 | /** |
||
| 834 | * @Then I should be notified that simple product code has to be unique |
||
| 835 | */ |
||
| 836 | public function iShouldBeNotifiedThatSimpleProductCodeHasToBeUnique() |
||
| 840 | |||
| 841 | /** |
||
| 842 | * @Then I should be notified that slug has to be unique |
||
| 843 | */ |
||
| 844 | public function iShouldBeNotifiedThatSlugHasToBeUnique() |
||
| 848 | |||
| 849 | /** |
||
| 850 | * @Then I should be notified that code has to be unique |
||
| 851 | */ |
||
| 852 | public function iShouldBeNotifiedThatCodeHasToBeUnique() |
||
| 856 | |||
| 857 | /** |
||
| 858 | * @Then I should be notified that price must be defined for every channel |
||
| 859 | */ |
||
| 860 | public function iShouldBeNotifiedThatPriceMustBeDefinedForEveryChannel() |
||
| 864 | |||
| 865 | /** |
||
| 866 | * @Then they should have order like :firstProductName, :secondProductName and :thirdProductName |
||
| 867 | */ |
||
| 868 | public function theyShouldHaveOrderLikeAnd(...$productNames) |
||
| 872 | |||
| 873 | /** |
||
| 874 | * @When I save my new configuration |
||
| 875 | */ |
||
| 876 | public function iSaveMyNewConfiguration() |
||
| 880 | |||
| 881 | /** |
||
| 882 | * @When I set the position of :productName to :position |
||
| 883 | */ |
||
| 884 | public function iSetThePositionOfTo(string $productName, string $position): void |
||
| 888 | |||
| 889 | /** |
||
| 890 | * @When I remove its price for :channelName channel |
||
| 891 | */ |
||
| 892 | public function iRemoveItsPriceForChannel(string $channelName): void |
||
| 896 | |||
| 897 | /** |
||
| 898 | * @Then this product should( still) have slug :value in :language |
||
| 899 | */ |
||
| 900 | public function thisProductElementShouldHaveSlugIn($slug, $language) |
||
| 904 | |||
| 905 | /** |
||
| 906 | * @When I set its shipping category as :shippingCategoryName |
||
| 907 | */ |
||
| 908 | public function iSetItsShippingCategoryAs($shippingCategoryName) |
||
| 912 | |||
| 913 | /** |
||
| 914 | * @Then /^(it|this product) should be priced at (?:€|£|\$)([^"]+) for channel "([^"]+)"$/ |
||
| 915 | * @Then /^(product "[^"]+") should be priced at (?:€|£|\$)([^"]+) for channel "([^"]+)"$/ |
||
| 916 | */ |
||
| 917 | public function itShouldBePricedAtForChannel(ProductInterface $product, string $price, $channelName) |
||
| 923 | |||
| 924 | /** |
||
| 925 | * @Then /^(its|this products) original price should be "(?:€|£|\$)([^"]+)" for channel "([^"]+)"$/ |
||
| 926 | */ |
||
| 927 | public function itsOriginalPriceForChannel(ProductInterface $product, $originalPrice, $channelName) |
||
| 936 | |||
| 937 | /** |
||
| 938 | * @Then /^(this product) should no longer have price for channel "([^"]+)"$/ |
||
| 939 | */ |
||
| 940 | public function thisProductShouldNoLongerHavePriceForChannel(ProductInterface $product, $channelName) |
||
| 954 | |||
| 955 | /** |
||
| 956 | * @Then I should be notified that I have to define product variants' prices for newly assigned channels first |
||
| 957 | */ |
||
| 958 | public function iShouldBeNotifiedThatIHaveToDefineProductVariantsPricesForNewlyAssignedChannelsFirst() |
||
| 965 | |||
| 966 | /** |
||
| 967 | * @Then /^the (product "[^"]+") should not have shipping required$/ |
||
| 968 | */ |
||
| 969 | public function theProductWithCodeShouldNotHaveShippingRequired(ProductInterface $product) |
||
| 975 | |||
| 976 | /** |
||
| 977 | * @Then I should be notified that I have to define the :attribute attribute in :language |
||
| 978 | */ |
||
| 979 | public function iShouldBeNotifiedThatIHaveToDefineTheAttributeIn($attribute, $language) |
||
| 986 | |||
| 987 | /** |
||
| 988 | * @Then I should be notified that the :attribute attribute in :language should be longer than :number |
||
| 989 | */ |
||
| 990 | public function iShouldBeNotifiedThatTheAttributeInShouldBeLongerThan($attribute, $language, $number) |
||
| 997 | |||
| 998 | /** |
||
| 999 | * @Then /^I should be on the variant creation page for (this product)$/ |
||
| 1000 | */ |
||
| 1001 | public function iShouldBeOnTheVariantCreationPageForThisProduct(ProductInterface $product): void |
||
| 1005 | |||
| 1006 | /** |
||
| 1007 | * @Then /^I should be on the variant generation page for (this product)$/ |
||
| 1008 | */ |
||
| 1009 | public function iShouldBeOnTheVariantGenerationPageForThisProduct(ProductInterface $product): void |
||
| 1013 | |||
| 1014 | /** |
||
| 1015 | * @Then I should see inventory of this product |
||
| 1016 | */ |
||
| 1017 | public function iShouldSeeInventoryOfThisProduct(): void |
||
| 1021 | |||
| 1022 | /** |
||
| 1023 | * @Then I should not see inventory of this product |
||
| 1024 | */ |
||
| 1025 | public function iShouldNotSeeInventoryOfThisProduct(): void |
||
| 1029 | |||
| 1030 | /** |
||
| 1031 | * @Then I should be notified that the position :invalidPosition is invalid |
||
| 1032 | */ |
||
| 1033 | public function iShouldBeNotifiedThatThePositionIsInvalid(string $invalidPosition): void |
||
| 1040 | |||
| 1041 | /** |
||
| 1042 | * @Then I should not be able to show this product in shop |
||
| 1043 | */ |
||
| 1044 | public function iShouldNotBeAbleToShowThisProductInShop(): void |
||
| 1048 | |||
| 1049 | /** |
||
| 1050 | * @Then I should not have configured price for :channelName channel |
||
| 1051 | */ |
||
| 1052 | public function iShouldNotHaveConfiguredPriceForChannel(string $channelName): void |
||
| 1056 | |||
| 1057 | /** |
||
| 1058 | * @param string $element |
||
| 1059 | * @param string $value |
||
| 1060 | */ |
||
| 1061 | private function assertElementValue($element, $value) |
||
| 1073 | |||
| 1074 | /** |
||
| 1075 | * @param string $element |
||
| 1076 | * @param string $message |
||
| 1077 | */ |
||
| 1078 | private function assertValidationMessage($element, $message) |
||
| 1085 | |||
| 1086 | /** |
||
| 1087 | * @return IndexPageInterface|IndexPerTaxonPageInterface|CreateSimpleProductPageInterface|CreateConfigurableProductPageInterface|UpdateSimpleProductPageInterface|UpdateConfigurableProductPageInterface |
||
| 1088 | */ |
||
| 1089 | private function resolveCurrentPage() |
||
| 1100 | } |
||
| 1101 |
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: