diff --git a/local-moodleappbehat/tests/behat/behat_app_helper.php b/local-moodleappbehat/tests/behat/behat_app_helper.php index 3a3d07bdf..b2fff6892 100644 --- a/local-moodleappbehat/tests/behat/behat_app_helper.php +++ b/local-moodleappbehat/tests/behat/behat_app_helper.php @@ -512,9 +512,9 @@ class behat_app_helper extends behat_base { // Generate custom URL. $parsed_url = parse_url($CFG->behat_wwwroot); - $domain = $parsed_url['host']; - $rootpath = $parsed_url['path']; - $url = $this->get_mobile_url_scheme() . "://$username@$domain/$rootpath?token=$token&privatetoken=$privatetoken"; + $domain = $parsed_url['host'] ?? ''; + $rootpath = $parsed_url['path'] ?? ''; + $url = $this->get_mobile_url_scheme() . "://$username@$domain$rootpath?token=$token&privatetoken=$privatetoken"; if (!empty($path)) { $url .= '&redirect='.urlencode($CFG->behat_wwwroot.$path);