1 | <?php |
||
24 | class ManagingShippingCategoriesContext implements Context |
||
25 | { |
||
26 | /** |
||
27 | * @var IndexPageInterface |
||
28 | */ |
||
29 | private $indexPage; |
||
30 | |||
31 | /** |
||
32 | * @var CreatePageInterface |
||
33 | */ |
||
34 | private $createPage; |
||
35 | |||
36 | /** |
||
37 | * @var UpdatePageInterface |
||
38 | */ |
||
39 | private $updatePage; |
||
40 | |||
41 | |||
42 | /** |
||
43 | * @param IndexPageInterface $indexPage |
||
44 | * @param CreatePageInterface $createPage |
||
45 | * @param UpdatePageInterface $updatePage |
||
46 | */ |
||
47 | public function __construct( |
||
56 | |||
57 | /** |
||
58 | * @Given I want to create a new shipping category |
||
59 | */ |
||
60 | public function iWantToCreateANewShippingCategory() |
||
64 | |||
65 | /** |
||
66 | * @When /^I browse shipping categories$/ |
||
67 | */ |
||
68 | public function iWantToBrowseShippingCategories() |
||
72 | |||
73 | /** |
||
74 | * @Then I should see :numberOfShippingCategories shipping categories in the list |
||
75 | */ |
||
76 | public function iShouldSeeShippingCategoriesInTheList($numberOfShippingCategories) |
||
85 | |||
86 | /** |
||
87 | * @When I specify its description as :shippingCategoryDescription |
||
88 | */ |
||
89 | public function iSpecifyItsDescriptionAs($shippingCategoryDescription) |
||
93 | |||
94 | /** |
||
95 | * @When I add it |
||
96 | * @When I try to add it |
||
97 | */ |
||
98 | public function iAddIt() |
||
102 | |||
103 | /** |
||
104 | * @Then I should be notified that :element is required |
||
105 | */ |
||
106 | public function iShouldBeNotifiedThatCodeIsRequired($element) |
||
113 | |||
114 | /** |
||
115 | * @When I do not specify its code |
||
116 | * @When I specify its code as :shippingCategoryCode |
||
117 | */ |
||
118 | public function iSpecifyItsCodeAs($shippingCategoryCode = null) |
||
122 | |||
123 | /** |
||
124 | * @When I name it :shippingCategoryName |
||
125 | * @When I do not specify its name |
||
126 | */ |
||
127 | public function iNameIt($shippingCategoryName = null) |
||
131 | |||
132 | /** |
||
133 | * @Then /^the (shipping category "([^"]+)") should be in the registry$/ |
||
134 | * @Then /^the (shipping category "([^"]+)") should appear in the registry$/ |
||
135 | */ |
||
136 | public function theShippingCategoryShouldAppearInTheRegistry(ShippingCategoryInterface $shippingCategory) |
||
145 | |||
146 | /** |
||
147 | * @When I delete shipping category :shippingCategoryName |
||
148 | */ |
||
149 | public function iDeleteShippingCategory($shippingCategoryName) |
||
154 | |||
155 | /** |
||
156 | * @Then /^(this shipping category) should no longer exist in the registry$/ |
||
157 | */ |
||
158 | public function thisShippingCategoryShouldNoLongerExistInTheRegistry(ShippingCategoryInterface $shippingCategory) |
||
165 | |||
166 | /** |
||
167 | * @Then shipping category with name :shippingCategoryName should not be added |
||
168 | */ |
||
169 | public function shippingCategoryWithNameShouldNotBeAdded($shippingCategoryName) |
||
176 | |||
177 | /** |
||
178 | * @When /^I modify a (shipping category "([^"]+)")$/ |
||
179 | * @Given /^I want to modify a (shipping category "([^"]+)")$/ |
||
180 | */ |
||
181 | public function iWantToModifyAShippingCategory(ShippingCategoryInterface $shippingCategory) |
||
185 | |||
186 | /** |
||
187 | * @When I rename it to :name |
||
188 | */ |
||
189 | public function iNameItIn($name) |
||
193 | |||
194 | /** |
||
195 | * @When I save my changes |
||
196 | */ |
||
197 | public function iSaveMyChanges() |
||
201 | |||
202 | /** |
||
203 | * @Then the code field should be disabled |
||
204 | */ |
||
205 | public function theCodeFieldShouldBeDisabled() |
||
212 | |||
213 | /** |
||
214 | * @Then this shipping category name should be :shippingCategoryName |
||
215 | */ |
||
216 | public function thisShippingCategoryNameShouldBe($shippingCategoryName) |
||
223 | |||
224 | /** |
||
225 | * @Then I should be notified that shipping category with this code already exists |
||
226 | */ |
||
227 | public function iShouldBeNotifiedThatShippingCategoryWithThisCodeAlreadyExists() |
||
234 | |||
235 | /** |
||
236 | * @Then there should still be only one shipping category with code :code |
||
237 | */ |
||
238 | public function thereShouldStillBeOnlyOneShippingCategoryWith($code) |
||
247 | } |
||
248 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.