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 /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 'tests')
-rw-r--r-- | tests/PHPUnit/proxy/nodispatchnotinstalled.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/PHPUnit/proxy/nodispatchnotinstalled.php b/tests/PHPUnit/proxy/nodispatchnotinstalled.php new file mode 100644 index 0000000000..f4fabeecf1 --- /dev/null +++ b/tests/PHPUnit/proxy/nodispatchnotinstalled.php @@ -0,0 +1,20 @@ +<?php +/** + * Proxy to index.php, but will use the Test DB + * Used by tests/PHPUnit/System/ImportLogsTest.php and tests/PHPUnit/System/UITest.php + */ + +use Piwik\Application\Environment; +use Piwik\Tests\Framework\TestingEnvironmentManipulator; +use Piwik\Tests\Framework\TestingEnvironmentVariables; + +define('PIWIK_ENABLE_DISPATCH', false); + +require realpath(dirname(__FILE__)) . "/includes.php"; +$testEnvironment = new TestingEnvironmentVariables(); +$testEnvironment->configFileLocal = PIWIK_INCLUDE_PATH . "tmp/test.config.ini.php"; +$testEnvironment->save(); + +Environment::setGlobalEnvironmentManipulator(new TestingEnvironmentManipulator($testEnvironment)); + +include PIWIK_INCLUDE_PATH . '/index.php';
\ No newline at end of file |