1 | <?php |
||
28 | final class ManagingAdministratorsContext implements Context |
||
29 | { |
||
30 | /** |
||
31 | * @var CreatePageInterface |
||
32 | */ |
||
33 | private $createPage; |
||
34 | |||
35 | /** |
||
36 | * @var IndexPageInterface |
||
37 | */ |
||
38 | private $indexPage; |
||
39 | |||
40 | /** |
||
41 | * @var UpdatePageInterface |
||
42 | */ |
||
43 | private $updatePage; |
||
44 | |||
45 | /** |
||
46 | * @var NotificationCheckerInterface |
||
47 | */ |
||
48 | private $notificationChecker; |
||
49 | |||
50 | /** |
||
51 | * @param CreatePageInterface $createPage |
||
52 | * @param IndexPageInterface $indexPage |
||
53 | * @param UpdatePageInterface $updatePage |
||
54 | * @param NotificationCheckerInterface $notificationChecker |
||
55 | */ |
||
56 | public function __construct( |
||
67 | |||
68 | /** |
||
69 | * @Given I want to create a new administrator |
||
70 | */ |
||
71 | public function iWantToCreateANewAdministrator() |
||
75 | |||
76 | /** |
||
77 | * @Given /^I am editing (my) details$/ |
||
78 | * @When /^I want to edit (this administrator)$/ |
||
79 | */ |
||
80 | public function iWantToEditThisAdministrator(AdminUserInterface $adminUser) |
||
84 | |||
85 | /** |
||
86 | * @When I want to browse administrators |
||
87 | */ |
||
88 | public function iWantToBrowseAdministrators() |
||
92 | |||
93 | /** |
||
94 | * @When I specify its name as :username |
||
95 | * @When I do not specify its name |
||
96 | */ |
||
97 | public function iSpecifyItsNameAs($username = null) |
||
101 | |||
102 | /** |
||
103 | * @When I change its name to :username |
||
104 | */ |
||
105 | public function iChangeItsNameTo($username) |
||
106 | { |
||
107 | $this->updatePage->changeUsername($username); |
||
108 | } |
||
109 | |||
110 | /** |
||
111 | * @When I specify its email as :email |
||
112 | * @When I do not specify its email |
||
113 | */ |
||
114 | public function iSpecifyItsEmailAs($email = null) |
||
118 | |||
119 | /** |
||
120 | * @When I change its email to :email |
||
121 | */ |
||
122 | public function iChangeItsEmailTo($email) |
||
123 | { |
||
124 | $this->updatePage->changeEmail($email); |
||
125 | } |
||
126 | |||
127 | /** |
||
128 | * @When I specify its locale as :localeCode |
||
129 | */ |
||
130 | public function iSpecifyItsLocaleAs($localeCode) |
||
131 | { |
||
132 | $this->createPage->specifyLocale($localeCode); |
||
133 | } |
||
134 | |||
135 | /** |
||
136 | * @When I set my locale to :localeCode |
||
137 | */ |
||
138 | public function iSetMyLocaleTo($localeCode) |
||
143 | |||
144 | /** |
||
145 | * @When I specify its password as :password |
||
146 | * @When I do not specify its password |
||
147 | */ |
||
148 | public function iSpecifyItsPasswordAs($password = null) |
||
152 | |||
153 | /** |
||
154 | * @When I change its password to :password |
||
155 | */ |
||
156 | public function iChangeItsPasswordTo($password) |
||
157 | { |
||
158 | $this->updatePage->changePassword($password); |
||
159 | } |
||
160 | |||
161 | /** |
||
162 | * @When I enable it |
||
163 | */ |
||
164 | public function iEnableIt() |
||
168 | |||
169 | /** |
||
170 | * @When I add it |
||
171 | * @When I try to add it |
||
172 | */ |
||
173 | public function iAddIt() |
||
177 | |||
178 | /** |
||
179 | * @When I save my changes |
||
180 | */ |
||
181 | public function iSaveMyChanges() |
||
185 | |||
186 | /** |
||
187 | * @When I delete administrator with email :email |
||
188 | */ |
||
189 | public function iDeleteAdministratorWithEmail($email) |
||
193 | |||
194 | /** |
||
195 | * @Then the administrator :email should appear in the store |
||
196 | * @Then I should see the administrator :email in the list |
||
197 | * @Then there should still be only one administrator with an email :email |
||
198 | */ |
||
199 | public function theAdministratorShouldAppearInTheStore($email) |
||
205 | |||
206 | /** |
||
207 | * @Then this administrator with name :username should appear in the store |
||
208 | * @Then there should still be only one administrator with name :username |
||
209 | */ |
||
210 | public function thisAdministratorWithNameShouldAppearInTheStore($username) |
||
216 | |||
217 | /** |
||
218 | * @Then /^there should be (\d+) administrators in the list$/ |
||
219 | */ |
||
220 | public function iShouldSeeAdministratorsInTheList($number) |
||
224 | |||
225 | /** |
||
226 | * @Then I should be notified that email must be unique |
||
227 | */ |
||
228 | public function iShouldBeNotifiedThatEmailMustBeUnique() |
||
232 | |||
233 | /** |
||
234 | * @Then I should be notified that name must be unique |
||
235 | */ |
||
236 | public function iShouldBeNotifiedThatNameMustBeUnique() |
||
240 | |||
241 | /** |
||
242 | * @Then I should be notified that the :elementName is required |
||
243 | */ |
||
244 | public function iShouldBeNotifiedThatFirstNameIsRequired($elementName) |
||
248 | |||
249 | /** |
||
250 | * @Then I should be notified that this email is not valid |
||
251 | */ |
||
252 | public function iShouldBeNotifiedThatEmailIsNotValid() |
||
256 | |||
257 | /** |
||
258 | * @Then this administrator should not be added |
||
259 | */ |
||
260 | public function thisAdministratorShouldNotBeAdded() |
||
266 | |||
267 | /** |
||
268 | * @Then there should not be :email administrator anymore |
||
269 | */ |
||
270 | public function thereShouldBeNoAnymore($email) |
||
274 | |||
275 | /** |
||
276 | * @Then I should be notified that it cannot be deleted |
||
277 | */ |
||
278 | public function iShouldBeNotifiedThatItCannotBeDeleted() |
||
285 | } |
||
286 |