diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-03-13 04:16:30 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2019-03-13 04:16:30 +0300 |
commit | 7393e13b1cd8deda984037192d3d9c13e3cd67aa (patch) | |
tree | 374454eb3ae55ad256881058855c48312fb1e09e /plugins/Installation/tests | |
parent | def74364a2d821d5dddaceece76c217547b99d14 (diff) |
When dispatch is disabled via a constant, it should not be dispatched (#14034)
* When dispatch is disabled via a constant, it should not be dispatched
Eg when Matomo is not installed, it would still dispatch the request in https://github.com/matomo-org/matomo/blob/3.8.1-b1/plugins/Installation/Installation.php#L111 even when `PIWIK_ENABLE_DISPATCH` is disabled.
Will set it to WIP for now as I'm not sure if we want to have this actually merged or not.
* Update Installation.php
* Use correct exception class
* throw exception if one is given
* adding a test
* fix tests
* trying to fix test
Diffstat (limited to 'plugins/Installation/tests')
-rw-r--r-- | plugins/Installation/tests/System/APITest.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/Installation/tests/System/APITest.php b/plugins/Installation/tests/System/APITest.php index d8ae5523c8..887e5e17ba 100644 --- a/plugins/Installation/tests/System/APITest.php +++ b/plugins/Installation/tests/System/APITest.php @@ -61,6 +61,13 @@ class APITest extends SystemTestCase $this->assertContains('Access denied', $data); } + public function test_shouldReturnEmptyResultWhenNotInstalledAndDispatchIsDisabled() + { + $url = Fixture::getTestRootUrl() . 'nodispatchnotinstalled.php'; + $response = $this->sendHttpRequest($url); + $this->assertSame('', $response['data']); + } + private function getUrl() { return Fixture::getRootUrl() . 'tests/PHPUnit/proxy/index.php?module=API&method=API.getPiwikVersion'; |