mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 05:25:08 +02:00
MDL-39552 Make behat code re-entrant safe
With yui combo in action, some times setup.php is included more than once. So it's mandatory to guarantee that code until ABORT_AFTER_CONFIG_CANCEL can be executed safely multiple times in the same request. This change just prevents the behat section to be executed more than once. All the values that are set within it should be already defined for the re-entrant call.
This commit is contained in:
parent
5b003e9cdd
commit
de10fcac5f
@ -107,7 +107,8 @@ if (!empty($CFG->behat_switchcompletely)) {
|
||||
// Test environment is enabled if:
|
||||
// * User has previously enabled through admin/tool/behat/cli/util.php --enable.
|
||||
// Both are required to switch to test mode
|
||||
if (!empty($CFG->behat_dataroot) && !empty($CFG->behat_prefix) && file_exists($CFG->behat_dataroot)) {
|
||||
if (!defined('BEHAT_SITE_RUNNING') && !empty($CFG->behat_dataroot) &&
|
||||
!empty($CFG->behat_prefix) && file_exists($CFG->behat_dataroot)) {
|
||||
|
||||
$CFG->behat_dataroot = realpath($CFG->behat_dataroot);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user