MDL-38007 behat: Changing check_behat_setup interface

This commit is contained in:
David Monllao
2013-03-01 10:44:31 +08:00
parent cce0d9a100
commit fa7e4e2b6a
4 changed files with 56 additions and 8 deletions
+23 -1
View File
@@ -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