diff --git a/ext/simpletest/main.php b/ext/simpletest/main.php index afd3b372..116a7ff7 100644 --- a/ext/simpletest/main.php +++ b/ext/simpletest/main.php @@ -111,8 +111,8 @@ class SCoreWebTestCase extends WebTestCase { */ protected function get_page($page) { // Check if we are running on the command line - if(php_sapi_name() === 'cli' || $_SERVER['HTTP_HOST'] == "") { - $host = rtrim(trim(constant("_TRAVIS_WEBHOST")), "/"); + if(php_sapi_name() == 'cli' || $_SERVER['HTTP_HOST'] == "") { + $host = constant("_TRAVIS_WEBHOST"); $this->assertFalse(empty($host)); // Make sure that we know the host address. $raw = $this->get($host."/index.php?q=".str_replace("?", "&", $page)); } diff --git a/tests/all_tests.php b/tests/all_tests.php index 6a5a96a8..f30c7cca 100644 --- a/tests/all_tests.php +++ b/tests/all_tests.php @@ -17,10 +17,10 @@ error_reporting(E_ALL); define("CLI_LOG_LEVEL", -100); // output everything. // Get the command line option telling us where the webserver is. -$options = getopt("h::"); -$host = trim($options["h"], "'\""); +$options = getopt("h:"); +$host = rtrim(trim($options["h"], "/"); -if (empty($host)){ $host = "http://127.0.0.1/"; } +if (empty($host)){ $host = "http://127.0.0.1"; } define("_TRAVIS_WEBHOST", $host); diff --git a/tests/test_install.php b/tests/test_install.php index abb4d652..ef0b16da 100644 --- a/tests/test_install.php +++ b/tests/test_install.php @@ -16,12 +16,12 @@ require_once('lib/simpletest/reporter.php'); error_reporting(E_ALL); // Get the command line option telling us what database to use. -$options = getopt("d:h::"); +$options = getopt("d:h:"); $db = $options["d"]; -$host = trim($options["h"], "'\""); +$host = rtrim(trim($options["h"], "/"); if (empty($db)){ die("Error: need to specifiy a database for the test environment."); } -if (empty($host)){ $host = "http://127.0.0.1/"; } +if (empty($host)){ $host = "http://127.0.0.1"; } define("_TRAVIS_DATABASE", $db); define("_TRAVIS_WEBHOST", $host);