Skip to content
Snippets Groups Projects
Commit 0286c14b authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2149977 by JStanton: Run-tests.sh no longer respects specifying a port...

Issue #2149977 by JStanton: Run-tests.sh no longer respects specifying a port with the --url option.
parent 332c9fad
No related branches found
No related tags found
No related merge requests found
......@@ -270,6 +270,8 @@ function simpletest_script_init($server_software) {
$host = 'localhost';
$path = '';
$port = '80';
// Determine location of php command automatically, unless a command line argument is supplied.
if (!empty($args['php'])) {
$php = $args['php'];
......@@ -294,6 +296,7 @@ function simpletest_script_init($server_software) {
$parsed_url = parse_url($args['url']);
$host = $parsed_url['host'] . (isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '');
$path = isset($parsed_url['path']) ? rtrim($parsed_url['path']) : '';
$port = (isset($parsed_url['port']) ? $parsed_url['port'] : $port);
if ($path == '/') {
$path = '';
}
......@@ -307,6 +310,7 @@ function simpletest_script_init($server_software) {
$_SERVER['HTTP_HOST'] = $host;
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['SERVER_ADDR'] = '127.0.0.1';
$_SERVER['SERVER_PORT'] = $port;
$_SERVER['SERVER_SOFTWARE'] = $server_software;
$_SERVER['SERVER_NAME'] = 'localhost';
$_SERVER['REQUEST_URI'] = $path .'/';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment