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
path: root/tests
diff options
context:
space:
mode:
authordiosmosis <benaka.moorthi@gmail.com>2013-04-13 07:18:57 +0400
committerdiosmosis <benaka.moorthi@gmail.com>2013-04-13 07:18:57 +0400
commite6b6d8a6c563caca82b613fadf49f9194965f040 (patch)
tree3bb74d989e8e34d50c03eb1c3074873c2175ca22 /tests
parent5444603da9e3ed24517ef51bef1c55d656efe6b0 (diff)
Refs #3116, make summary row label readable in ecommerce goals reports and add tests for those changes.
Diffstat (limited to 'tests')
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php24
-rwxr-xr-xtests/PHPUnit/Integration/BlobReportLimitingTest.php8
-rw-r--r--tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsCategory_day.xml21
-rw-r--r--tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsName_day.xml21
-rw-r--r--tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsSku_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsCategory_day.xml21
-rw-r--r--tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsName_day.xml21
-rw-r--r--tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsSku_day.xml2
8 files changed, 119 insertions, 1 deletions
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
index 6c8d2a2834..dfeac8e7c2 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
@@ -15,6 +15,12 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Test_Piwik_B
{
public $idSite = 1;
public $dateTime = '2010-01-03 01:22:33';
+ public $nextDay = null;
+
+ public function __construct()
+ {
+ $this->nextDay = Piwik_Date::factory($this->dateTime)->addDay(1)->getDatetime();
+ }
public function setUp()
{
@@ -107,6 +113,9 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Test_Piwik_B
// track outlinks
$this->trackActions($t, $visitorCounter, 'outlink', $userAgents, $resolutions);
+
+ // track ecommerce product orders
+ $this->trackOrders($t);
}
private function trackActions($t, &$visitorCounter, $actionType, $userAgents, $resolutions,
@@ -159,6 +168,21 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Test_Piwik_B
}
}
}
+
+ private function trackOrders($t)
+ {
+ $nextDay = Piwik_Date::factory($this->nextDay);
+ $t->setForceVisitDateTime($nextDay);
+
+ for ($i = 0; $i != 25; ++$i) {
+ $cat = $i % 5;
+
+ $t->setNewVisitorId();
+ $t->setIp("155.5.4.$i");
+ $t->setEcommerceView("id_book$i", "Book$i", "Books Cat #$cat", 7.50);
+ self::checkResponse($t->doTrackPageView('bought book'));
+ }
+ }
private function trackAction($t, $actionType, $visitorCounter, $actionNum)
{
diff --git a/tests/PHPUnit/Integration/BlobReportLimitingTest.php b/tests/PHPUnit/Integration/BlobReportLimitingTest.php
index 918b177358..b18c7707d8 100755
--- a/tests/PHPUnit/Integration/BlobReportLimitingTest.php
+++ b/tests/PHPUnit/Integration/BlobReportLimitingTest.php
@@ -35,11 +35,17 @@ class Test_Piwik_Integration_BlobReportLimitingTest extends IntegrationTestCase
'UserSettings.getBrowserVersion',
'UserCountry.getRegion', 'UserCountry.getCity',
);
+
+ $ecommerceApi = array('Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
return array(
array($apiToCall, array('idSite' => self::$fixture->idSite,
'date' => self::$fixture->dateTime,
- 'periods' => array('day')))
+ 'periods' => array('day'))),
+
+ array($ecommerceApi, array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->nextDay,
+ 'periods' => 'day')),
);
}
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsCategory_day.xml b/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsCategory_day.xml
new file mode 100644
index 0000000000..a8d3e17e53
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsCategory_day.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label>Books Cat #0</label>
+ <nb_uniq_visitors>5</nb_uniq_visitors>
+ <nb_visits>5</nb_visits>
+ <nb_actions>5</nb_actions>
+ <avg_price>7.5</avg_price>
+ <avg_quantity>0</avg_quantity>
+ <conversion_rate>0%</conversion_rate>
+ </row>
+ <row>
+ <label>Others</label>
+ <nb_uniq_visitors>20</nb_uniq_visitors>
+ <nb_visits>20</nb_visits>
+ <nb_actions>20</nb_actions>
+ <avg_price>30</avg_price>
+ <avg_quantity>0</avg_quantity>
+ <conversion_rate>0%</conversion_rate>
+ </row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsName_day.xml b/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsName_day.xml
new file mode 100644
index 0000000000..95cb364b56
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsName_day.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label>Book0</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <avg_price>7.5</avg_price>
+ <avg_quantity>0</avg_quantity>
+ <conversion_rate>0%</conversion_rate>
+ </row>
+ <row>
+ <label>Others</label>
+ <nb_uniq_visitors>24</nb_uniq_visitors>
+ <nb_visits>24</nb_visits>
+ <nb_actions>24</nb_actions>
+ <avg_price>180</avg_price>
+ <avg_quantity>0</avg_quantity>
+ <conversion_rate>0%</conversion_rate>
+ </row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsSku_day.xml b/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsSku_day.xml
new file mode 100644
index 0000000000..c234bed59e
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsSku_day.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result /> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsCategory_day.xml b/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsCategory_day.xml
new file mode 100644
index 0000000000..a8d3e17e53
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsCategory_day.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label>Books Cat #0</label>
+ <nb_uniq_visitors>5</nb_uniq_visitors>
+ <nb_visits>5</nb_visits>
+ <nb_actions>5</nb_actions>
+ <avg_price>7.5</avg_price>
+ <avg_quantity>0</avg_quantity>
+ <conversion_rate>0%</conversion_rate>
+ </row>
+ <row>
+ <label>Others</label>
+ <nb_uniq_visitors>20</nb_uniq_visitors>
+ <nb_visits>20</nb_visits>
+ <nb_actions>20</nb_actions>
+ <avg_price>30</avg_price>
+ <avg_quantity>0</avg_quantity>
+ <conversion_rate>0%</conversion_rate>
+ </row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsName_day.xml b/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsName_day.xml
new file mode 100644
index 0000000000..95cb364b56
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsName_day.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label>Book0</label>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <avg_price>7.5</avg_price>
+ <avg_quantity>0</avg_quantity>
+ <conversion_rate>0%</conversion_rate>
+ </row>
+ <row>
+ <label>Others</label>
+ <nb_uniq_visitors>24</nb_uniq_visitors>
+ <nb_visits>24</nb_visits>
+ <nb_actions>24</nb_actions>
+ <avg_price>180</avg_price>
+ <avg_quantity>0</avg_quantity>
+ <conversion_rate>0%</conversion_rate>
+ </row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsSku_day.xml b/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsSku_day.xml
new file mode 100644
index 0000000000..c234bed59e
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsSku_day.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result /> \ No newline at end of file