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 | * @When I set its body to :body |
||
72 | */ |
||
73 | public function iSetItsBodyTo($body) |
||
77 | |||
78 | /** |
||
79 | * @When I set its link to :link |
||
80 | */ |
||
81 | public function iSetItsLinkTo($link) |
||
85 | |||
86 | /** |
||
87 | * @When I set its name to :name |
||
88 | */ |
||
89 | public function iSetItsNameTo($name) |
||
93 | |||
94 | /** |
||
95 | * @When I set its title to :title |
||
96 | */ |
||
97 | public function iSetItsTitleTo($title) |
||
101 | |||
102 | /** |
||
103 | * @When I attach :imagePath as its image |
||
104 | */ |
||
105 | public function iAttachAsItsImage($imagePath) |
||
109 | |||
110 | /** |
||
111 | * @When I add it |
||
112 | * @When I try to add it |
||
113 | */ |
||
114 | public function iAddIt() |
||
118 | |||
119 | /** |
||
120 | * @Then /^I should be notified that (body|name) is required$/ |
||
121 | */ |
||
122 | public function iShouldBeNotifiedThatElementIsRequired($element) |
||
129 | |||
130 | /** |
||
131 | * @Then the custom block :name should appear in the store |
||
132 | * @Then I should see the custom block :name in the list |
||
133 | */ |
||
134 | public function theCustomBlockShouldAppearInTheStore($name) |
||
142 | |||
143 | /** |
||
144 | * @Then I should see :amount custom blocks in the list |
||
145 | */ |
||
146 | public function iShouldSeeThatManyCustomBlocksInTheList($amount) |
||
154 | |||
155 | /** |
||
156 | * @Then the custom block :name should not be added |
||
157 | */ |
||
158 | public function theCustomBlockShouldNotBeAdded($name) |
||
166 | |||
167 | /** |
||
168 | * @When /^I preview (this custom block)$/ |
||
169 | */ |
||
170 | public function iPreviewCustomBlock(CustomBlock $customBlock) |
||
174 | |||
175 | /** |
||
176 | * @Given /^I want to edit (this custom block)$/ |
||
177 | */ |
||
178 | public function iWantToEditThisCustomBlock(CustomBlock $customBlock) |
||
182 | |||
183 | /** |
||
184 | * @When I change its body to :body |
||
185 | */ |
||
186 | public function iChangeItsBodyTo($body) |
||
190 | |||
191 | /** |
||
192 | * @When I change its link to :link |
||
193 | */ |
||
194 | public function iChangeItsLinkTo($link) |
||
198 | |||
199 | /** |
||
200 | * @When I change its title to :title |
||
201 | */ |
||
202 | public function iChangeItsTitleTo($title) |
||
206 | |||
207 | /** |
||
208 | * @When I save my changes |
||
209 | * @When I try to save my changes |
||
210 | */ |
||
211 | public function iSaveMyChanges() |
||
215 | |||
216 | /** |
||
217 | * @When I delete custom block :name |
||
218 | */ |
||
219 | public function iDeleteCustomBlock($name) |
||
224 | |||
225 | /** |
||
226 | * @Then I should see :expected in this block contents |
||
227 | */ |
||
228 | public function iShouldSeeInThisBlockContents($expected) |
||
232 | |||
233 | /** |
||
234 | * @Then /^(this custom block) should have body "([^"]+)"$/ |
||
235 | */ |
||
236 | public function thisCustomBlockShouldHaveBody(CustomBlock $customBlock, $body) |
||
242 | |||
243 | /** |
||
244 | * @Then /^(this custom block) should have link "([^"]+)"$/ |
||
245 | */ |
||
246 | public function thisCustomBlockShouldHaveLink(CustomBlock $customBlock, $link) |
||
252 | |||
253 | /** |
||
254 | * @Then /^(this custom block) should have title "([^"]+)"$/ |
||
255 | */ |
||
256 | public function thisCustomBlockShouldHaveTitle(CustomBlock $customBlock, $title) |
||
262 | |||
263 | /** |
||
264 | * @Then the custom block :name should no longer exist in the store |
||
265 | */ |
||
266 | public function theCustomBlockShouldNoLongerExistInTheStore($name) |
||
270 | } |
||
271 |