diff --git a/admin/tool/behat/lang/en/tool_behat.php b/admin/tool/behat/lang/en/tool_behat.php index 776fb1dfc6d..88e336516a8 100644 --- a/admin/tool/behat/lang/en/tool_behat.php +++ b/admin/tool/behat/lang/en/tool_behat.php @@ -24,7 +24,7 @@ $string['aim'] = 'This administration tool helps developers and test writers to create .feature files describing Moodle\'s functionalities and run them automatically. Step definitions available for use in .feature files are listed below.'; $string['allavailablesteps'] = 'All available step definitions'; -$string['errorapproot'] = '$CFG->behat_approot is not pointing to a valid Moodle Mobile developer install.'; +$string['errorapproot'] = '$CFG->behat_ionic_dirroot is not pointing to a valid Moodle Mobile developer install.'; $string['errorbehatcommand'] = 'Error running behat CLI command. Try running "{$a} --help" manually from CLI to find out more about the problem.'; $string['errorcomposer'] = 'Composer dependencies are not installed.'; $string['errordataroot'] = '$CFG->behat_dataroot is not set or is invalid.'; diff --git a/config-dist.php b/config-dist.php index e29135ae384..baff6db15e7 100644 --- a/config-dist.php +++ b/config-dist.php @@ -869,11 +869,11 @@ $CFG->admin = 'admin'; // define('BEHAT_DISABLE_HISTOGRAM', true); // // Mobile app Behat testing requires this option, pointing to a developer Moodle Mobile directory: -// $CFG->behat_approot = '/where/I/keep/my/git/checkouts/moodlemobile2'; +// $CFG->behat_ionic_dirroot = '/where/I/keep/my/git/checkouts/moodlemobile2'; // // The following option can be used to indicate a running Ionic server (otherwise Behat will start // one automatically for each test run, which is convenient but takes ages): -// $CFG->behat_ionicaddress = 'http://localhost:8100'; +// $CFG->behat_ionic_wwwroot = 'http://localhost:8100'; // //========================================================================= // 12. DEVELOPER DATA GENERATOR diff --git a/lib/behat/classes/behat_command.php b/lib/behat/classes/behat_command.php index f6116323a4e..2d231850858 100644 --- a/lib/behat/classes/behat_command.php +++ b/lib/behat/classes/behat_command.php @@ -220,7 +220,7 @@ class behat_command { } // If app config is supplied, check the value is correct. - if (!empty($CFG->behat_approot) && !file_exists($CFG->behat_approot . '/ionic.config.json')) { + if (!empty($CFG->behat_ionic_dirroot) && !file_exists($CFG->behat_ionic_dirroot . '/ionic.config.json')) { self::output_msg(get_string('errorapproot', 'tool_behat')); return BEHAT_EXITCODE_CONFIG; } diff --git a/lib/behat/classes/behat_config_util.php b/lib/behat/classes/behat_config_util.php index d964e42bf6e..0c729aebce2 100644 --- a/lib/behat/classes/behat_config_util.php +++ b/lib/behat/classes/behat_config_util.php @@ -705,12 +705,12 @@ class behat_config_util { protected function get_mobile_version_tags() : string { global $CFG; - if (empty($CFG->behat_approot)) { + if (empty($CFG->behat_ionic_dirroot)) { return ''; } // Get app version. - $jsonpath = $CFG->behat_approot . '/package.json'; + $jsonpath = $CFG->behat_ionic_dirroot . '/package.json'; $json = @file_get_contents($jsonpath); if (!$json) { throw new coding_exception('Unable to load app version from ' . $jsonpath); @@ -1360,7 +1360,7 @@ class behat_config_util { // Mobile app tests are not theme-specific, so run only for the default theme (and if // configured). - if (empty($CFG->behat_approot) || $theme !== $this->get_default_theme()) { + if (empty($CFG->behat_ionic_dirroot) || $theme !== $this->get_default_theme()) { $themeblacklisttags[] = '@app'; } diff --git a/lib/tests/behat/behat_app.php b/lib/tests/behat/behat_app.php index 04c63646d71..322d5cf92a0 100644 --- a/lib/tests/behat/behat_app.php +++ b/lib/tests/behat/behat_app.php @@ -103,8 +103,8 @@ class behat_app extends behat_base { } // Check the config settings are defined. - if (empty($CFG->behat_ionicaddress) && empty($CFG->behat_approot)) { - throw new DriverException('$CFG->behat_ionicaddress or $CFG->behat_approot must be defined.'); + if (empty($CFG->behat_ionic_wwwroot) && empty($CFG->behat_ionic_dirroot)) { + throw new DriverException('$CFG->behat_ionic_wwwroot or $CFG->behat_ionic_dirroot must be defined.'); } } @@ -176,15 +176,15 @@ class behat_app extends behat_base { protected function start_or_reuse_ionic() { global $CFG; - if (!empty($CFG->behat_ionicaddress)) { + if (!empty($CFG->behat_ionic_wwwroot)) { // Use supplied Ionic server which should already be running. - $url = $CFG->behat_ionicaddress; + $url = $CFG->behat_ionic_wwwroot; } else if (self::$ionicrunning) { // Use existing Ionic instance launched previously. $url = self::$ionicrunning->url; } else { // Open Ionic process in relevant path. - $path = realpath($CFG->behat_approot); + $path = realpath($CFG->behat_ionic_dirroot); $stderrfile = $CFG->dataroot . '/behat/ionic-stderr.log'; $prefix = ''; // Except on Windows, use 'exec' so that we get the pid of the actual Node process