1 | <?php |
||
24 | class CoreContext extends RawMinkContext |
||
25 | { |
||
26 | use CommonContextTrait; |
||
27 | |||
28 | static protected $application; |
||
29 | |||
30 | static private $jobCategoryChecked = false; |
||
31 | |||
32 | /** |
||
33 | * @BeforeScenario |
||
34 | * @param BeforeScenarioScope $scope |
||
35 | */ |
||
36 | public function setupContexts(BeforeScenarioScope $scope) |
||
50 | |||
51 | /** |
||
52 | * @return Application |
||
53 | */ |
||
54 | public function getApplication() |
||
63 | |||
64 | /** |
||
65 | * @return \Zend\ServiceManager\ServiceManager |
||
66 | */ |
||
67 | public function getServiceManager() |
||
71 | |||
72 | /** |
||
73 | * @return \Zend\EventManager\EventManagerInterface |
||
74 | */ |
||
75 | public function getEventManager() |
||
79 | |||
80 | /** |
||
81 | * @return RepositoryService |
||
82 | */ |
||
83 | public function getRepositories() |
||
87 | |||
88 | /** |
||
89 | * @param $name |
||
90 | * @param array $params |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | public function generateUrl($name) |
||
98 | |||
99 | /** |
||
100 | * @When /^I hover over the element "([^"]*)"$/ |
||
101 | */ |
||
102 | public function iHoverOverTheElement($locator) |
||
115 | |||
116 | /** |
||
117 | * @Given /^I wait for (\d+) seconds$/ |
||
118 | */ |
||
119 | public function iWaitForSecond($second) |
||
123 | |||
124 | /** |
||
125 | * @Then /^I wait for the ajax response$/ |
||
126 | */ |
||
127 | public function iWaitForTheAjaxResponse() |
||
131 | |||
132 | /** |
||
133 | * Some forms do not have a Submit button just pass the ID |
||
134 | * |
||
135 | * @Given /^I submit the form with id "([^"]*)"$/ |
||
136 | */ |
||
137 | public function iSubmitTheFormWithId($arg) |
||
146 | |||
147 | /** |
||
148 | * @Then I switch to popup :name |
||
149 | * |
||
150 | * @param $name |
||
151 | */ |
||
152 | public function iSwitchToPopup($name) |
||
157 | |||
158 | /** |
||
159 | * @Then I set main window name |
||
160 | */ |
||
161 | public function iSetMainWindowName() |
||
167 | |||
168 | /** |
||
169 | * @Then I switch back to main window |
||
170 | */ |
||
171 | public function iSwitchBackToMainWindow() |
||
175 | |||
176 | public function iVisit($url) |
||
180 | |||
181 | /** |
||
182 | * @When I scroll :selector into view |
||
183 | * |
||
184 | * @param string $selector Allowed selectors: #id, .className, //xpath |
||
185 | * |
||
186 | * @throws \Exception |
||
187 | */ |
||
188 | public function scrollIntoView($selector) |
||
233 | |||
234 | /** |
||
235 | * @When I click location selector |
||
236 | */ |
||
237 | public function iClickLocationSelector() |
||
243 | |||
244 | /** |
||
245 | * @param $locator |
||
246 | * @param string $selector |
||
247 | * |
||
248 | * @return \Behat\Mink\Element\NodeElement|mixed|null |
||
249 | */ |
||
250 | public function getElement($locator,$selector='css') |
||
256 | |||
257 | /** |
||
258 | * @When I fill in location search with :term |
||
259 | * @param $term |
||
260 | */ |
||
261 | public function iFillInLocationSearch($term) |
||
269 | |||
270 | public function iClickOn() |
||
274 | |||
275 | /** |
||
276 | * Click some text |
||
277 | * |
||
278 | * @When /^I click on the text "([^"]*)"$/ |
||
279 | */ |
||
280 | public function iClickOnTheText($text) |
||
300 | |||
301 | /** |
||
302 | * @Then /^(?:|I )should see translated text "(?P<text>(?:[^"]|\\")*)"$/ |
||
303 | */ |
||
304 | public function iShouldSeeText($text) |
||
310 | |||
311 | /** |
||
312 | * @When I go to dashboard page |
||
313 | */ |
||
314 | public function iGoToDashboardPage() |
||
319 | } |
||
320 |
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: