1 | <?php |
||
12 | final class ManagingRoutesContext implements Context |
||
13 | { |
||
14 | /** |
||
15 | * @var IndexPageInterface |
||
16 | */ |
||
17 | private $indexPage; |
||
18 | |||
19 | /** |
||
20 | * @var CreatePageInterface |
||
21 | */ |
||
22 | private $createPage; |
||
23 | |||
24 | /** |
||
25 | * @var UpdatePageInterface |
||
26 | */ |
||
27 | private $updatePage; |
||
28 | |||
29 | /** |
||
30 | * @param IndexPageInterface $indexPage |
||
31 | * @param CreatePageInterface $createPage |
||
32 | * @param UpdatePageInterface $updatePage |
||
33 | */ |
||
34 | public function __construct( |
||
43 | |||
44 | /** |
||
45 | * @Given I want to create a new route |
||
46 | * @Given I want to add a new route |
||
47 | */ |
||
48 | public function iWantToCreateNewRoute() |
||
52 | |||
53 | /** |
||
54 | * @When I want to browse routes of the store |
||
55 | */ |
||
56 | public function iWantToBrowseRoutesOfTheStore() |
||
60 | |||
61 | /** |
||
62 | * @When I set its name to :name |
||
63 | */ |
||
64 | public function iSetItsNameTo($name) |
||
68 | |||
69 | /** |
||
70 | * @When I choose :title as its content |
||
71 | */ |
||
72 | public function iChooseContent($title) |
||
76 | |||
77 | /** |
||
78 | * @When I add it |
||
79 | * @When I try to add it |
||
80 | */ |
||
81 | public function iAddIt() |
||
85 | |||
86 | /** |
||
87 | * @Then the route :name should appear in the store |
||
88 | * @Then I should see the route :name in the list |
||
89 | */ |
||
90 | public function theRouteShouldAppearInTheStore($name) |
||
98 | |||
99 | /** |
||
100 | * @Then I should see :amount routes in the list |
||
101 | */ |
||
102 | public function iShouldSeeThatManyRoutesInTheList($amount) |
||
110 | |||
111 | /** |
||
112 | * @When I delete route :name |
||
113 | */ |
||
114 | public function iDeleteRoute($name) |
||
119 | |||
120 | /** |
||
121 | * @Given the route :name should no longer exist in the store |
||
122 | */ |
||
123 | public function theRouteShouldNoLongerExistInTheStore($name) |
||
127 | |||
128 | /** |
||
129 | * @Given /^I want to edit (this route)$/ |
||
130 | */ |
||
131 | public function iWantToEditThisRoute(Route $route) |
||
135 | |||
136 | /** |
||
137 | * @When I choose :title as its new content |
||
138 | */ |
||
139 | public function iChooseNewContent($title) |
||
143 | |||
144 | /** |
||
145 | * @When I save my changes |
||
146 | * @When I try to save my changes |
||
147 | */ |
||
148 | public function iSaveMyChanges() |
||
152 | |||
153 | /** |
||
154 | * @Then /^(this route) should have assigned "([^"]+)" content$/ |
||
155 | */ |
||
156 | public function thisRouteShouldHaveAssignedContent(Route $route, $contentTitle) |
||
167 | |||
168 | /** |
||
169 | * @Then I should be notified that name is required |
||
170 | */ |
||
171 | public function iShouldBeNotifiedThatElementIsRequired() |
||
178 | |||
179 | /** |
||
180 | * @Then the route with content :title should not be added |
||
181 | */ |
||
182 | public function theRouteWithContentShouldNotBeAdded($title) |
||
190 | } |
||
191 |