Exemplo n.º 1
0
 public function tearDown()
 {
     WidgetsList::getInstance()->_reset();
     MenuReporting::getInstance()->unsetInstance();
     Translate::unloadEnglishTranslation();
     unset($_GET['idSite']);
     parent::tearDown();
 }
Exemplo n.º 2
0
 public function performTearDown()
 {
     // Note: avoid run SQL in the *tearDown() metohds because it randomly fails on Travis CI
     // with error Error while sending QUERY packet. PID=XX
     $this->tearDown();
     self::unloadAllPlugins();
     if ($this->dropDatabaseInTearDown) {
         $this->dropDatabase();
     }
     DataTableManager::getInstance()->deleteAll();
     Option::clearCache();
     Site::clearCache();
     Cache::deleteTrackerCache();
     Config::getInstance()->clear();
     ArchiveTableCreator::clear();
     \Piwik\Plugins\ScheduledReports\API::$cache = array();
     \Piwik\Registry::unsetInstance();
     \Piwik\EventDispatcher::getInstance()->clearAllObservers();
     $_GET = $_REQUEST = array();
     Translate::unloadEnglishTranslation();
     Config::unsetInstance();
     \Piwik\Config::getInstance()->Plugins;
     // make sure Plugins exists in a config object for next tests that use Plugin\Manager
     // since Plugin\Manager uses getFromGlobalConfig which doesn't init the config object
 }
Exemplo n.º 3
0
 public function tearDown()
 {
     Translate::unloadEnglishTranslation();
 }
Exemplo n.º 4
0
 /**
  * @dataProvider getGetPrettyValueTestCases
  */
 public function testGetPrettyValue($columnName, $value, $expected)
 {
     Translate::loadEnglishTranslation();
     $access = Access::getInstance();
     $access->setSuperUserAccess(true);
     $idsite = API::getInstance()->addSite("test", "http://test");
     $this->assertEquals($expected, MetricsFormatter::getPrettyValue($idsite, $columnName, $value, false, false));
     Translate::unloadEnglishTranslation();
 }
Exemplo n.º 5
0
 public function clearInMemoryCaches()
 {
     DataTableManager::getInstance()->deleteAll();
     Option::clearCache();
     Site::clearCache();
     Cache::deleteTrackerCache();
     Config::getInstance()->clear();
     ArchiveTableCreator::clear();
     \Piwik\Plugins\ScheduledReports\API::$cache = array();
     \Piwik\Registry::unsetInstance();
     \Piwik\EventDispatcher::getInstance()->clearAllObservers();
     $_GET = $_REQUEST = array();
     Translate::unloadEnglishTranslation();
     Config::unsetInstance();
     \Piwik\Config::getInstance()->Plugins;
     // make sure Plugins exists in a config object for next tests that use Plugin\Manager
     // since Plugin\Manager uses getFromGlobalConfig which doesn't init the config object
 }