MOBILE-4110 behat: Fix custom url generation

main
Noel De Martin 2022-07-05 09:22:32 +02:00
parent 52259b421f
commit 185b9fc9c6
1 changed files with 4 additions and 3 deletions

View File

@ -540,9 +540,10 @@ 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";
$site = $parsed_url['host'] ?? '';
$site .= isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
$site .= $parsed_url['path'] ?? '';
$url = $this->get_mobile_url_scheme() . "://$username@$site?token=$token&privatetoken=$privatetoken";
if (!empty($path)) {
$url .= '&redirect='.urlencode($CFG->behat_wwwroot.$path);