1 | <?php |
||
23 | class ManagingShippingCategoriesContext implements Context |
||
24 | { |
||
25 | /** @var IndexPageInterface */ |
||
26 | private $indexPage; |
||
27 | |||
28 | /** @var CreatePageInterface */ |
||
29 | private $createPage; |
||
30 | |||
31 | /** @var UpdatePageInterface */ |
||
32 | private $updatePage; |
||
33 | |||
34 | public function __construct( |
||
43 | |||
44 | /** |
||
45 | * @Given I want to create a new shipping category |
||
46 | */ |
||
47 | public function iWantToCreateANewShippingCategory() |
||
51 | |||
52 | /** |
||
53 | * @When /^I browse shipping categories$/ |
||
54 | */ |
||
55 | public function iWantToBrowseShippingCategories() |
||
59 | |||
60 | /** |
||
61 | * @Then I should see a single shipping category in the list |
||
62 | * @Then I should see :numberOfShippingCategories shipping categories in the list |
||
63 | */ |
||
64 | public function iShouldSeeShippingCategoriesInTheList(int $numberOfShippingCategories = 1): void |
||
68 | |||
69 | /** |
||
70 | * @When I specify its description as :shippingCategoryDescription |
||
71 | */ |
||
72 | public function iSpecifyItsDescriptionAs($shippingCategoryDescription) |
||
76 | |||
77 | /** |
||
78 | * @When I add it |
||
79 | * @When I try to add it |
||
80 | */ |
||
81 | public function iAddIt() |
||
85 | |||
86 | /** |
||
87 | * @Then I should be notified that :element is required |
||
88 | */ |
||
89 | public function iShouldBeNotifiedThatCodeIsRequired($element) |
||
96 | |||
97 | /** |
||
98 | * @When I do not specify its code |
||
99 | * @When I specify its code as :shippingCategoryCode |
||
100 | */ |
||
101 | public function iSpecifyItsCodeAs($shippingCategoryCode = null) |
||
105 | |||
106 | /** |
||
107 | * @When I name it :shippingCategoryName |
||
108 | * @When I do not specify its name |
||
109 | */ |
||
110 | public function iNameIt($shippingCategoryName = null) |
||
114 | |||
115 | /** |
||
116 | * @Then I should see the shipping category :shippingCategoryName in the list |
||
117 | */ |
||
118 | public function iShouldSeeTheShippingCategoryInTheList(string $shippingCategoryName): void |
||
122 | |||
123 | /** |
||
124 | * @Then /^the (shipping category "([^"]+)") should be in the registry$/ |
||
125 | * @Then /^the (shipping category "([^"]+)") should appear in the registry$/ |
||
126 | */ |
||
127 | public function theShippingCategoryShouldAppearInTheRegistry(ShippingCategoryInterface $shippingCategory) |
||
133 | |||
134 | /** |
||
135 | * @When I delete shipping category :shippingCategoryName |
||
136 | */ |
||
137 | public function iDeleteShippingCategory($shippingCategoryName) |
||
142 | |||
143 | /** |
||
144 | * @Then /^(this shipping category) should no longer exist in the registry$/ |
||
145 | */ |
||
146 | public function thisShippingCategoryShouldNoLongerExistInTheRegistry(ShippingCategoryInterface $shippingCategory) |
||
150 | |||
151 | /** |
||
152 | * @Then shipping category with name :shippingCategoryName should not be added |
||
153 | */ |
||
154 | public function shippingCategoryWithNameShouldNotBeAdded($shippingCategoryName) |
||
158 | |||
159 | /** |
||
160 | * @When /^I modify a (shipping category "([^"]+)")$/ |
||
161 | * @Given /^I want to modify a (shipping category "([^"]+)")$/ |
||
162 | */ |
||
163 | public function iWantToModifyAShippingCategory(ShippingCategoryInterface $shippingCategory) |
||
167 | |||
168 | /** |
||
169 | * @When I rename it to :name |
||
170 | */ |
||
171 | public function iNameItIn($name) |
||
175 | |||
176 | /** |
||
177 | * @When I save my changes |
||
178 | */ |
||
179 | public function iSaveMyChanges() |
||
183 | |||
184 | /** |
||
185 | * @When I check (also) the :shippingCategoryName shipping category |
||
186 | */ |
||
187 | public function iCheckTheShippingCategory(string $shippingCategoryName): void |
||
191 | |||
192 | /** |
||
193 | * @When I delete them |
||
194 | */ |
||
195 | public function iDeleteThem(): void |
||
199 | |||
200 | /** |
||
201 | * @Then I should not be able to edit its code |
||
202 | */ |
||
203 | public function iShouldNotBeAbleToEditItsCode(): void |
||
204 | { |
||
205 | Assert::true($this->updatePage->isCodeDisabled()); |
||
206 | } |
||
207 | |||
208 | /** |
||
209 | * @Then this shipping category name should be :shippingCategoryName |
||
210 | */ |
||
211 | public function thisShippingCategoryNameShouldBe($shippingCategoryName) |
||
215 | |||
216 | /** |
||
217 | * @Then I should be notified that shipping category with this code already exists |
||
218 | */ |
||
219 | public function iShouldBeNotifiedThatShippingCategoryWithThisCodeAlreadyExists() |
||
226 | |||
227 | /** |
||
228 | * @Then there should still be only one shipping category with code :code |
||
229 | */ |
||
230 | public function thereShouldStillBeOnlyOneShippingCategoryWith($code) |
||
236 | } |
||
237 |