mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-74636' of https://github.com/timhunt/moodle
This commit is contained in:
commit
a8575c24bd
@ -1988,6 +1988,21 @@ EOF;
|
||||
throw new \Moodle\BehatExtension\Exception\SkippedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if given plugin is installed, and skips the current scenario if not.
|
||||
*
|
||||
* @Given the :plugin plugin is installed
|
||||
* @param string $plugin frankenstyle plugin name, e.g. 'filter_embedquestion'.
|
||||
* @throws \Moodle\BehatExtension\Exception\SkippedException
|
||||
*/
|
||||
public function plugin_is_installed(string $plugin): void {
|
||||
$path = core_component::get_component_directory($plugin);
|
||||
if (!is_readable($path . '/version.php')) {
|
||||
throw new \Moodle\BehatExtension\Exception\SkippedException(
|
||||
'Skipping this scenario because the ' . $plugin . ' is not installed.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks focus is with the given element.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user