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:
authormattab <matthieu.aubry@gmail.com>2013-08-02 17:59:33 +0400
committermattab <matthieu.aubry@gmail.com>2013-08-02 17:59:33 +0400
commita96ec40e983a8b64f4c25def541a519ff3670e6a (patch)
treebef2a5f7b1e9532dc96161334e23a553cdff7ea1 /tests/PHPUnit/Benchmarks
parent61997f45e4c39360000e815c9e0853ae04e2f56f (diff)
Refs #4059 Converting dozens of plugins/* classes to use Namespaces, \Piwik\Plugins\*
Added namespaces to functions.php files in the five plugins that had one Work in progress
Diffstat (limited to 'tests/PHPUnit/Benchmarks')
-rw-r--r--tests/PHPUnit/Benchmarks/ArchiveQueryBenchmark.php5
-rwxr-xr-xtests/PHPUnit/Benchmarks/ArchivingProcessBenchmark.php4
-rw-r--r--tests/PHPUnit/Benchmarks/Fixtures/ManyThousandSitesOneVisitEach.php3
-rw-r--r--tests/PHPUnit/Benchmarks/Fixtures/OneSiteThousandsOfDistinctUrlsOverMonth.php3
-rwxr-xr-xtests/PHPUnit/Benchmarks/Fixtures/OneSiteTwelveThousandVisitsOneYear.php3
-rwxr-xr-xtests/PHPUnit/Benchmarks/Fixtures/ThousandSitesTwelveVisitsEachOneDay.php5
-rw-r--r--tests/PHPUnit/Benchmarks/MultiSitesBenchmark.php6
7 files changed, 19 insertions, 10 deletions
diff --git a/tests/PHPUnit/Benchmarks/ArchiveQueryBenchmark.php b/tests/PHPUnit/Benchmarks/ArchiveQueryBenchmark.php
index adf616fa27..2dcdbbec18 100644
--- a/tests/PHPUnit/Benchmarks/ArchiveQueryBenchmark.php
+++ b/tests/PHPUnit/Benchmarks/ArchiveQueryBenchmark.php
@@ -9,6 +9,7 @@ use Piwik\ArchiveProcessor\Rules;
use Piwik\DataAccess\ArchiveTableCreator;
use Piwik\Period;
use Piwik\Date;
+use Piwik\Plugins\VisitsSummary\API;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/BenchmarkTestCase.php';
@@ -24,7 +25,7 @@ class ArchiveQueryBenchmark extends BenchmarkTestCase
$archivingTables = ArchiveTableCreator::getTablesArchivesInstalled();
if (empty($archivingTables)) {
$this->archivingLaunched = true;
- Piwik_VisitsSummary_API::getInstance()->get(
+ API::getInstance()->get(
self::$fixture->idSite, self::$fixture->period, self::$fixture->date);
}
}
@@ -44,6 +45,6 @@ class ArchiveQueryBenchmark extends BenchmarkTestCase
$period = Period::factory(self::$fixture->period, Date::factory(self::$fixture->date));
$dateRange = $period->getDateStart().','.$period->getDateEnd();
- Piwik_VisitsSummary_API::getInstance()->get(self::$fixture->idSite, 'day', $dateRange);
+ API::getInstance()->get(self::$fixture->idSite, 'day', $dateRange);
}
}
diff --git a/tests/PHPUnit/Benchmarks/ArchivingProcessBenchmark.php b/tests/PHPUnit/Benchmarks/ArchivingProcessBenchmark.php
index ad5d4504f8..294ec73a12 100755
--- a/tests/PHPUnit/Benchmarks/ArchivingProcessBenchmark.php
+++ b/tests/PHPUnit/Benchmarks/ArchivingProcessBenchmark.php
@@ -5,6 +5,8 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+use Piwik\Plugins\VisitsSummary\API;
+
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/BenchmarkTestCase.php';
/**
@@ -23,7 +25,7 @@ class ArchivingProcessBenchmark extends BenchmarkTestCase
*/
public function testArchivingProcess()
{
- Piwik_VisitsSummary_API::getInstance()->get(
+ API::getInstance()->get(
self::$fixture->idSite, self::$fixture->period, self::$fixture->date);
}
}
diff --git a/tests/PHPUnit/Benchmarks/Fixtures/ManyThousandSitesOneVisitEach.php b/tests/PHPUnit/Benchmarks/Fixtures/ManyThousandSitesOneVisitEach.php
index 83569527d0..8f8fb4ef02 100644
--- a/tests/PHPUnit/Benchmarks/Fixtures/ManyThousandSitesOneVisitEach.php
+++ b/tests/PHPUnit/Benchmarks/Fixtures/ManyThousandSitesOneVisitEach.php
@@ -6,6 +6,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
use Piwik\Date;
+use Piwik\Plugins\Goals\API;
/**
* Reusable fixture. Adds 20,000 sites and tracks one pageview for each on one day.
@@ -23,7 +24,7 @@ class Piwik_Test_Fixture_ManyThousandSitesOneVisitEach
$idSite = Test_Piwik_BaseFixture::createWebsite(
$this->date, $ecommerce = 1, $siteName = "Site #$i", $siteUrl = "http://site$i.com/");
- Piwik_Goals_API::getInstance()->addGoal($idSite, 'all', 'url', 'http', 'contains', false, 5);
+ API::getInstance()->addGoal($idSite, 'all', 'url', 'http', 'contains', false, 5);
}
// track one visit for each site
diff --git a/tests/PHPUnit/Benchmarks/Fixtures/OneSiteThousandsOfDistinctUrlsOverMonth.php b/tests/PHPUnit/Benchmarks/Fixtures/OneSiteThousandsOfDistinctUrlsOverMonth.php
index 7696cda917..42b3718212 100644
--- a/tests/PHPUnit/Benchmarks/Fixtures/OneSiteThousandsOfDistinctUrlsOverMonth.php
+++ b/tests/PHPUnit/Benchmarks/Fixtures/OneSiteThousandsOfDistinctUrlsOverMonth.php
@@ -6,6 +6,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
use Piwik\Date;
+use Piwik\Plugins\Goals\API;
/**
* Adds one site and 1000 actions for every day of one month (January). Each
@@ -25,7 +26,7 @@ class Piwik_Test_Fixture_OneSiteThousandsOfDistinctUrlsOverMonth
$this->date, $ecommerce = 1, $siteName = "Site #0", $siteUrl = "http://whatever.com/");
// add two goals
- $goals = Piwik_Goals_API::getInstance();
+ $goals = API::getInstance();
$goals->addGoal($this->idSite, 'all', 'url', 'http', 'contains', false, 5);
$goals->addGoal($this->idSite, 'all', 'url', 'thing2', 'contains');
diff --git a/tests/PHPUnit/Benchmarks/Fixtures/OneSiteTwelveThousandVisitsOneYear.php b/tests/PHPUnit/Benchmarks/Fixtures/OneSiteTwelveThousandVisitsOneYear.php
index 743a77bad9..1d7ea0462b 100755
--- a/tests/PHPUnit/Benchmarks/Fixtures/OneSiteTwelveThousandVisitsOneYear.php
+++ b/tests/PHPUnit/Benchmarks/Fixtures/OneSiteTwelveThousandVisitsOneYear.php
@@ -6,6 +6,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
use Piwik\Date;
+use Piwik\Plugins\Goals\API;
/**
* Reusable fixture. Tracks twelve thousand page views over a year for one site.
@@ -25,7 +26,7 @@ class Piwik_Test_Fixture_OneSiteTwelveThousandVisitsOneYear
$this->date, $ecommerce = 1, $siteName = "Site #0", $siteUrl = "http://whatever.com/");
// add two goals
- $goals = Piwik_Goals_API::getInstance();
+ $goals = API::getInstance();
$goals->addGoal($this->idSite, 'all', 'url', 'http', 'contains', false, 5);
$goals->addGoal($this->idSite, 'all', 'url', 'http', 'contains');
diff --git a/tests/PHPUnit/Benchmarks/Fixtures/ThousandSitesTwelveVisitsEachOneDay.php b/tests/PHPUnit/Benchmarks/Fixtures/ThousandSitesTwelveVisitsEachOneDay.php
index e56a16a5df..2186c9e39c 100755
--- a/tests/PHPUnit/Benchmarks/Fixtures/ThousandSitesTwelveVisitsEachOneDay.php
+++ b/tests/PHPUnit/Benchmarks/Fixtures/ThousandSitesTwelveVisitsEachOneDay.php
@@ -6,6 +6,8 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
use Piwik\Date;
+use Piwik\Plugins\Goals\API as GoalsAPI;
+use Piwik\Plugins\SitesManager\API as SitesManagerAPI;
/**
* Reusable fixture. Tracks twelve thousand page views for 1000 sites on one day.
@@ -18,8 +20,7 @@ class Piwik_Test_Fixture_ThousandSitesTwelveVisitsEachOneDay
public function setUp()
{
- $sitesManager = Piwik_SitesManager_API::getInstance();
- $goals = Piwik_Goals_API::getInstance();
+ $goals = GoalsAPI::getInstance();
// add one thousand sites
$allIdSites = array();
diff --git a/tests/PHPUnit/Benchmarks/MultiSitesBenchmark.php b/tests/PHPUnit/Benchmarks/MultiSitesBenchmark.php
index a1390fc67a..1954ba168d 100644
--- a/tests/PHPUnit/Benchmarks/MultiSitesBenchmark.php
+++ b/tests/PHPUnit/Benchmarks/MultiSitesBenchmark.php
@@ -7,6 +7,8 @@
*/
use Piwik\ArchiveProcessor\Rules;
use Piwik\DataAccess\ArchiveTableCreator;
+use Piwik\Plugins\MultiSites\API as MultiSitesAPI;
+use Piwik\Plugins\VisitsSummary\API as VisitsSummaryAPI;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/BenchmarkTestCase.php';
@@ -22,7 +24,7 @@ class MultiSitesBenchmark extends BenchmarkTestCase
$archivingTables = ArchiveTableCreator::getTablesArchivesInstalled();
if (empty($archivingTables)) {
$this->archivingLaunched = true;
- Piwik_VisitsSummary_API::getInstance()->get(
+ VisitsSummaryAPI::getInstance()->get(
self::$fixture->idSite, self::$fixture->period, self::$fixture->date);
}
}
@@ -38,6 +40,6 @@ class MultiSitesBenchmark extends BenchmarkTestCase
}
Rules::$archivingDisabledByTests = true;
- Piwik_MultiSites_API::getInstance()->getAll(self::$fixture->period, self::$fixture->date);
+ MultiSitesAPI::getInstance()->getAll(self::$fixture->period, self::$fixture->date);
}
}