MDL-58428 behat: Check parent themes for Behat override steps.

Behat will now look at the current themes' parents for Behat ovveride steps.
If found we will use the steps replacing the Moodle core steps.
This commit is contained in:
Andrew Nicols 2019-01-17 13:57:12 +08:00 committed by Mathew May
parent e3652936f3
commit 4aefaf653b
10 changed files with 110 additions and 131 deletions

View file

@ -90,6 +90,13 @@ class behat_context_helper {
* @return behat_base
*/
public static function get($classname) {
$contexts = self::$environment->getContexts();
foreach ($contexts as $context) {
if (is_a($context, $classname)) {
return $context;
}
}
$suitename = self::$environment->getSuite()->getName();
// If default suite, then get the default theme name.