1 | <?php |
||
26 | final class AccountContext implements Context |
||
27 | { |
||
28 | /** |
||
29 | * @var DashboardPageInterface |
||
30 | */ |
||
31 | private $dashboardPage; |
||
32 | |||
33 | /** |
||
34 | * @var ProfileUpdatePageInterface |
||
35 | */ |
||
36 | private $profileUpdatePage; |
||
37 | |||
38 | /** |
||
39 | * @var NotificationCheckerInterface |
||
40 | */ |
||
41 | private $notificationChecker; |
||
42 | |||
43 | /** |
||
44 | * @param DashboardPageInterface $dashboardPage |
||
45 | * @param ProfileUpdatePageInterface $profileUpdatePage |
||
46 | * @param NotificationCheckerInterface $notificationChecker |
||
47 | */ |
||
48 | public function __construct( |
||
57 | |||
58 | /** |
||
59 | * @Given I want to modify my profile |
||
60 | */ |
||
61 | public function iWantToModifyMyProfile() |
||
62 | { |
||
63 | $this->profileUpdatePage->open(); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @When I specify the first name as :firstName |
||
68 | * @When I remove the first name |
||
69 | */ |
||
70 | public function iSpecifyTheFirstName($firstName = null) |
||
74 | |||
75 | /** |
||
76 | * @When I specify the last name as :lastName |
||
77 | * @When I remove the last name |
||
78 | */ |
||
79 | public function iSpecifyTheLastName($lastName = null) |
||
83 | |||
84 | /** |
||
85 | * @When I specify the email as :email |
||
86 | * @When I remove the email |
||
87 | */ |
||
88 | public function iSpecifyTheEmail($email = null) |
||
92 | |||
93 | /** |
||
94 | * @When I save my changes |
||
95 | * @When I try to save my changes |
||
96 | */ |
||
97 | public function iSaveMyChanges() |
||
101 | |||
102 | /** |
||
103 | * @Then I should be notified that it has been successfully edited |
||
104 | */ |
||
105 | public function iShouldBeNotifiedThatItHasBeenSuccessfullyEdited() |
||
109 | |||
110 | /** |
||
111 | * @Then my name should be :name |
||
112 | * @Then my name should still be :name |
||
113 | */ |
||
114 | public function myNameShouldBe($name) |
||
123 | |||
124 | /** |
||
125 | * @Then my email should be :email |
||
126 | * @Then my email should still be :email |
||
127 | */ |
||
128 | public function myEmailShouldBe($email) |
||
137 | |||
138 | /** |
||
139 | * @Then /^I should be notified that the ([^"]+) is required$/ |
||
140 | */ |
||
141 | public function iShouldBeNotifiedThatElementIsRequired($element) |
||
145 | |||
146 | /** |
||
147 | * @Then /^I should be notified that the ([^"]+) is invalid$/ |
||
148 | */ |
||
149 | public function iShouldBeNotifiedThatElementIsInvalid($element) |
||
153 | |||
154 | /** |
||
155 | * @Then I should be notified that the email is already used |
||
156 | */ |
||
157 | public function iShouldBeNotifiedThatTheEmailIsAlreadyUsed() |
||
161 | |||
162 | /** |
||
163 | * @param string $element |
||
164 | * @param string $expectedMessage |
||
165 | */ |
||
166 | private function assertFieldValidationMessage($element, $expectedMessage) |
||
173 | } |
||
174 |