Merge pull request #3298 from crazyserver/MOBILE-4061

MOBILE-4061 behat: Fix custom url with path on root
main
Noel De Martin 2022-05-30 11:27:08 +02:00 committed by GitHub
commit d75e876cad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -513,7 +513,8 @@ class behat_app_helper extends behat_base {
// Generate custom URL.
$parsed_url = parse_url($CFG->behat_wwwroot);
$domain = $parsed_url['host'];
$url = $this->get_mobile_url_scheme() . "://$username@$domain?token=$token&privatetoken=$privatetoken";
$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);