Merge branch '71992-master-fix-behat-tests-on-https' of https://github.com/DSI-Universite-Rennes2/moodle

This commit is contained in:
Víctor Déniz 2021-08-11 14:32:20 +01:00
commit 5f0690f5db
2 changed files with 82 additions and 1 deletions

View file

@ -400,7 +400,9 @@ function behat_update_vars_for_process() {
function behat_is_requested_url($url) {
$parsedurl = parse_url($url . '/');
$parsedurl['port'] = isset($parsedurl['port']) ? $parsedurl['port'] : 80;
if (!isset($parsedurl['port'])) {
$parsedurl['port'] = ($parsedurl['scheme'] === 'https') ? 443 : 80;
}
$parsedurl['path'] = rtrim($parsedurl['path'], '/');
// Removing the port.