From 78483ed0f73f163d2f30dec9da3ac2c0ffe8ff3e Mon Sep 17 00:00:00 2001
From: mattab <matthieu.aubry@gmail.com>
Date: Fri, 11 Sep 2015 11:10:36 +1200
Subject: [PATCH] Append request_uri to the Piwik URL in tests refs #7253 #6645

---
 tests/PHPUnit/Framework/Fixture.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php
index 2696888bcb..c8cb6d6783 100644
--- a/tests/PHPUnit/Framework/Fixture.php
+++ b/tests/PHPUnit/Framework/Fixture.php
@@ -462,6 +462,7 @@ class Fixture extends \PHPUnit_Framework_Assert
     public static function getRootUrl()
     {
         $piwikUrl = Config::getInstance()->tests['http_host'];
+        $piwikUri = Config::getInstance()->tests['request_uri'];
 
         if (strpos($piwikUrl, 'http://') !== 0) {
             $piwikUrl = 'http://' . $piwikUrl . '/';
@@ -482,6 +483,9 @@ class Fixture extends \PHPUnit_Framework_Assert
         // we don't want to require Travis CI or devs to setup HTTPS on their local machine
         $piwikUrl = str_replace("https://", "http://", $piwikUrl);
 
+        // append REQUEST_URI (eg. when Piwik runs at http://localhost/piwik/)
+        $piwikUrl .= $piwikUri;
+
         return $piwikUrl;
     }
 
-- 
GitLab