From 2bb3ff81e11bbc991c240ee74bf16d61674e143d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 30 May 2022 13:41:26 +0200 Subject: [PATCH] MOBILE-4061 behat: Fix custom url with path on root --- local-moodleappbehat/tests/behat/behat_app_helper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);