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:
-rw-r--r--core/API/DataTableManipulator/LabelFilter.php4
-rwxr-xr-xtests/PHPUnit/Integration/RowEvolutionTest.php8
-rw-r--r--tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml115
3 files changed, 126 insertions, 1 deletions
diff --git a/core/API/DataTableManipulator/LabelFilter.php b/core/API/DataTableManipulator/LabelFilter.php
index 6d5a4aa4b3..f60263ce6c 100644
--- a/core/API/DataTableManipulator/LabelFilter.php
+++ b/core/API/DataTableManipulator/LabelFilter.php
@@ -112,6 +112,8 @@ class Piwik_API_DataTableManipulator_LabelFilter extends Piwik_API_DataTableMani
*/
private function getLabelVariations($label)
{
+ static $pageTitleReports = array('getPageTitles', 'getEntryPageTitles', 'getExitPageTitles');
+
$variations = array();
$label = trim($label);
@@ -119,7 +121,7 @@ class Piwik_API_DataTableManipulator_LabelFilter extends Piwik_API_DataTableMani
$variations[] = $sanitizedLabel;
if ($this->apiModule == 'Actions'
- && $this->apiMethod == 'getPageTitles'
+ && in_array($this->apiMethod, $pageTitleReports)
) {
// special case: the Actions.getPageTitles report prefixes some labels with a blank.
// the blank might be passed by the user but is removed in Piwik_API_Request::getRequestArrayFromString.
diff --git a/tests/PHPUnit/Integration/RowEvolutionTest.php b/tests/PHPUnit/Integration/RowEvolutionTest.php
index 7ef6d849d3..d7aa38b7bd 100755
--- a/tests/PHPUnit/Integration/RowEvolutionTest.php
+++ b/tests/PHPUnit/Integration/RowEvolutionTest.php
@@ -92,6 +92,14 @@ class Test_Piwik_Integration_RowEvolution extends IntegrationTestCase
$label = urlencode('incredible title 0') . ',' . urlencode('incredible title 2');
$config['otherRequestParameters']['label'] = urlencode($label);
$return[] = array('API.getRowEvolution', $config);
+
+ // standard label, entry page titles
+ $config['testSuffix'] = '_entryPageTitles';
+ $config['periods'] = 'day';
+ $config['otherRequestParameters']['apiModule'] = 'Actions';
+ $config['otherRequestParameters']['apiAction'] = 'getEntryPageTitles';
+ $config['otherRequestParameters']['label'] = urlencode('incredible title 0');
+ $return[] = array('API.getRowEvolution', $config);
// Actions > Page URLS, hierarchical label
$config['testSuffix'] = '_pageUrls';
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml b/tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
new file mode 100644
index 0000000000..27eb97f81e
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <label>incredible title 0</label>
+ <reportData>
+ <result date="2010-02-06" />
+ <result date="2010-02-07">
+ <row>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_bounce_count>1</entry_bounce_count>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result date="2010-02-08" />
+ <result date="2010-02-09" />
+ <result date="2010-02-10">
+ <row>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_bounce_count>1</entry_bounce_count>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result date="2010-02-11" />
+ <result date="2010-02-12" />
+ <result date="2010-02-13">
+ <row>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_bounce_count>1</entry_bounce_count>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result date="2010-02-14" />
+ <result date="2010-02-15" />
+ <result date="2010-02-16">
+ <row>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_bounce_count>1</entry_bounce_count>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result date="2010-02-17" />
+ <result date="2010-02-18" />
+ <result date="2010-02-19">
+ <row>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_bounce_count>1</entry_bounce_count>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result date="2010-02-20" />
+ <result date="2010-02-21" />
+ <result date="2010-02-22">
+ <row>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_bounce_count>1</entry_bounce_count>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result date="2010-02-23" />
+ <result date="2010-02-24" />
+ <result date="2010-02-25">
+ <row>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_bounce_count>1</entry_bounce_count>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result date="2010-02-26" />
+ <result date="2010-02-27" />
+ <result date="2010-02-28">
+ <row>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_bounce_count>1</entry_bounce_count>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result date="2010-03-01" />
+ <result date="2010-03-02" />
+ <result date="2010-03-03">
+ <row>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_bounce_count>1</entry_bounce_count>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ <result date="2010-03-04" />
+ <result date="2010-03-05" />
+ <result date="2010-03-06">
+ <row>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_bounce_count>1</entry_bounce_count>
+ <bounce_rate>100%</bounce_rate>
+ </row>
+ </result>
+ </reportData>
+ <metadata>
+ <metrics>
+ <entry_nb_visits>
+ <name>Entrances</name>
+ <min>0</min>
+ <max>1</max>
+ </entry_nb_visits>
+ <entry_bounce_count>
+ <name>Bounces</name>
+ <min>0</min>
+ <max>1</max>
+ </entry_bounce_count>
+ <bounce_rate>
+ <name>Bounce Rate</name>
+ <min>0</min>
+ <max>100</max>
+ </bounce_rate>
+ </metrics>
+ <dimension>Page Name</dimension>
+ </metadata>
+</result> \ No newline at end of file