MDL-38007 behat: Changing check_behat_setup interface
This commit is contained in:
@@ -176,7 +176,9 @@ class behat_util extends testing_util {
|
||||
}
|
||||
|
||||
// Checks the behat set up and the PHP version.
|
||||
behat_command::check_behat_setup(true);
|
||||
if ($errorcode = behat_command::behat_setup_problem(true)) {
|
||||
exit($code);
|
||||
}
|
||||
|
||||
// Check that test environment is correctly set up.
|
||||
self::test_environment_problem();
|
||||
@@ -196,6 +198,26 @@ class behat_util extends testing_util {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the status of the behat test environment
|
||||
*
|
||||
* @return int Error code
|
||||
*/
|
||||
public static function get_behat_status() {
|
||||
|
||||
if (!defined('BEHAT_UTIL')) {
|
||||
throw new coding_exception('This method can be only used by Behat CLI tool');
|
||||
}
|
||||
|
||||
// Checks the behat set up and the PHP version, returning an error code if something went wrong.
|
||||
if ($errorcode = behat_command::behat_setup_problem(true)) {
|
||||
return $code;
|
||||
}
|
||||
|
||||
// Check that test environment is correctly set up, stops execution.
|
||||
self::test_environment_problem();
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables test mode
|
||||
* @throws coding_exception
|
||||
|
||||
Reference in New Issue
Block a user