1 | <?php |
||
22 | class CoreContext extends RawMinkContext |
||
23 | { |
||
24 | use CommonContextTrait; |
||
25 | |||
26 | protected static $application; |
||
27 | |||
28 | private static $jobCategoryChecked = false; |
||
29 | |||
30 | private $config; |
||
31 | |||
32 | /** |
||
33 | * @BeforeSuite |
||
34 | */ |
||
35 | public static function beforeSuite() |
||
39 | |||
40 | /** |
||
41 | * @BeforeScenario |
||
42 | * @param BeforeScenarioScope $scope |
||
43 | */ |
||
44 | public function setupContexts(BeforeScenarioScope $scope) |
||
58 | |||
59 | /** |
||
60 | * @return Application |
||
61 | */ |
||
62 | public function getApplication() |
||
69 | |||
70 | /** |
||
71 | * @return \Zend\ServiceManager\ServiceManager |
||
72 | */ |
||
73 | public function getServiceManager() |
||
77 | |||
78 | /** |
||
79 | * @return \Zend\EventManager\EventManagerInterface |
||
80 | */ |
||
81 | public function getEventManager() |
||
85 | |||
86 | /** |
||
87 | * @return RepositoryService |
||
88 | */ |
||
89 | public function getRepositories() |
||
93 | |||
94 | /** |
||
95 | * @param $name |
||
96 | * @param array $params |
||
97 | * |
||
98 | * @return string |
||
99 | */ |
||
100 | public function generateUrl($name) |
||
104 | |||
105 | /** |
||
106 | * @When /^I hover over the element "([^"]*)"$/ |
||
107 | */ |
||
108 | public function iHoverOverTheElement($locator) |
||
121 | |||
122 | /** |
||
123 | * @Given /^I wait for (\d+) seconds$/ |
||
124 | */ |
||
125 | public function iWaitForSecond($second) |
||
129 | |||
130 | /** |
||
131 | * @Then /^I wait for the ajax response$/ |
||
132 | */ |
||
133 | public function iWaitForTheAjaxResponse() |
||
137 | |||
138 | /** |
||
139 | * Some forms do not have a Submit button just pass the ID |
||
140 | * |
||
141 | * @Given /^I submit the form with id "([^"]*)"$/ |
||
142 | */ |
||
143 | public function iSubmitTheFormWithId($arg) |
||
152 | |||
153 | /** |
||
154 | * @Then I switch to popup :name |
||
155 | * |
||
156 | * @param $name |
||
157 | */ |
||
158 | public function iSwitchToPopup($name) |
||
163 | |||
164 | /** |
||
165 | * @Then I set main window name |
||
166 | */ |
||
167 | public function iSetMainWindowName() |
||
173 | |||
174 | /** |
||
175 | * @Then I switch back to main window |
||
176 | */ |
||
177 | public function iSwitchBackToMainWindow() |
||
181 | |||
182 | public function iVisit($url) |
||
186 | |||
187 | /** |
||
188 | * @When I scroll :selector into view |
||
189 | * |
||
190 | * @param string $selector Allowed selectors: #id, .className, //xpath |
||
191 | * |
||
192 | * @throws \Exception |
||
193 | */ |
||
194 | public function scrollIntoView($selector) |
||
239 | |||
240 | /** |
||
241 | * @When I click location selector |
||
242 | */ |
||
243 | public function iClickLocationSelector() |
||
249 | |||
250 | /** |
||
251 | * @param $locator |
||
252 | * @param string $selector |
||
253 | * |
||
254 | * @return \Behat\Mink\Element\NodeElement|mixed|null |
||
255 | */ |
||
256 | public function getElement($locator, $selector='css') |
||
262 | |||
263 | /** |
||
264 | * @When I fill in location search with :term |
||
265 | * @param $term |
||
266 | */ |
||
267 | public function iFillInLocationSearch($term) |
||
275 | |||
276 | public function iClickOn() |
||
279 | |||
280 | /** |
||
281 | * Click some text |
||
282 | * |
||
283 | * @When /^I click on the text "([^"]*)"$/ |
||
284 | */ |
||
285 | public function iClickOnTheText($text) |
||
304 | |||
305 | /** |
||
306 | * @Then /^(?:|I )should see translated text "(?P<text>(?:[^"]|\\")*)"$/ |
||
307 | */ |
||
308 | public function iShouldSeeText($text) |
||
314 | |||
315 | /** |
||
316 | * @When I go to dashboard page |
||
317 | */ |
||
318 | public function iGoToDashboardPage() |
||
323 | } |
||
324 |
Let’s assume you have a class which uses late-static binding:
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()
on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClass
to useself
instead: