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:
authorThomas Steur <thomas.steur@googlemail.com>2014-10-05 15:05:47 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-10-05 15:05:47 +0400
commit5a1eab97f54b44f57356b4276b9c9df2a8eef51b (patch)
tree83864ece2806ccf6e6bb49abf3fd65de92c13ad8 /tests/PHPUnit/System/MultipleSitesArchivingTest.php
parent19bcd2d262343eae9d553378e4c66ce7e033b4d8 (diff)
refs #5940 put tests in correct folders, better testsuite names, some tests still fail and I cannot figure out why
Diffstat (limited to 'tests/PHPUnit/System/MultipleSitesArchivingTest.php')
-rw-r--r--tests/PHPUnit/System/MultipleSitesArchivingTest.php60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/PHPUnit/System/MultipleSitesArchivingTest.php b/tests/PHPUnit/System/MultipleSitesArchivingTest.php
new file mode 100644
index 0000000000..6d447abb2f
--- /dev/null
+++ b/tests/PHPUnit/System/MultipleSitesArchivingTest.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Tests\System;
+
+use Piwik\Config;
+use Piwik\Piwik;
+use Piwik\Tests\Fixture;
+use Piwik\Tests\Fixtures\ThreeSitesWithSharedVisitors;
+use Piwik\Tests\SystemTestCase;
+
+/**
+ * @group Core
+ * @group MultipleSitesArchivingTest
+ */
+class MultipleSitesArchivingTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public static function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ $extraSite = Fixture::createWebsite(self::$fixture->dateTime, $ecommerce = 1, "the site");
+
+ Piwik::addAction("ArchiveProcessor.Parameters.getIdSites", function (&$sites, $period) use ($extraSite) {
+ if (reset($sites) == $extraSite) {
+ $sites = array(1, 2, 3);
+ }
+ });
+
+ Config::getInstance()->General['enable_processing_unique_visitors_multiple_sites'] = 1;
+ }
+
+ public function getApiForTesting()
+ {
+ $dateTime = self::$fixture->dateTime;
+
+ return array(
+ array('VisitsSummary.get', array('idSite' => 4,
+ 'date' => $dateTime,
+ 'periods' => array('day', 'month'),
+ 'testSuffix' => '_sitesGroup')),
+ );
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+}
+
+MultipleSitesArchivingTest::$fixture = new ThreeSitesWithSharedVisitors(); \ No newline at end of file