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:
authordiosmosis <benaka@piwik.pro>2015-05-21 00:48:03 +0300
committerdiosmosis <benaka@piwik.pro>2015-05-21 18:32:41 +0300
commitadfe1bb8b0822dca1daecfce1062fdd36ade7bf6 (patch)
tree725a1b772de8d32e71aadff2239fbb0ce0c61a95 /tests/PHPUnit/proxy
parent0647faa7d74f16371475e24ccf8e9ad56e4b149b (diff)
Define observer in proxy piwik.php through TestingEnvironment, instead of calling Piwik::addAction, since the latter needs the DI container (which is not setup yet).
Diffstat (limited to 'tests/PHPUnit/proxy')
-rwxr-xr-xtests/PHPUnit/proxy/piwik.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/PHPUnit/proxy/piwik.php b/tests/PHPUnit/proxy/piwik.php
index b5a984cd00..078069b30f 100755
--- a/tests/PHPUnit/proxy/piwik.php
+++ b/tests/PHPUnit/proxy/piwik.php
@@ -20,16 +20,18 @@ require realpath(dirname(__FILE__)) . "/includes.php";
ob_start();
try {
- Piwik_TestingEnvironment::addHooks();
+ $globalObservers = array(
+ array('Environment.bootstrapped', function () {
+ Tracker::setTestEnvironment();
+ Manager::getInstance()->deleteAll();
+ Option::clearCache();
+ Site::clearCache();
+ })
+ );
- GeoIp::$geoIPDatabaseDir = 'tests/lib/geoip-files';
+ Piwik_TestingEnvironment::addHooks($globalObservers);
- \Piwik\Piwik::addAction('Environment.bootstrapped', function () {
- Tracker::setTestEnvironment();
- Manager::getInstance()->deleteAll();
- Option::clearCache();
- Site::clearCache();
- });
+ GeoIp::$geoIPDatabaseDir = 'tests/lib/geoip-files';
include PIWIK_INCLUDE_PATH . '/piwik.php';
} catch (Exception $ex) {