Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2018-06-07 00:24:06 +0300
committerdiosmosis <diosmosis@users.noreply.github.com>2018-06-07 00:24:06 +0300
commitde942d0fa0b7b7d12c81873b0cb2152b5d38b32e (patch)
tree21a6912f50ec3ada2a111f919cc8cbd27a45c2f1 /tests/PHPUnit
parent947b6b835e47161504fdd285fcbf7facef89db08 (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.php7
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;
}
}