MDL-37046 behat: Changes from integration review
* RTL languages problem solved * Fixed curl errno return * Switch to behat test environment code more readable
This commit is contained in:
+8
-3
@@ -108,12 +108,17 @@ if (isset($CFG->behat_switchcompletely)) {
|
||||
// * User has previously enabled through admin/tool/behat/cli/util.php --enable.
|
||||
// Both are required to switch to test mode
|
||||
if (isset($CFG->behat_dataroot) && isset($CFG->behat_prefix) && file_exists($CFG->behat_dataroot)) {
|
||||
|
||||
$CFG->behat_dataroot = realpath($CFG->behat_dataroot);
|
||||
$testenvironmentrequested = (isset($CFG->behat_switchcompletely) && php_sapi_name() !== 'cli') ||
|
||||
php_sapi_name() === 'cli-server' ||
|
||||
defined('BEHAT_RUNNING');
|
||||
|
||||
$switchcompletely = isset($CFG->behat_switchcompletely) && php_sapi_name() !== 'cli';
|
||||
$builtinserver = php_sapi_name() === 'cli-server';
|
||||
$behatrunning = defined('BEHAT_RUNNING');
|
||||
$testenvironmentrequested = $switchcompletely || $builtinserver || $behatrunning;
|
||||
|
||||
// Only switch to test environment if it has been enabled.
|
||||
$testenvironmentenabled = file_exists($CFG->behat_dataroot . '/behat/test_environment_enabled.txt');
|
||||
|
||||
if ($testenvironmentenabled && $testenvironmentrequested) {
|
||||
$CFG->wwwroot = $CFG->behat_wwwroot;
|
||||
$CFG->passwordsaltmain = 'moodle';
|
||||
|
||||
Reference in New Issue
Block a user