public function getApiForTesting()
 {
     // we will test all segments from all plugins
     Fixture::loadAllPlugins();
     $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');
     return array(array($apiToCall, array('idSite' => 'all', 'date' => self::$fixture->dateTime, 'periods' => array('day', 'week'), 'setDateLastN' => true, 'segment' => $this->getSegmentToTest())));
 }
コード例 #2
0
ファイル: SegmentTest.php プロジェクト: a4tunado/piwik
 public function setUp()
 {
     parent::setUp();
     // setup the access layer (required in Segment contrustor testing if anonymous is allowed to use segments)
     $pseudoMockAccess = new FakeAccess();
     FakeAccess::$superUser = true;
     Access::setSingletonInstance($pseudoMockAccess);
     Fixture::loadAllPlugins();
 }
コード例 #3
0
ファイル: AutoSuggestAPITest.php プロジェクト: a4tunado/piwik
 public function getApiForTesting()
 {
     // we will test all segments from all plugins
     Fixture::loadAllPlugins();
     $idSite = self::$fixture->idSite;
     $apiForTesting = array();
     $segments = \Piwik\Plugins\API\API::getInstance()->getSegmentsMetadata(self::$fixture->idSite);
     foreach ($segments as $segment) {
         $apiForTesting[] = $this->getApiForTestingForSegment($idSite, $segment['segment']);
     }
     if (self::isMysqli() || self::isTravisCI()) {
         // Skip the test on Mysqli as it fails due to rounding Float errors on latitude/longitude
         // then the test started failing after bc19503 and I cannot understand why
         echo "Skipped test \n";
     } else {
         $apiForTesting[] = array('Live.getLastVisitsDetails', array('idSite' => $idSite, 'date' => '1998-07-12,today', 'period' => 'range', 'otherRequestParameters' => array('filter_limit' => 1000)));
     }
     return $apiForTesting;
 }
コード例 #4
0
 public function setUp()
 {
     \Piwik\Tests\Fixture::loadAllPlugins();
 }