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@piwik.pro>2014-10-21 08:09:08 +0400
committerdiosmosis <benaka@piwik.pro>2014-10-21 08:09:44 +0400
commitcc301f1afe22bd397a6edba2e1759b515455e35f (patch)
tree925156cd6750bbc163774737a796dc735b93e831 /tests
parent452f67fa3820622570ca62ca38037544dec9091b (diff)
Fixes #6479, properly set period parameter in subtable & segment requests when period is range in PivotByDimension filter.
Diffstat (limited to 'tests')
-rw-r--r--tests/PHPUnit/System/PivotByQueryParamTest.php20
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenPeriodIsRange__Referrers.getKeywords_range.xml39
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable_WhenPeriodIsDateRange__Referrers.getKeywords_range.xml57
3 files changed, 116 insertions, 0 deletions
diff --git a/tests/PHPUnit/System/PivotByQueryParamTest.php b/tests/PHPUnit/System/PivotByQueryParamTest.php
index f46813e879..e07ab83280 100644
--- a/tests/PHPUnit/System/PivotByQueryParamTest.php
+++ b/tests/PHPUnit/System/PivotByQueryParamTest.php
@@ -56,6 +56,16 @@ class PivotByQueryParamTest extends SystemTestCase
));
}
+ public function test_PivotBySubtableDimension_CreatesCorrectPivotTable_WhenPeriodIsDateRange()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => '2009-12-29,2010-01-10',
+ 'period' => 'range',
+ 'pivotBy' => 'Referrers.SearchEngine'
+ ));
+ }
+
public function test_PivotBySegment_CreatesCorrectPivotTable()
{
$this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
@@ -81,6 +91,16 @@ class PivotByQueryParamTest extends SystemTestCase
));
}
+ public function test_PivotBySegment_CreatesCorrectPivotTable_WhenPeriodIsRange()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => '2009-12-29,2010-01-10',
+ 'period' => 'range',
+ 'pivotBy' => 'UserCountry.City'
+ ));
+ }
+
public function test_PivotByParam_PlaysNiceWithOtherQueryParams()
{
$this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
diff --git a/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenPeriodIsRange__Referrers.getKeywords_range.xml b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenPeriodIsRange__Referrers.getKeywords_range.xml
new file mode 100644
index 0000000000..8112e991f5
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenPeriodIsRange__Referrers.getKeywords_range.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <col name="label">this search term</col>
+ <col name="1. Toronto, Ontario, Canada">0</col>
+ <col name="2. Yokohama, Kanagawa, Japan">1</col>
+ <col name="3. Melbourne, Victoria, Australia">2</col>
+ </row>
+ <row>
+ <col name="label">search term 2</col>
+ <col name="1. Toronto, Ontario, Canada">0</col>
+ <col name="2. Yokohama, Kanagawa, Japan">2</col>
+ <col name="3. Melbourne, Victoria, Australia">0</col>
+ </row>
+ <row>
+ <col name="label">search term 3</col>
+ <col name="1. Toronto, Ontario, Canada">2</col>
+ <col name="2. Yokohama, Kanagawa, Japan">0</col>
+ <col name="3. Melbourne, Victoria, Australia">0</col>
+ </row>
+ <row>
+ <col name="label">search term 4</col>
+ <col name="1. Toronto, Ontario, Canada">2</col>
+ <col name="2. Yokohama, Kanagawa, Japan">0</col>
+ <col name="3. Melbourne, Victoria, Australia">0</col>
+ </row>
+ <row>
+ <col name="label">that search term</col>
+ <col name="1. Toronto, Ontario, Canada">0</col>
+ <col name="2. Yokohama, Kanagawa, Japan">0</col>
+ <col name="3. Melbourne, Victoria, Australia">2</col>
+ </row>
+ <row>
+ <col name="label">search term 1</col>
+ <col name="1. Toronto, Ontario, Canada">0</col>
+ <col name="2. Yokohama, Kanagawa, Japan">1</col>
+ <col name="3. Melbourne, Victoria, Australia">0</col>
+ </row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable_WhenPeriodIsDateRange__Referrers.getKeywords_range.xml b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable_WhenPeriodIsDateRange__Referrers.getKeywords_range.xml
new file mode 100644
index 0000000000..6ab5630422
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable_WhenPeriodIsDateRange__Referrers.getKeywords_range.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <col name="label">this search term</col>
+ <col name="1. Google">1</col>
+ <col name="2. Yahoo!">1</col>
+ <col name="3. Ask">1</col>
+ <col name="4. Bing">0</col>
+ <col name="5. Alexa">0</col>
+ <col name="6. Babylon">0</col>
+ </row>
+ <row>
+ <col name="label">search term 2</col>
+ <col name="1. Google">0</col>
+ <col name="2. Yahoo!">0</col>
+ <col name="3. Ask">0</col>
+ <col name="4. Bing">0</col>
+ <col name="5. Alexa">1</col>
+ <col name="6. Babylon">1</col>
+ </row>
+ <row>
+ <col name="label">search term 3</col>
+ <col name="1. Google">1</col>
+ <col name="2. Yahoo!">0</col>
+ <col name="3. Ask">1</col>
+ <col name="4. Bing">0</col>
+ <col name="5. Alexa">0</col>
+ <col name="6. Babylon">0</col>
+ </row>
+ <row>
+ <col name="label">search term 4</col>
+ <col name="1. Google">0</col>
+ <col name="2. Yahoo!">1</col>
+ <col name="3. Ask">0</col>
+ <col name="4. Bing">1</col>
+ <col name="5. Alexa">0</col>
+ <col name="6. Babylon">0</col>
+ </row>
+ <row>
+ <col name="label">that search term</col>
+ <col name="1. Google">1</col>
+ <col name="2. Yahoo!">1</col>
+ <col name="3. Ask">0</col>
+ <col name="4. Bing">0</col>
+ <col name="5. Alexa">0</col>
+ <col name="6. Babylon">0</col>
+ </row>
+ <row>
+ <col name="label">search term 1</col>
+ <col name="1. Google">0</col>
+ <col name="2. Yahoo!">0</col>
+ <col name="3. Ask">0</col>
+ <col name="4. Bing">1</col>
+ <col name="5. Alexa">0</col>
+ <col name="6. Babylon">0</col>
+ </row>
+</result> \ No newline at end of file