92
92
// Getting $CFG data.
93
93
require_once(__DIR__ . '/../../../../config.php');
95
// CFG->behat_prefix must be set and with value different than CFG->prefix and phpunit_prefix.
96
if (empty($CFG->behat_prefix) ||
97
($CFG->behat_prefix == $CFG->prefix) ||
98
(!empty($CFG->phpunit_prefix) && $CFG->behat_prefix == $CFG->phpunit_prefix)) {
99
behat_error(BEHAT_EXITCODE_CONFIG,
100
'Define $CFG->behat_prefix in config.php with a value different than $CFG->prefix and $CFG->phpunit_prefix');
95
// When we use the utilities we don't know how the site
96
// will be accessed, so if neither $CFG->behat_switchcompletely or
97
// $CFG->behat_wwwroot are set we must think that the site will
98
// be accessed using the built-in server which is set by default
99
// to localhost:8000. We need to do this to prevent uses of the production
100
// wwwroot when the site is being installed / dropped...
101
$CFG->behat_wwwroot = behat_get_wwwroot();
103
// CFG->behat_dataroot must be set and with value different than CFG->dataroot and phpunit_dataroot.
104
if (empty($CFG->behat_dataroot) ||
105
($CFG->behat_dataroot == $CFG->dataroot) ||
106
(!empty($CFG->phpunit_dataroot) && $CFG->behat_dataroot == $CFG->phpunit_dataroot)) {
107
behat_error(BEHAT_EXITCODE_CONFIG,
108
'Define $CFG->behat_dataroot in config.php with a value different than $CFG->dataroot and $CFG->phpunit_dataroot');
103
// Checking the integrity of the provided $CFG->behat_* vars
104
// to prevent conflicts with production and phpunit environments.
105
behat_check_config_vars();
111
107
// Create behat_dataroot if it doesn't exists.
112
108
if (!file_exists($CFG->behat_dataroot)) {