-
Bug
-
Resolution: Fixed
-
Minor
-
3.2, 3.3, 3.4
-
MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
-
MOODLE_32_STABLE, MOODLE_33_STABLE
-
MDL-58826_master -
Steps to reproduce:
- Put the attached file broken.feature in /lib/tests/behat
- Run behat init
- Run broken.feature
Expected: The first test fails as it's trying to use an action menu that isn't present on the page. The second test then runs.
Actual: The first test crashes with a fatal error. The second test is not run.
The problem is that the step gets the menu node using Element->find() not behat_base->find(), so the step isn't throwing an exception when the menu node isn't found. The fix checks $menunode before trying to call method on it and throws an exception.