From ac4245ff272f9d7e6f0804db6abe6b53eeff36a9 Mon Sep 17 00:00:00 2001 From: diosmosis <benaka@piwik.pro> Date: Tue, 22 Sep 2015 01:00:12 -0700 Subject: [PATCH] Add port in tests to tracker URL. --- config/global.ini.php | 2 +- tests/PHPUnit/Framework/Fixture.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/global.ini.php b/config/global.ini.php index c287f21e46..060167b920 100644 --- a/config/global.ini.php +++ b/config/global.ini.php @@ -44,7 +44,7 @@ schema = Mysql http_host = localhost remote_addr = "127.0.0.1" request_uri = "@REQUEST_URI@" -port = 80 +port = ; access key and secret as listed in AWS -> IAM -> Users aws_accesskey = "" diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php index 8890d12766..da83196a5e 100644 --- a/tests/PHPUnit/Framework/Fixture.php +++ b/tests/PHPUnit/Framework/Fixture.php @@ -468,11 +468,16 @@ class Fixture extends \PHPUnit_Framework_Assert { $piwikUrl = Config::getInstance()->tests['http_host']; $piwikUri = Config::getInstance()->tests['request_uri']; + $piwikPort = Config::getInstance()->tests['port']; if($piwikUri == '@REQUEST_URI@') { throw new Exception("Piwik is mis-configured. Remove (or fix) the 'request_uri' entry below [tests] section in your config.ini.php. "); } + if (!empty($piwikPort)) { + $piwikUrl = $piwikUrl . ':' . $piwikPort; + } + if (strpos($piwikUrl, 'http://') !== 0) { $piwikUrl = 'http://' . $piwikUrl . '/'; } @@ -523,7 +528,6 @@ class Fixture extends \PHPUnit_Framework_Assert */ public static function getTracker($idSite, $dateTime, $defaultInit = true, $useLocal = false) { - echo "Found tracker URL to be: " . self::getTrackerUrl() . "\n"; if ($useLocal) { require_once PIWIK_INCLUDE_PATH . '/tests/LocalTracker.php'; $t = new Piwik_LocalTracker($idSite, self::getTrackerUrl()); -- GitLab