diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2018-06-07 00:24:06 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2018-06-07 00:24:06 +0300 |
commit | de942d0fa0b7b7d12c81873b0cb2152b5d38b32e (patch) | |
tree | 21a6912f50ec3ada2a111f919cc8cbd27a45c2f1 /tests/PHPUnit | |
parent | 947b6b835e47161504fdd285fcbf7facef89db08 (diff) |
Replace piwik url with example url when not having a protocol (#13034)
Eg when a test contains `//localhost/...` then it will be replaced with `//example.com/piwik` in the future so there is no difference between travis and local
Diffstat (limited to 'tests/PHPUnit')
-rw-r--r-- | tests/PHPUnit/Framework/TestRequest/Response.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/PHPUnit/Framework/TestRequest/Response.php b/tests/PHPUnit/Framework/TestRequest/Response.php index dd7b13baaf..91f269eb09 100644 --- a/tests/PHPUnit/Framework/TestRequest/Response.php +++ b/tests/PHPUnit/Framework/TestRequest/Response.php @@ -295,6 +295,11 @@ class Response */ private function replacePiwikUrl($apiResponse) { - return str_replace(Fixture::getRootUrl(), "http://example.com/piwik/", $apiResponse); + $rootUrl = Fixture::getRootUrl(); + $rootUrlRel = str_replace(array('http://', 'https://'), '//', $rootUrl); + + $apiResponse = str_replace($rootUrl, "http://example.com/piwik/", $apiResponse); + $apiResponse = str_replace($rootUrlRel, "//example.com/piwik/", $apiResponse); + return $apiResponse; } } |