diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-07-22 23:01:17 +0300 |
---|---|---|
committer | Stefan Giehl <stefan@piwik.org> | 2017-07-22 23:01:17 +0300 |
commit | 7214a9b504a79955804e28dce1cdf7583588eb96 (patch) | |
tree | 1c2eba1147da524c7ea8c554c74630e28f7fd175 /tests/PHPUnit | |
parent | 5387018f82e074a941ce4f50e37db68cb9066264 (diff) |
When tracker is in maintenande mode return HTTP status code 503 (instead of the current 200 and 400 http status cods) (#11773)
* When tracker is in maintenande mode, return HTTP status code 503 instead of the current status of 200 or 400
This will make our return code consistent with the UI which also returns 503 while in maintenance mode
Learn more about starting a maintenance window: https://piwik.org/faq/how-to-update/faq_154/
* Update TrackerResponseTest.php
* Update TrackerResponseTest.php
Diffstat (limited to 'tests/PHPUnit')
-rwxr-xr-x | tests/PHPUnit/System/TrackerResponseTest.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/PHPUnit/System/TrackerResponseTest.php b/tests/PHPUnit/System/TrackerResponseTest.php index 05f6b749c3..98cd27baa0 100755 --- a/tests/PHPUnit/System/TrackerResponseTest.php +++ b/tests/PHPUnit/System/TrackerResponseTest.php @@ -114,4 +114,14 @@ class TrackerResponseTest extends SystemTestCase $this->assertHttpResponseText($expected, $url); } + + public function test_response_ShouldReturnPiwikMessageWithHttp503_InCaseOfMaintenanceMode() + { + $url = $this->tracker->getUrlTrackPageView('Test'); + $this->assertResponseCode(200, $url); + + $url = $url . "&forceEnableTrackerMaintenanceMode=1"; + $this->assertResponseCode(503, $url); + } + } |