Skip to content

Commit

Permalink
Merge branch 'MDL-74636' of https://github.com/timhunt/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Aug 9, 2022
2 parents 5d90181 + 9468fe3 commit a8575c2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/tests/behat/behat_general.php
Expand Up @@ -1988,6 +1988,21 @@ public function database_family_used_is_one_of_the_following(TableNode $database
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.
*
Expand Down

0 comments on commit a8575c2

Please sign in to comment.