1 | <?php |
||
13 | final class ManagingCustomBlocksContext implements Context |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var IndexPageInterface |
||
18 | */ |
||
19 | private $indexPage; |
||
20 | |||
21 | /** |
||
22 | * @var CreatePageInterface |
||
23 | */ |
||
24 | private $createPage; |
||
25 | |||
26 | /** |
||
27 | * @var UpdatePageInterface |
||
28 | */ |
||
29 | private $updatePage; |
||
30 | |||
31 | /** |
||
32 | * @var ShowPageInterface |
||
33 | */ |
||
34 | private $showPage; |
||
35 | |||
36 | /** |
||
37 | * @param IndexPageInterface $indexPage |
||
38 | * @param CreatePageInterface $createPage |
||
39 | * @param UpdatePageInterface $updatePage |
||
40 | * @param ShowPageInterface $showPage |
||
41 | */ |
||
42 | public function __construct( |
||
53 | |||
54 | /** |
||
55 | * @Given I want to create a new custom block |
||
56 | * @Given I want to add a new custom block |
||
57 | */ |
||
58 | public function iWantToCreateNewCustomBlock() |
||
62 | |||
63 | /** |
||
64 | * @Given I browse custom blocks of the store |
||
65 | */ |
||
66 | public function iWantToBrowseCustomBlocksOfTheStore() |
||
70 | |||
71 | /** |
||
72 | * @Given I have created a custom block :name with image :imagePath |
||
73 | */ |
||
74 | public function iHaveCreatedCustomBlockWithImage($name, $imagePath) |
||
81 | |||
82 | /** |
||
83 | * @When I set its body to :body |
||
84 | */ |
||
85 | public function iSetItsBodyTo($body) |
||
89 | |||
90 | /** |
||
91 | * @When I set its link to :link |
||
92 | */ |
||
93 | public function iSetItsLinkTo($link) |
||
97 | |||
98 | /** |
||
99 | * @When I set its name to :name |
||
100 | */ |
||
101 | public function iSetItsNameTo($name) |
||
105 | |||
106 | /** |
||
107 | * @When I set its title to :title |
||
108 | */ |
||
109 | public function iSetItsTitleTo($title) |
||
113 | |||
114 | /** |
||
115 | * @When I attach :imagePath as its image |
||
116 | */ |
||
117 | public function iAttachAsItsImage($imagePath) |
||
121 | |||
122 | /** |
||
123 | * @When I add it |
||
124 | * @When I try to add it |
||
125 | */ |
||
126 | public function iAddIt() |
||
130 | |||
131 | /** |
||
132 | * @Then /^I should be notified that (body|name) is required$/ |
||
133 | */ |
||
134 | public function iShouldBeNotifiedThatElementIsRequired($element) |
||
141 | |||
142 | /** |
||
143 | * @Then the custom block :name should appear in the store |
||
144 | * @Then I should see the custom block :name in the list |
||
145 | */ |
||
146 | public function theCustomBlockShouldAppearInTheStore($name) |
||
154 | |||
155 | /** |
||
156 | * @Then I should see :amount custom blocks in the list |
||
157 | */ |
||
158 | public function iShouldSeeThatManyCustomBlocksInTheList($amount) |
||
166 | |||
167 | /** |
||
168 | * @Then the custom block :name should not be added |
||
169 | */ |
||
170 | public function theCustomBlockShouldNotBeAdded($name) |
||
178 | |||
179 | /** |
||
180 | * @When /^I preview (this custom block)$/ |
||
181 | * @When I preview custom block :customBlock |
||
182 | */ |
||
183 | public function iPreviewCustomBlock(CustomBlock $customBlock) |
||
187 | |||
188 | /** |
||
189 | * @Given /^I want to edit (this custom block)$/ |
||
190 | */ |
||
191 | public function iWantToEditThisCustomBlock(CustomBlock $customBlock) |
||
195 | |||
196 | /** |
||
197 | * @When I change its body to :body |
||
198 | */ |
||
199 | public function iChangeItsBodyTo($body) |
||
203 | |||
204 | /** |
||
205 | * @When I change its link to :link |
||
206 | */ |
||
207 | public function iChangeItsLinkTo($link) |
||
211 | |||
212 | /** |
||
213 | * @When I change its title to :title |
||
214 | */ |
||
215 | public function iChangeItsTitleTo($title) |
||
219 | |||
220 | /** |
||
221 | * @When I save my changes |
||
222 | * @When I try to save my changes |
||
223 | */ |
||
224 | public function iSaveMyChanges() |
||
228 | |||
229 | /** |
||
230 | * @When I delete custom block :name |
||
231 | */ |
||
232 | public function iDeleteCustomBlock($name) |
||
237 | |||
238 | /** |
||
239 | * @Then I should see :expected in this block contents |
||
240 | */ |
||
241 | public function iShouldSeeInThisBlockContents($expected) |
||
245 | |||
246 | /** |
||
247 | * @Then I should see an image |
||
248 | */ |
||
249 | public function iShouldSeeImage() |
||
254 | |||
255 | /** |
||
256 | * @Then /^(this custom block) should have body "([^"]+)"$/ |
||
257 | */ |
||
258 | public function thisCustomBlockShouldHaveBody(CustomBlock $customBlock, $body) |
||
264 | |||
265 | /** |
||
266 | * @Then /^(this custom block) should have link "([^"]+)"$/ |
||
267 | */ |
||
268 | public function thisCustomBlockShouldHaveLink(CustomBlock $customBlock, $link) |
||
274 | |||
275 | /** |
||
276 | * @Then /^(this custom block) should have title "([^"]+)"$/ |
||
277 | */ |
||
278 | public function thisCustomBlockShouldHaveTitle(CustomBlock $customBlock, $title) |
||
284 | |||
285 | /** |
||
286 | * @Then the custom block :name should no longer exist in the store |
||
287 | */ |
||
288 | public function theCustomBlockShouldNoLongerExistInTheStore($name) |
||
292 | } |
||
293 |