Exemple #1
0
 public function setUp()
 {
     parent::setUp();
     PiwikCache::flushAll();
     Translate::loadAllTranslations();
     $this->api = API::getInstance();
 }
Exemple #2
0
 public function setUp()
 {
     parent::setUp();
     StaticCache::clearAll();
     PluginAwareStaticCache::clearAll();
     Translate::reloadLanguage('en');
     $this->api = API::getInstance();
 }
Exemple #3
0
 public static function canDisplayViewDataTable(ViewDataTable $view)
 {
     $period = Common::getRequestVar('period', null, 'string');
     $date = Common::getRequestVar('date', null, 'string');
     $canGenerateInsights = API::getInstance()->canGenerateInsights($date, $period);
     if (!$canGenerateInsights) {
         return false;
     }
     if ($view->requestConfig->apiMethodToRequestDataTable && 0 === strpos($view->requestConfig->apiMethodToRequestDataTable, 'DBStats')) {
         return false;
     }
     return parent::canDisplayViewDataTable($view);
 }
Exemple #4
0
 public function setUp()
 {
     parent::setUp();
     $this->api = API::getInstance();
 }
 private function canGenerateInsights()
 {
     $period = Common::getRequestVar('period', null, 'string');
     $date = Common::getRequestVar('date', null, 'string');
     return API::getInstance()->canGenerateInsights($date, $period);
 }