Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@
// 1) Make sure we replace the configurations for behat as we have not ran 'lib/setup.php' yet.
if (!empty($CFG->behat_wwwroot) or !empty($CFG->behat_dataroot) or !empty($CFG->behat_prefix)) {
require_once(__DIR__.'/../../lib/behat/lib.php');

// The function call below will change $CFG so let's save it and restore later if access is granted.
$beforebehatcfg = $CFG;
$CFG = clone($CFG);
behat_update_vars_for_process();

if (behat_is_test_site()) {
$beforebehatcfg = $CFG;
$CFG = clone($CFG);
clearstatcache();
behat_check_config_vars();
behat_clean_init_config();
Expand Down Expand Up @@ -82,4 +85,5 @@
// 5) Restore behat config as needed (let setup.php execute which is more complex than our quick-check).
if (isset($beforebehatcfg)) {
$CFG = $beforebehatcfg;
unset($beforebehatcfg);
}