1 | <?php |
||
25 | final class ManagingTaxonsContext implements Context |
||
26 | { |
||
27 | const RESOURCE_NAME = 'taxon'; |
||
28 | |||
29 | /** |
||
30 | * @var CreatePageInterface |
||
31 | */ |
||
32 | private $createPage; |
||
33 | |||
34 | /** |
||
35 | * @var UpdatePageInterface |
||
36 | */ |
||
37 | private $updatePage; |
||
38 | |||
39 | /** |
||
40 | * @var CurrentPageResolverInterface |
||
41 | */ |
||
42 | private $currentPageResolver; |
||
43 | |||
44 | /** |
||
45 | * @var NotificationCheckerInterface |
||
46 | */ |
||
47 | private $notificationChecker; |
||
48 | |||
49 | /** |
||
50 | * @param CreatePageInterface $createPage |
||
51 | * @param UpdatePageInterface $updatePage |
||
52 | * @param CurrentPageResolverInterface $currentPageResolver |
||
53 | * @param NotificationCheckerInterface $notificationChecker |
||
54 | */ |
||
55 | public function __construct( |
||
66 | |||
67 | /** |
||
68 | * @Given I want to create a new taxon |
||
69 | * @Given I want to see all taxons in store |
||
70 | */ |
||
71 | public function iWantToCreateANewTaxon() |
||
75 | |||
76 | /** |
||
77 | * @Given /^I want to modify the ("[^"]+" taxon)$/ |
||
78 | */ |
||
79 | public function iWantToModifyATaxon(TaxonInterface $taxon) |
||
83 | |||
84 | /** |
||
85 | * @When I specify its code as :code |
||
86 | */ |
||
87 | public function iSpecifyItsCodeAs($code) |
||
91 | |||
92 | /** |
||
93 | * @When I name it :name in :language |
||
94 | */ |
||
95 | public function iNameItIn($name, $language) |
||
99 | |||
100 | /** |
||
101 | * @When I rename it to :name in :language |
||
102 | */ |
||
103 | public function iRenameItIn($name, $language) |
||
107 | |||
108 | /** |
||
109 | * @When I change its description to :description in :language |
||
110 | */ |
||
111 | public function iChangeItsDescriptionToIn($description, $language) |
||
115 | |||
116 | /** |
||
117 | * @When I specify its permalink as :permalink in :language |
||
118 | */ |
||
119 | public function iSpecifyItsPermalinkAs($permalink, $language) |
||
123 | |||
124 | /** |
||
125 | * @When I change its permalink to :permalink in :language |
||
126 | */ |
||
127 | public function iChangeItsPermalinkToIn($permalink, $language) |
||
131 | |||
132 | /** |
||
133 | * @When I describe it as :description in :language |
||
134 | */ |
||
135 | public function iDescribeItAs($description, $language) |
||
139 | |||
140 | /** |
||
141 | * @Given /^I choose ("[^"]+" as a parent taxon)$/ |
||
142 | */ |
||
143 | public function iChooseAsAParentTaxon(TaxonInterface $taxon) |
||
147 | |||
148 | /** |
||
149 | * @Given /^I change its (parent taxon to "[^"]+")$/ |
||
150 | */ |
||
151 | public function iChangeItsParentTaxonTo(TaxonInterface $taxon) |
||
155 | |||
156 | /** |
||
157 | * @When I do not specify its code |
||
158 | */ |
||
159 | public function iDoNotSpecifyItsCode() |
||
163 | |||
164 | /** |
||
165 | * @When I do not specify its name |
||
166 | */ |
||
167 | public function iDoNotSpecifyItsName() |
||
171 | |||
172 | /** |
||
173 | * @When I delete taxon named :name |
||
174 | */ |
||
175 | public function iDeleteTaxonNamed($name) |
||
180 | |||
181 | /** |
||
182 | * @When I add it |
||
183 | * @When I try to add it |
||
184 | */ |
||
185 | public function iAddIt() |
||
189 | |||
190 | /** |
||
191 | * @When I save my changes |
||
192 | * @When I try to save my changes |
||
193 | */ |
||
194 | public function iSaveMyChanges() |
||
198 | |||
199 | /** |
||
200 | * @Then I should be notified that it has been successfully created |
||
201 | */ |
||
202 | public function iShouldBeNotifiedItHasBeenSuccessfullyCreated() |
||
206 | |||
207 | /** |
||
208 | * @Then I should be notified that it has been successfully edited |
||
209 | */ |
||
210 | public function iShouldBeNotifiedThatItHasBeenSuccessfullyEdited() |
||
214 | |||
215 | /** |
||
216 | * @Then I should be notified that it has been successfully deleted |
||
217 | */ |
||
218 | public function iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted() |
||
222 | |||
223 | /** |
||
224 | * @Then /^the ("[^"]+" taxon) should appear in the registry$/ |
||
225 | */ |
||
226 | public function theTaxonShouldAppearInTheRegistry(TaxonInterface $taxon) |
||
234 | |||
235 | /** |
||
236 | * @Then this taxon :element should be :value |
||
237 | */ |
||
238 | public function thisTaxonElementShouldBe($element, $value) |
||
245 | |||
246 | /** |
||
247 | * @Then the code field should be disabled |
||
248 | */ |
||
249 | public function theCodeFieldShouldBeDisabled() |
||
256 | |||
257 | /** |
||
258 | * @Then /^this taxon should (belongs to "[^"]+")$/ |
||
259 | */ |
||
260 | public function thisTaxonShouldBelongsTo(TaxonInterface $taxon) |
||
267 | |||
268 | /** |
||
269 | * @Then I should be notified that taxon with this code already exists |
||
270 | */ |
||
271 | public function iShouldBeNotifiedThatTaxonWithThisCodeAlreadyExists() |
||
280 | |||
281 | /** |
||
282 | * @Then I should be notified that :element is required |
||
283 | */ |
||
284 | public function iShouldBeNotifiedThatIsRequired($element) |
||
293 | |||
294 | /** |
||
295 | * @Then /^there should still be only one taxon with code "([^"]+)"$/ |
||
296 | */ |
||
297 | public function thereShouldStillBeOnlyOneTaxonWithCode($code) |
||
304 | |||
305 | /** |
||
306 | * @Then /^Taxon named "([^"]+)" should not be added$/ |
||
307 | * @Then the taxon named :name should no longer exist in the registry |
||
308 | */ |
||
309 | public function taxonNamedShouldNotBeAdded($name) |
||
317 | |||
318 | /** |
||
319 | * @Then /^I should see (\d+) taxons on the list$/ |
||
320 | */ |
||
321 | public function iShouldSeeTaxonsInTheList($number) |
||
331 | |||
332 | /** |
||
333 | * @Then I should see the taxon named :name in the list |
||
334 | */ |
||
335 | public function iShouldSeeTheTaxonNamedInTheList($name) |
||
343 | } |
||
344 |