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:
authorLukas Winkler <git@lw1.at>2020-05-10 23:13:11 +0300
committerGitHub <noreply@github.com>2020-05-10 23:13:11 +0300
commit8b21dbf2cfb06e9c9ed9ecbbd07e3b6b386bba3b (patch)
treeb8eada6c5209c0754734a36c9156b63b4c4744db
parent6c33f7d2786817416617dc0457629bb9341f1aa4 (diff)
add a more helpful info to the default matomo.php output (#15828)
-rw-r--r--core/Tracker/Response.php3
-rw-r--r--tests/PHPUnit/Integration/TrackerTest.php2
-rw-r--r--tests/PHPUnit/System/TrackerResponseTest.php4
-rw-r--r--tests/PHPUnit/Unit/Tracker/ResponseTest.php2
4 files changed, 6 insertions, 5 deletions
diff --git a/core/Tracker/Response.php b/core/Tracker/Response.php
index 2a3a690a94..21c25f7168 100644
--- a/core/Tracker/Response.php
+++ b/core/Tracker/Response.php
@@ -79,7 +79,8 @@ class Response
Common::sendResponseCode(400);
}
Common::printDebug("Empty request => Matomo page");
- echo "This resource is part of Matomo. Keep full control of your data with the leading free and open source <a href='https://matomo.org' target='_blank' rel='noopener noreferrer nofollow'>web analytics & conversion optimisation platform</a>.";
+ echo "This resource is part of Matomo. Keep full control of your data with the leading free and open source <a href='https://matomo.org' target='_blank' rel='noopener noreferrer nofollow'>web analytics & conversion optimisation platform</a>.<br>\n";
+ echo "This file is the endpoint for the Matomo tracking API. If you want to access the Matomo UI or use the Reporting API, please use <a href='index.php'>index.php</a> instead.";
} else {
$this->outputApiResponse($tracker);
Common::printDebug("Nothing to notice => default behaviour");
diff --git a/tests/PHPUnit/Integration/TrackerTest.php b/tests/PHPUnit/Integration/TrackerTest.php
index 4561ea0e32..1869984a5f 100644
--- a/tests/PHPUnit/Integration/TrackerTest.php
+++ b/tests/PHPUnit/Integration/TrackerTest.php
@@ -259,7 +259,7 @@ class TrackerTest extends IntegrationTestCase
$response = $this->tracker->main($this->getDefaultHandler(), $requestSet);
- $expected = "This resource is part of Matomo. Keep full control of your data with the leading free and open source <a href='https://matomo.org' target='_blank' rel='noopener noreferrer nofollow'>web analytics & conversion optimisation platform</a>.";
+ $expected = "This resource is part of Matomo. Keep full control of your data with the leading free and open source <a href='https://matomo.org' target='_blank' rel='noopener noreferrer nofollow'>web analytics & conversion optimisation platform</a>.<br>\nThis file is the endpoint for the Matomo tracking API. If you want to access the Matomo UI or use the Reporting API, please use <a href='index.php'>index.php</a> instead.";
$this->assertEquals($expected, $response);
}
diff --git a/tests/PHPUnit/System/TrackerResponseTest.php b/tests/PHPUnit/System/TrackerResponseTest.php
index 8824b08319..f081ffcc16 100644
--- a/tests/PHPUnit/System/TrackerResponseTest.php
+++ b/tests/PHPUnit/System/TrackerResponseTest.php
@@ -134,7 +134,7 @@ class TrackerResponseTest extends SystemTestCase
$response = Http::sendHttpRequest($url, 10, null, null, 0, false, false, true);
$this->assertEquals(200, $response['status']);
- $expected = "This resource is part of Matomo. Keep full control of your data with the leading free and open source <a href='https://matomo.org' target='_blank' rel='noopener noreferrer nofollow'>web analytics & conversion optimisation platform</a>.";
+ $expected = "This resource is part of Matomo. Keep full control of your data with the leading free and open source <a href='https://matomo.org' target='_blank' rel='noopener noreferrer nofollow'>web analytics & conversion optimisation platform</a>.<br>\nThis file is the endpoint for the Matomo tracking API. If you want to access the Matomo UI or use the Reporting API, please use <a href='index.php'>index.php</a> instead.";
$this->assertEquals($expected, $response['data']);
}
@@ -145,7 +145,7 @@ class TrackerResponseTest extends SystemTestCase
$this->assertEquals(400, $response['status']);
$response = $this->sendHttpRequest($url);
- $expected = "This resource is part of Matomo. Keep full control of your data with the leading free and open source <a href='https://matomo.org' target='_blank' rel='noopener noreferrer nofollow'>web analytics & conversion optimisation platform</a>.";
+ $expected = "This resource is part of Matomo. Keep full control of your data with the leading free and open source <a href='https://matomo.org' target='_blank' rel='noopener noreferrer nofollow'>web analytics & conversion optimisation platform</a>.<br>\nThis file is the endpoint for the Matomo tracking API. If you want to access the Matomo UI or use the Reporting API, please use <a href='index.php'>index.php</a> instead.";
$this->assertEquals($expected, $response['data']);
}
diff --git a/tests/PHPUnit/Unit/Tracker/ResponseTest.php b/tests/PHPUnit/Unit/Tracker/ResponseTest.php
index c796e04caa..785ed6ee94 100644
--- a/tests/PHPUnit/Unit/Tracker/ResponseTest.php
+++ b/tests/PHPUnit/Unit/Tracker/ResponseTest.php
@@ -127,7 +127,7 @@ class ResponseTest extends \PHPUnit\Framework\TestCase
$tracker->setCountOfLoggedRequests(0);
$this->response->outputResponse($tracker);
- $this->assertEquals("This resource is part of Matomo. Keep full control of your data with the leading free and open source <a href='https://matomo.org' target='_blank' rel='noopener noreferrer nofollow'>web analytics & conversion optimisation platform</a>.",
+ $this->assertEquals("This resource is part of Matomo. Keep full control of your data with the leading free and open source <a href='https://matomo.org' target='_blank' rel='noopener noreferrer nofollow'>web analytics & conversion optimisation platform</a>.<br>\nThis file is the endpoint for the Matomo tracking API. If you want to access the Matomo UI or use the Reporting API, please use <a href='index.php'>index.php</a> instead.",
$this->response->getOutput());
}