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