Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
1dd40077
Commit
1dd40077
authored
Jun 29, 2020
by
Andrew Nicols
Browse files
MDL-69136 behat: Support find on a NodeElement
parent
67753d62
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/behat/behat_base.php
View file @
1dd40077
...
...
@@ -119,6 +119,11 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
* @return NodeElement
*/
protected
function
find
(
$selector
,
$locator
,
$exception
=
false
,
$node
=
false
,
$timeout
=
false
)
{
if
(
$selector
===
'NodeElement'
&&
is_a
(
$locator
,
NodeElement
::
class
))
{
// Support a NodeElement being passed in for use in step chaining.
return
$locator
;
}
// Returns the first match.
$items
=
$this
->
find_all
(
$selector
,
$locator
,
$exception
,
$node
,
$timeout
);
return
count
(
$items
)
?
reset
(
$items
)
:
null
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment