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
path: root/tests
diff options
context:
space:
mode:
authorBenaka Moorthi <benaka.moorthi@gmail.com>2013-07-07 04:17:51 +0400
committerBenaka Moorthi <benaka.moorthi@gmail.com>2013-07-07 04:17:51 +0400
commit83dafbe37cb29bc80481ec3395e7c3ed5b106666 (patch)
tree01083242b81208ab2b8790777ffa5f681bc34080 /tests
parent35b84538f8bc82f03049a5414f46b918fdd5d96c (diff)
Allow aspects of the testing environment to be init-ed by setting globals so it is not required to include of all of Piwik.
Diffstat (limited to 'tests')
-rw-r--r--tests/PHPUnit/proxy/index.php20
1 files changed, 4 insertions, 16 deletions
diff --git a/tests/PHPUnit/proxy/index.php b/tests/PHPUnit/proxy/index.php
index 187aa0c0ae..86c2935ea4 100644
--- a/tests/PHPUnit/proxy/index.php
+++ b/tests/PHPUnit/proxy/index.php
@@ -6,6 +6,9 @@
*
*/
+$GLOBALS['PIWIK_CONFIG_TEST_ENVIRONMENT'] = true;
+$GLOBALS['PIWIK_ACCESS_IS_SUPERUSER'] = true;
+
// Wrapping the request inside ob_start() calls to ensure that the Test
// calling us waits for the full request to process before unblocking
ob_start();
@@ -19,26 +22,11 @@ require_once PIWIK_INCLUDE_PATH . '/core/Loader.php';
Piwik_Tracker::setTestEnvironment();
Piwik_Tracker_Cache::deleteTrackerCache();
-class Piwik_FrontController_Test extends Piwik_FrontController
-{
- protected function createConfigObject()
- {
- // Config files forced to use the test database
- Piwik_Config::getInstance()->setTestEnvironment();
- }
-
- protected function createAccessObject()
- {
- parent::createAccessObject();
- Piwik::setUserIsSuperUser(true);
- }
-}
-
// Disable index.php dispatch since we do it manually below
define('PIWIK_ENABLE_DISPATCH', false);
include PIWIK_INCLUDE_PATH . '/index.php';
-$controller = new Piwik_FrontController_Test;
+$controller = new Piwik_FrontController;
$controller->init();
$controller->dispatch();