diff --git a/tests/PHPUnit/TestingEnvironment.php b/tests/PHPUnit/TestingEnvironment.php
index <HASH>..<HASH> 100644
--- a/tests/PHPUnit/TestingEnvironment.php
+++ b/tests/PHPUnit/TestingEnvironment.php
@@ -136,6 +136,10 @@ class Piwik_TestingEnvironment
             }
         }
 
+        if ($testingEnvironment->hostOverride) {
+            \Piwik\Url::setHost($testingEnvironment->hostOverride);
+        }
+
         if ($testingEnvironment->useXhprof) {
             \Piwik\Profiler::setupProfilerXHProf($mainRun = false, $setupDuringTracking = true);
         }
Allow test code to override URL host.