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 <tsteur@users.noreply.github.com>2017-10-03 23:22:01 +0300
committerGitHub <noreply@github.com>2017-10-03 23:22:01 +0300
commit9af4e95aa976f3a6533e95b776b5298f73e5f916 (patch)
treed612cd4d32019e9e52ce1398b8bf214ec06a8e0f /tests/PHPUnit
parent359c3ec875b554c7b71a933b26d18cdde0bb8f4e (diff)
Better segment editor and fixes (#12040)
* column tweak * fix install * more tweaks * rename column to dimension * various fixes * added new control expandable select * starting to refactor segment selector * make segment editor work again * use translation keys * defined some metrics * set types * simplify * simplify * fix join generator * add possibility to use custom join table names when using query builder and it uses an inner query * fix bug in query selector when selecting same field name from different tables twice * more metadata * more tweaks * improve selector * add possibility to use custom entity names * also processed archived metrics * generate sql filter, suggested values callback, and accept values automatically for columns with enums * several tweaks * focus search field when opening it * various tweaks * added missing method * format and fix more metadata * more fixes * better definition * define custom filter * fix definition * fix various tests * fix more tests * fix bug in logquery builder * fix referrerurl segment was missing * fix some tests * fix more tests * add group * refactor for better definition * fix a bug in log query builder when similar columns are used in archiver * add goal metrics * various fixes * make datatable row more flexible * various fixes and visualization enhancements * simply segment editor and make it smaller * remove trailing comma * various fixes and added new dimension * fix formatting of returning customer * added missing primary key * fixes * various fixes and improvements * make sure to update segment definition when selecting a value from auto complete list * various fixes and more metrics * more metrics * more dimensions and fixes * fix some tests * fix some integration tests * update submodule * fix some system tests * fix ui tests * trigger new test run * fix more ui tests * fix system tests * update submodule * fix categories * sort segments by category for more consistency * add custom variables * some translations and fixes * add minute segment * more segments * added plurals * added some docs * fix test * fix tests * fix tests * added suggested values * fix some tests * various fixes * fix more tests * allow to select segments on any site * make sure to include file * added doc block * fix some system tests * fix most system tests * fix ui test * fix system test * adjust examples * added more tests and docs * no metrics for these dimensions * added developer changelog and made some classes public api * some fixes for entity names * add possibility to set format metrics in test * more consistency in defining the name * get idsites only if provided * fix integration tests * added another segment for visit start hour and visit start minute * more clear name for segment * use old segment name to not break bc * various fixes * more test fixes * fix no suggested values for new segment * add event value * for boolean dimensions only sum metric * update available widgets when updating reporting menu * Add new segments in developer changelog + typo * fix system tests * fix screenshot test
Diffstat (limited to 'tests/PHPUnit')
-rw-r--r--tests/PHPUnit/Integration/Category/CategoryListTest.php3
-rw-r--r--tests/PHPUnit/Integration/Columns/ComputedMetricFactoryTest.php62
-rw-r--r--tests/PHPUnit/Integration/Columns/DimensionMetricFactoryTest.php159
-rw-r--r--tests/PHPUnit/Integration/Columns/DimensionTest.php415
-rw-r--r--tests/PHPUnit/Integration/Plugin/ArchivedMetricTest.php131
-rw-r--r--tests/PHPUnit/Integration/Plugin/ComputedMetricTest.php136
-rw-r--r--tests/PHPUnit/Integration/Plugin/Dimension/ActionDimensionTest.php8
-rw-r--r--tests/PHPUnit/Integration/Plugin/Dimension/ConversionDimensionTest.php8
-rw-r--r--tests/PHPUnit/Integration/Plugin/Dimension/VisitDimensionTest.php36
-rw-r--r--tests/PHPUnit/Integration/SegmentTest.php97
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerHour__API.getSuggestedValuesForSegment.xml27
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerHour__VisitsSummary.get_range.xml12
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerMinute__API.getSuggestedValuesForSegment.xml34
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerMinute__VisitsSummary.get_range.xml12
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml15
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_interaction_position__API.getSuggestedValuesForSegment.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEndServerMinute__API.getSuggestedValuesForSegment.xml34
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEndServerMinute__VisitsSummary.get_range.xml12
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalMinute__API.getSuggestedValuesForSegment.xml34
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalMinute__VisitsSummary.get_range.xml12
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerMinute__API.getSuggestedValuesForSegment.xml34
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerMinute__VisitsSummary.get_range.xml12
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerHour__API.getSuggestedValuesForSegment.xml27
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerHour__VisitsSummary.get_range.xml12
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerMinute__API.getSuggestedValuesForSegment.xml34
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerMinute__VisitsSummary.get_range.xml12
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml1
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html8
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html8
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdfbin551714 -> 551783 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml267
-rwxr-xr-xtests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html8
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html8
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdfbin568483 -> 568560 bytes
-rw-r--r--tests/PHPUnit/Unit/DataAccess/LogQueryBuilder/JoinGeneratorTest.php38
-rw-r--r--tests/PHPUnit/Unit/DataTable/Filter/AddSegmentFilterBySegmentValueTest.php8
-rw-r--r--tests/PHPUnit/Unit/DeprecatedMethodsTest.php3
52 files changed, 1420 insertions, 362 deletions
diff --git a/tests/PHPUnit/Integration/Category/CategoryListTest.php b/tests/PHPUnit/Integration/Category/CategoryListTest.php
index 4c8cc4ec57..824339fb13 100644
--- a/tests/PHPUnit/Integration/Category/CategoryListTest.php
+++ b/tests/PHPUnit/Integration/Category/CategoryListTest.php
@@ -42,7 +42,10 @@ class CategoryListTest extends IntegrationTestCase
'Referrers_Referrers',
'Goals_Goals',
'Goals_Ecommerce',
+ 'Events_Events',
+ 'UserCountry_VisitLocation',
'Live!',
+ 'CustomVariables_CustomVariables',
'ExampleUI_UiFramework'
), array_keys($list->getCategories()));
}
diff --git a/tests/PHPUnit/Integration/Columns/ComputedMetricFactoryTest.php b/tests/PHPUnit/Integration/Columns/ComputedMetricFactoryTest.php
new file mode 100644
index 0000000000..8995c1e1b6
--- /dev/null
+++ b/tests/PHPUnit/Integration/Columns/ComputedMetricFactoryTest.php
@@ -0,0 +1,62 @@
+<?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\Integration\Columns;
+
+use Piwik\Columns\ComputedMetricFactory;
+use Piwik\Columns\MetricsList;
+use Piwik\Plugin\ComputedMetric;
+use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+use Piwik\Translate;
+
+/**
+ * @group Core
+ */
+class ComputedMetricFactoryTest extends IntegrationTestCase
+{
+ /**
+ * @var ComputedMetricFactory
+ */
+ private $factory;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ Translate::loadEnglishTranslation();
+
+ $this->factory = new ComputedMetricFactory(MetricsList::get());
+ }
+
+ public function tearDown()
+ {
+ Translate::unloadEnglishTranslation();
+ parent::tearDown();
+ }
+
+ public function test_createComputedMetric_createAvgMetric()
+ {
+ $metric = $this->factory->createComputedMetric('bounce_count', 'nb_visits', ComputedMetric::AGGREGATION_AVG);
+
+ $this->assertSame('avg_bounce_count_per_visits', $metric->getName());
+ $this->assertSame('Avg. Actions In Visit per Visit', $metric->getTranslatedName());
+ $this->assertSame('Average value of "Actions In Visit" per "Visits".', $metric->getDocumentation());
+ $this->assertSame('General_Visitors', $metric->getCategoryId());
+ }
+
+ public function test_createComputedMetric_createRateMetric()
+ {
+ $metric = $this->factory->createComputedMetric('bounce_count', 'nb_visits', ComputedMetric::AGGREGATION_RATE);
+
+ $this->assertSame('bounce_count_visits_rate', $metric->getName());
+ $this->assertSame('Bounces Rate', $metric->getTranslatedName());
+ $this->assertSame('The ratio of "Actions In Visit" out of all "Visits".', $metric->getDocumentation());
+ $this->assertSame('General_Visitors', $metric->getCategoryId());
+ }
+
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Columns/DimensionMetricFactoryTest.php b/tests/PHPUnit/Integration/Columns/DimensionMetricFactoryTest.php
new file mode 100644
index 0000000000..4f03b9f8cc
--- /dev/null
+++ b/tests/PHPUnit/Integration/Columns/DimensionMetricFactoryTest.php
@@ -0,0 +1,159 @@
+<?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\Integration\Columns;
+
+use Piwik\Columns\ComputedMetricFactory;
+use Piwik\Columns\Dimension;
+use Piwik\Columns\DimensionMetricFactory;
+use Piwik\Columns\MetricsList;
+use Piwik\Plugin\ArchivedMetric;
+use Piwik\Plugin\ComputedMetric;
+use Piwik\Plugins\UserCountry\Columns\Country;
+use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+use Piwik\Translate;
+
+/**
+ * @group Core
+ */
+class DimensionMetricFactoryTest extends IntegrationTestCase
+{
+ /** @var Dimension */
+ private $country;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ Translate::loadEnglishTranslation();
+
+ $this->country = new Country();
+ }
+
+ public function tearDown()
+ {
+ Translate::unloadEnglishTranslation();
+ parent::tearDown();
+ }
+
+ private function makeFactory($dimension)
+ {
+ return new DimensionMetricFactory($dimension);
+ }
+
+ public function test_createMetric_count()
+ {
+ $factory = $this->makeFactory($this->country);
+ $metric = $factory->createMetric(ArchivedMetric::AGGREGATION_COUNT);
+
+ $this->assertSame('nb_usercountry_country', $metric->getName());
+ $this->assertSame('Countries', $metric->getTranslatedName());
+ $this->assertSame('The number of Countries', $metric->getDocumentation());
+ $this->assertSame('UserCountry_VisitLocation', $metric->getCategoryId());
+ $this->assertSame('count(log_visit.location_country)', $metric->getQuery());
+ }
+
+ public function test_createMetric_uniqueCount()
+ {
+ $factory = $this->makeFactory($this->country);
+ $metric = $factory->createMetric(ArchivedMetric::AGGREGATION_UNIQUE);
+
+ $this->assertSame('nb_uniq_usercountry_country', $metric->getName());
+ $this->assertSame('Unique Countries', $metric->getTranslatedName());
+ $this->assertSame('The unique number of Countries', $metric->getDocumentation());
+ $this->assertSame('UserCountry_VisitLocation', $metric->getCategoryId());
+ $this->assertSame('count(distinct log_visit.location_country)', $metric->getQuery());
+ }
+
+ public function test_createMetric_sum()
+ {
+ $factory = $this->makeFactory($this->country);
+ $metric = $factory->createMetric(ArchivedMetric::AGGREGATION_SUM);
+
+ $this->assertSame('sum_usercountry_country', $metric->getName());
+ $this->assertSame('Total Countries', $metric->getTranslatedName());
+ $this->assertSame('The total number (sum) of Countries', $metric->getDocumentation());
+ $this->assertSame('UserCountry_VisitLocation', $metric->getCategoryId());
+ $this->assertSame('sum(log_visit.location_country)', $metric->getQuery());
+ }
+
+ public function test_createMetric_min()
+ {
+ $factory = $this->makeFactory($this->country);
+ $metric = $factory->createMetric(ArchivedMetric::AGGREGATION_MIN);
+
+ $this->assertSame('min_usercountry_country', $metric->getName());
+ $this->assertSame('Min Countries', $metric->getTranslatedName());
+ $this->assertSame('The minimum value for Countries', $metric->getDocumentation());
+ $this->assertSame('UserCountry_VisitLocation', $metric->getCategoryId());
+ $this->assertSame('min(log_visit.location_country)', $metric->getQuery());
+ }
+
+ public function test_createMetric_max()
+ {
+ $factory = $this->makeFactory($this->country);
+ $metric = $factory->createMetric(ArchivedMetric::AGGREGATION_MAX);
+
+ $this->assertSame('max_usercountry_country', $metric->getName());
+ $this->assertSame('Max Countries', $metric->getTranslatedName());
+ $this->assertSame('The maximum value for Countries', $metric->getDocumentation());
+ $this->assertSame('UserCountry_VisitLocation', $metric->getCategoryId());
+ $this->assertSame('max(log_visit.location_country)', $metric->getQuery());
+ }
+
+ public function test_createMetric_withValue()
+ {
+ $factory = $this->makeFactory($this->country);
+ $metric = $factory->createMetric(ArchivedMetric::AGGREGATION_COUNT_WITH_NUMERIC_VALUE);
+
+ $this->assertSame('nb_with_usercountry_country', $metric->getName());
+ $this->assertSame('Entries with Country', $metric->getTranslatedName());
+ $this->assertSame('The number of entries that have a value set for Country', $metric->getDocumentation());
+ $this->assertSame('UserCountry_VisitLocation', $metric->getCategoryId());
+ $this->assertSame('sum(if(log_visit.location_country > 0, 1, 0))', $metric->getQuery());
+ }
+
+
+ public function test_createCustomMetric()
+ {
+ $factory = $this->makeFactory($this->country);
+ $metric = $factory->createCustomMetric($name = 'sum_times_10', $translated = 'MyMetric', $aggregation = 'sum(%s) * 10', $documentation = 'FoobarBaz');
+
+ $this->assertSame($name, $metric->getName());
+ $this->assertSame($translated, $metric->getTranslatedName());
+ $this->assertSame($documentation, $metric->getDocumentation());
+ $this->assertSame('UserCountry_VisitLocation', $metric->getCategoryId());
+ $this->assertSame('sum(log_visit.location_country) * 10', $metric->getQuery());
+ }
+
+ public function test_createComputedMetric_average()
+ {
+ $factory = $this->makeFactory($this->country);
+ $metric = $factory->createComputedMetric($metricName1 = 'bounce_count', 'nb_visits', ComputedMetric::AGGREGATION_AVG);
+
+ $this->assertSame('avg_bounce_count_per_visits', $metric->getName());
+ $this->assertSame('Avg. Actions In Visit per Visit', $metric->getTranslatedName());
+ $this->assertSame('Average value of "Actions In Visit" per "Visits".', $metric->getDocumentation());
+ $this->assertSame('UserCountry_VisitLocation', $metric->getCategoryId());
+ $this->assertCount(2, $metric->getDependentMetrics());
+ }
+
+ public function test_createComputedMetric_rate()
+ {
+ $factory = $this->makeFactory($this->country);
+ $metric = $factory->createComputedMetric($metricName1 = 'bounce_count', 'nb_visits', ComputedMetric::AGGREGATION_RATE);
+
+ $this->assertSame('bounce_count_visits_rate', $metric->getName());
+ $this->assertSame('Bounces Rate', $metric->getTranslatedName());
+ $this->assertSame('The ratio of "Actions In Visit" out of all "Visits".', $metric->getDocumentation());
+ $this->assertSame('UserCountry_VisitLocation', $metric->getCategoryId());
+ $this->assertCount(2, $metric->getDependentMetrics());
+ }
+
+
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Columns/DimensionTest.php b/tests/PHPUnit/Integration/Columns/DimensionTest.php
index 0e51177673..286ee4fb55 100644
--- a/tests/PHPUnit/Integration/Columns/DimensionTest.php
+++ b/tests/PHPUnit/Integration/Columns/DimensionTest.php
@@ -6,217 +6,310 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-namespace Piwik\Plugins\Test\Columns
-{
+namespace Piwik\Tests\Integration\Columns;
+
// there is a test that requires the class to be defined in a plugin
- use Piwik\Columns\Dimension;
- use Piwik\Plugin\Segment;
+use Piwik\Columns\Dimension;
+use Piwik\Plugin\Segment;
+use Piwik\Metrics\Formatter;
+use Piwik\Plugin\Dimension\ActionDimension;
+use Piwik\Plugin\Dimension\ConversionDimension;
+use Piwik\Plugin\Dimension\VisitDimension;
+use Piwik\Plugin\Manager;
+use Piwik\Tests\Framework\Fixture;
+use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+use Piwik\Translate;
+
+class CustomDimensionTest extends Dimension
+{
+ protected $columnName = 'test_dimension';
+ protected $columnType = 'INTEGER (10) DEFAULT 0';
+ protected $dbTableName = 'log_visit';
- class DimensionTest extends Dimension
+ public function getId()
{
- protected $columnName = 'test_dimension';
- protected $columnType = 'INTEGER (10) DEFAULT 0';
+ return $this->generateIdFromClass('Piwik\Plugins\Test\Columns\DimensionTest');
+ }
- public function set($param, $value)
- {
- $this->$param = $value;
- }
+ public function hasImplementedEvent($method)
+ {
+ $method = new \ReflectionMethod($this, $method);
+ $declaringClass = $method->getDeclaringClass();
- protected function configureSegments()
- {
- $segment = new Segment();
- $segment->setSegment('exitPageUrl');
- $segment->setName('Actions_ColumnExitPageURL');
- $segment->setCategory('General_Visit');
- $this->addSegment($segment);
-
- // custom type and sqlSegment
- $segment = new Segment();
- $segment->setSegment('exitPageUrl');
- $segment->setSqlSegment('customValue');
- $segment->setType(Segment::TYPE_METRIC);
- $segment->setName('Actions_ColumnExitPageURL');
- $segment->setCategory('General_Visit');
- $this->addSegment($segment);
- }
+ return 0 === strpos($declaringClass->name, 'Piwik\Tests');
+ }
+
+ public function set($param, $value)
+ {
+ $this->$param = $value;
+ }
+
+ public function setColumnType($columnType)
+ {
+ $this->columnType = $columnType;
+ }
+
+ protected function configureSegments()
+ {
+ $segment = new Segment();
+ $segment->setSegment('exitPageUrl');
+ $segment->setName('Actions_ColumnExitPageURL');
+ $segment->setCategory('General_Visit');
+ $this->addSegment($segment);
+
+ // custom type and sqlSegment
+ $segment = new Segment();
+ $segment->setSegment('exitPageUrl');
+ $segment->setSqlSegment('customValue');
+ $segment->setType(Segment::TYPE_METRIC);
+ $segment->setName('Actions_ColumnExitPageURL');
+ $segment->setCategory('General_Visit');
+ $this->addSegment($segment);
}
}
-namespace Piwik\Tests\Integration\Columns
-{
- use Piwik\Columns\Dimension;
- use Piwik\Config;
- use Piwik\Plugin\Dimension\ActionDimension;
- use Piwik\Plugin\Dimension\ConversionDimension;
- use Piwik\Plugin\Dimension\VisitDimension;
- use Piwik\Plugin\Segment;
- use Piwik\Plugin\Manager;
- use Piwik\Plugins\Test\Columns\DimensionTest;
- use Piwik\Plugins\Test\FakeActionDimension;
- use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+/**
+ * @group Core
+ */
+class ColumnDimensionTest extends IntegrationTestCase
+{
/**
- * @group Core
+ * @var CustomDimensionTest
*/
- class ColumnDimensionTest extends IntegrationTestCase
+ private $dimension;
+
+ public function setUp()
{
- /**
- * @var FakeActionDimension
- */
- private $dimension;
+ parent::setUp();
- public function setUp()
- {
- parent::setUp();
+ Translate::loadEnglishTranslation();
- Manager::getInstance()->unloadPlugins();
- Manager::getInstance()->doNotLoadAlwaysActivatedPlugins();
+ Fixture::createWebsite('2014-04-05 01:02:03');
- $this->dimension = new DimensionTest();
- }
+ Manager::getInstance()->unloadPlugins();
+ Manager::getInstance()->doNotLoadAlwaysActivatedPlugins();
- public function test_hasImplementedEvent_shouldDetectWhetherAMethodWasOverwrittenInTheActualPluginClass()
- {
- $this->assertTrue($this->dimension->hasImplementedEvent('set'));
- $this->assertTrue($this->dimension->hasImplementedEvent('configureSegments'));
+ $this->dimension = new CustomDimensionTest();
+ }
- $this->assertFalse($this->dimension->hasImplementedEvent('getSegments'));
- }
+ public function tearDown()
+ {
+ Translate::unloadEnglishTranslation();
+ parent::tearDown();
+ }
- public function test_getColumnName_shouldReturnTheNameOfTheColumn()
- {
- $this->assertSame('test_dimension', $this->dimension->getColumnName());
- }
+ public function test_hasImplementedEvent_shouldDetectWhetherAMethodWasOverwrittenInTheActualPluginClass()
+ {
+ $this->assertTrue($this->dimension->hasImplementedEvent('set'));
+ $this->assertTrue($this->dimension->hasImplementedEvent('configureSegments'));
- public function test_hasColumnType_shouldDetectWhetherAColumnTypeIsSet()
- {
- $this->assertTrue($this->dimension->hasColumnType());
+ $this->assertFalse($this->dimension->hasImplementedEvent('getSegments'));
+ }
- $this->dimension->set('columnType', '');
- $this->assertFalse($this->dimension->hasColumnType());
- }
+ public function test_getColumnName_shouldReturnTheNameOfTheColumn()
+ {
+ $this->assertSame('test_dimension', $this->dimension->getColumnName());
+ }
- public function test_getName_ShouldNotReturnANameByDefault()
- {
- $this->assertSame('', $this->dimension->getName());
- }
+ public function test_hasColumnType_shouldDetectWhetherAColumnTypeIsSet()
+ {
+ $this->assertTrue($this->dimension->hasColumnType());
+
+ $this->dimension->set('columnType', '');
+ $this->assertFalse($this->dimension->hasColumnType());
+ }
+
+ public function test_getName_ShouldNotReturnANameByDefault()
+ {
+ $this->assertSame('', $this->dimension->getName());
+ }
- public function test_getAllDimensions_shouldReturnAllKindOfDimensions()
- {
- Manager::getInstance()->loadPlugins(array('Actions', 'Events', 'DevicesDetector', 'Goals', 'CustomVariables'));
-
- $dimensions = Dimension::getAllDimensions();
-
- $this->assertGreaterThan(20, count($dimensions));
-
- $foundConversion = false;
- $foundVisit = false;
- $foundAction = false;
- $foundNormal = false;
-
- foreach ($dimensions as $dimension) {
- if ($dimension instanceof ConversionDimension) {
- $foundConversion = true;
- } else if ($dimension instanceof ActionDimension) {
- $foundAction = true;
- } else if ($dimension instanceof VisitDimension) {
- $foundVisit = true;
- } else if ($dimension instanceof Dimension) {
- $foundNormal = true;
- } else {
- $this->fail('Unexpected dimension class found');
- }
-
- $this->assertRegExp('/Piwik.Plugins.(Actions|Events|DevicesDetector|Goals|CustomVariables).Columns/', get_class($dimension));
+ public function test_getAllDimensions_shouldReturnAllKindOfDimensions()
+ {
+ Manager::getInstance()->loadPlugins(array('Actions', 'Events', 'DevicesDetector', 'Goals', 'CustomVariables'));
+
+ $dimensions = Dimension::getAllDimensions();
+
+ $this->assertGreaterThan(20, count($dimensions));
+
+ $foundConversion = false;
+ $foundVisit = false;
+ $foundAction = false;
+ $foundNormal = false;
+
+ foreach ($dimensions as $dimension) {
+ if ($dimension instanceof ConversionDimension) {
+ $foundConversion = true;
+ } else if ($dimension instanceof ActionDimension) {
+ $foundAction = true;
+ } else if ($dimension instanceof VisitDimension) {
+ $foundVisit = true;
+ } else if ($dimension instanceof Dimension) {
+ $foundNormal = true;
+ } else {
+ $this->fail('Unexpected dimension class found');
}
- $this->assertTrue($foundConversion);
- $this->assertTrue($foundAction);
- $this->assertTrue($foundVisit);
- $this->assertTrue($foundNormal);
+ if (get_class($dimension) === 'Piwik\Plugins\CustomVariables\CustomDimension') {
+ continue;
+ }
+
+ $this->assertRegExp('/Piwik.Plugins.(Actions|Events|DevicesDetector|Goals|CustomVariables).Columns/', get_class($dimension));
}
- public function test_getDimensions_shouldReturnAllKindOfDimensionsThatBelongToASpecificPlugin()
- {
- Manager::getInstance()->loadPlugins(array('Actions', 'Events', 'DevicesDetector', 'Goals'));
+ $this->assertTrue($foundConversion);
+ $this->assertTrue($foundAction);
+ $this->assertTrue($foundVisit);
+ $this->assertTrue($foundNormal);
+ }
- $dimensions = Dimension::getDimensions(Manager::getInstance()->loadPlugin('Actions'));
+ public function test_getDimensions_shouldReturnAllKindOfDimensionsThatBelongToASpecificPlugin()
+ {
+ Manager::getInstance()->loadPlugins(array('Actions', 'Events', 'DevicesDetector', 'Goals'));
- $this->assertGreaterThan(10, count($dimensions));
+ $dimensions = Dimension::getDimensions(Manager::getInstance()->loadPlugin('Actions'));
- $foundVisit = false;
- $foundAction = false;
+ $this->assertGreaterThan(10, count($dimensions));
- foreach ($dimensions as $dimension) {
- if ($dimension instanceof ActionDimension) {
- $foundAction = true;
- } else if ($dimension instanceof VisitDimension) {
- $foundVisit = true;
- }
+ $foundVisit = false;
+ $foundAction = false;
- $this->assertRegExp('/Piwik.Plugins.Actions.Columns/', get_class($dimension));
+ foreach ($dimensions as $dimension) {
+ if ($dimension instanceof ActionDimension) {
+ $foundAction = true;
+ } else if ($dimension instanceof VisitDimension) {
+ $foundVisit = true;
}
- $this->assertTrue($foundAction);
- $this->assertTrue($foundVisit);
+ $this->assertRegExp('/Piwik.Plugins.Actions.Columns/', get_class($dimension));
}
- public function test_getDimensions_shouldReturnConversionDimensionsThatBelongToASpecificPlugin()
- {
- Manager::getInstance()->loadPlugins(array('Actions', 'Events', 'DevicesDetector', 'Goals'));
+ $this->assertTrue($foundAction);
+ $this->assertTrue($foundVisit);
+ }
- $dimensions = Dimension::getDimensions(Manager::getInstance()->loadPlugin('Goals'));
+ public function test_getDimensions_shouldReturnConversionDimensionsThatBelongToASpecificPlugin()
+ {
+ Manager::getInstance()->loadPlugins(array('Actions', 'Events', 'DevicesDetector', 'Goals'));
- $this->assertGreaterThan(2, count($dimensions));
+ $dimensions = Dimension::getDimensions(Manager::getInstance()->loadPlugin('Goals'));
- $foundConversion = false;
+ $this->assertGreaterThan(2, count($dimensions));
- foreach ($dimensions as $dimension) {
- if ($dimension instanceof ConversionDimension) {
- $foundConversion = true;
- }
+ $foundConversion = false;
- $this->assertRegExp('/Piwik.Plugins.Goals.Columns/', get_class($dimension));
+ foreach ($dimensions as $dimension) {
+ if ($dimension instanceof ConversionDimension) {
+ $foundConversion = true;
}
- $this->assertTrue($foundConversion);
+ $this->assertRegExp('/Piwik.Plugins.Goals.Columns/', get_class($dimension));
}
- public function test_getSegment_ShouldReturnConfiguredSegments()
- {
- $segments = $this->dimension->getSegments();
+ $this->assertTrue($foundConversion);
+ }
- $this->assertCount(2, $segments);
- $this->assertInstanceOf('\Piwik\Plugin\Segment', $segments[0]);
- $this->assertInstanceOf('\Piwik\Plugin\Segment', $segments[1]);
- }
+ public function test_getSegment_ShouldReturnConfiguredSegments()
+ {
+ $segments = $this->dimension->getSegments();
- public function test_addSegment_ShouldPrefilSomeSegmentValuesIfNotDefinedYet()
- {
- $segments = $this->dimension->getSegments();
+ $this->assertCount(2, $segments);
+ $this->assertInstanceOf('\Piwik\Plugin\Segment', $segments[0]);
+ $this->assertInstanceOf('\Piwik\Plugin\Segment', $segments[1]);
+ }
- $this->assertEquals(Segment::TYPE_DIMENSION, $segments[0]->getType());
- }
+ /**
+ * @param $expectedType
+ * @param $columnType
+ * @dataProvider getTypeProvider
+ */
+ public function test_getType_shouldGuessTypeBasedOnColumnType($expectedType, $columnType)
+ {
+ $this->dimension->setColumnType($columnType);
+ $this->assertSame($expectedType, $this->dimension->getType());
+ }
- public function test_addSegment_ShouldNotOverwritePreAssignedValues()
- {
- $segments = $this->dimension->getSegments();
+ public function getTypeProvider()
+ {
+ return array(
+ array($expected = Dimension::TYPE_NUMBER, $columnType = 'INTEGER (10) DEFAULT 0'),
+ array($expected = Dimension::TYPE_NUMBER, $columnType = 'INTEGER(10) DEFAULT 0'),
+ array($expected = Dimension::TYPE_NUMBER, $columnType = 'INT(10) DEFAULT 0'),
+ array($expected = Dimension::TYPE_NUMBER, $columnType = 'int(10) DEFAULT 0'),
+ array($expected = Dimension::TYPE_NUMBER, $columnType = 'SMALLINT(10) DEFAULT 0'),
+ array($expected = Dimension::TYPE_FLOAT, $columnType = 'FLOAT (10) DEFAULT 0'),
+ array($expected = Dimension::TYPE_FLOAT, $columnType = 'DECIMAL(10) DEFAULT 0'),
+ array($expected = Dimension::TYPE_BINARY, $columnType = 'BINARY(8)'),
+ array($expected = Dimension::TYPE_TIMESTAMP, $columnType = 'timestamp null'),
+ array($expected = Dimension::TYPE_TIMESTAMP, $columnType = 'timeStAmp null'),
+ array($expected = Dimension::TYPE_DATETIME, $columnType = 'DATETIME NOT NULL'),
+ array($expected = Dimension::TYPE_DATE, $columnType = 'DATE NOT NULL'),
+ array($expected = Dimension::TYPE_TEXT, $columnType = ''),
+ );
+ }
- $this->assertEquals(Segment::TYPE_METRIC, $segments[1]->getType());
- }
+ public function test_addSegment_ShouldPrefilSomeSegmentValuesIfNotDefinedYetAndGuessTypeMetric()
+ {
+ $segments = $this->dimension->getSegments();
- public function test_getId_ShouldCorrectlyGenerateIdFromDimensionsQualifiedClassName()
- {
- $this->assertEquals("Test.DimensionTest", $this->dimension->getId());
- }
+ $this->assertEquals(Segment::TYPE_METRIC, $segments[0]->getType());
+ }
- public function test_factory_ShouldCreateDimensionFromDimensionId()
- {
- Manager::getInstance()->loadPlugins(array('ExampleTracker'));
+ public function test_addSegment_ShouldPrefilSomeSegmentValuesIfNotDefinedYetAndGuessTypeDimension()
+ {
+ $this->dimension->setColumnType('TEXT NOT NULL');
+ $segments = $this->dimension->getSegments();
- $dimension = Dimension::factory("ExampleTracker.ExampleDimension");
- $this->assertInstanceOf('Piwik\Plugins\ExampleTracker\Columns\ExampleDimension', $dimension);
- }
- }
-} \ No newline at end of file
+ $this->assertEquals(Segment::TYPE_DIMENSION, $segments[0]->getType());
+ }
+
+ public function test_addSegment_ShouldNotOverwritePreAssignedValues()
+ {
+ $segments = $this->dimension->getSegments();
+
+ $this->assertEquals(Segment::TYPE_METRIC, $segments[1]->getType());
+ }
+
+ public function test_getId_ShouldCorrectlyGenerateIdFromDimensionsQualifiedClassName()
+ {
+ $this->assertEquals("Test.DimensionTest", $this->dimension->getId());
+ }
+
+ public function test_factory_ShouldCreateDimensionFromDimensionId()
+ {
+ Manager::getInstance()->loadPlugins(array('ExampleTracker'));
+
+ $dimension = Dimension::factory("ExampleTracker.ExampleDimension");
+ $this->assertInstanceOf('Piwik\Plugins\ExampleTracker\Columns\ExampleDimension', $dimension);
+ }
+
+
+ /**
+ * @dataProvider getFormatValueProvider
+ */
+ public function test_formatValue($type, $value, $expected)
+ {
+ $formatter = new Formatter();
+ $this->dimension->setType($type);
+ $formatted = $this->dimension->formatValue($value, $idSite = 1, $formatter);
+
+ $this->assertEquals($expected, $formatted);
+ }
+
+ public function getFormatValueProvider()
+ {
+ return array(
+ array($type = Dimension::TYPE_NUMBER, $value = 5.354, $expected = 5),
+ array($type = Dimension::TYPE_FLOAT, $value = 5.354, $expected = 5.35),
+ array($type = Dimension::TYPE_MONEY, $value = 5.392, $expected = '$ 5.39'),
+ array($type = Dimension::TYPE_PERCENT, $value = 0.343, $expected = '34.3%'),
+ array($type = Dimension::TYPE_DURATION_S, $value = 121, $expected = '00:02:01'),
+ array($type = Dimension::TYPE_DURATION_MS, $value = 0.392, $expected = '0.39s'),
+ array($type = Dimension::TYPE_BYTE, $value = 3912, $expected = '3.8 K'),
+ array($type = Dimension::TYPE_BOOL, $value = 0, $expected = 'No'),
+ array($type = Dimension::TYPE_BOOL, $value = 1, $expected = 'Yes'),
+ );
+ }
+}
diff --git a/tests/PHPUnit/Integration/Plugin/ArchivedMetricTest.php b/tests/PHPUnit/Integration/Plugin/ArchivedMetricTest.php
new file mode 100644
index 0000000000..1a9a19526a
--- /dev/null
+++ b/tests/PHPUnit/Integration/Plugin/ArchivedMetricTest.php
@@ -0,0 +1,131 @@
+<?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\Integration\Plugin;
+
+use Piwik\Columns\Dimension;
+use Piwik\DataTable;
+use Piwik\Metrics\Formatter;
+use Piwik\Plugin\ArchivedMetric;
+use Piwik\Plugin\ComputedMetric;
+use Piwik\Plugins\UserCountry\Columns\City;
+use Piwik\Plugins\UserCountry\Columns\Country;
+use Piwik\Site;
+use Piwik\Tests\Framework\Fixture;
+use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+use Piwik\Translate;
+
+/**
+ * @group ArchivedMetric
+ * @group ArchivedMetricTest
+ */
+class ArchivedMetricTest extends IntegrationTestCase
+{
+ /**
+ * @var Country
+ */
+ private $dimension;
+
+ /**
+ * @var ArchivedMetric
+ */
+ private $metric;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ Translate::loadEnglishTranslation();
+
+ Fixture::createWebsite('2015-01-01 00:00:00');
+
+ $this->dimension = new Country();
+ $this->metric = $this->makeMetric('%s');
+ }
+
+ public function tearDown()
+ {
+ Translate::unloadEnglishTranslation();
+ parent::tearDown();
+ }
+
+ private function makeMetric($aggregation)
+ {
+ return new ArchivedMetric($this->dimension, $aggregation);
+ }
+
+ /**
+ * @dataProvider getFormatValueProvider
+ */
+ public function test_formatValue($type, $value, $expected)
+ {
+ $formatter = new Formatter();
+ $this->metric->setType($type);
+
+ $table = new DataTable();
+ $table->setMetadata('site', new Site(1));
+ $this->metric->beforeFormat(null, $table);
+ $formatted = $this->metric->format($value, $formatter);
+
+ $this->assertEquals($expected, $formatted);
+ }
+
+ public function getFormatValueProvider()
+ {
+ return array(
+ array($type = Dimension::TYPE_NUMBER, $value = 5.354, $expected = 5),
+ array($type = Dimension::TYPE_FLOAT, $value = 5.354, $expected = 5.35),
+ array($type = Dimension::TYPE_MONEY, $value = 5.392, $expected = '$ 5.39'),
+ array($type = Dimension::TYPE_PERCENT, $value = 0.343, $expected = '34.3%'),
+ array($type = Dimension::TYPE_DURATION_S, $value = 121, $expected = '2 min 1s'),
+ array($type = Dimension::TYPE_DURATION_MS, $value = 392, $expected = '0.39s'),
+ array($type = Dimension::TYPE_BYTE, $value = 3912, $expected = '3.8 K'),
+ );
+ }
+ public function test_getQuery_returnsDefaultColumns()
+ {
+ $this->assertSame('log_visit.location_country', $this->metric->getQuery());
+ }
+
+ public function test_getQuery_whenNoAggregationSet()
+ {
+ $metric = $this->makeMetric('');
+ $this->assertSame('log_visit.location_country', $metric->getQuery());
+ }
+
+ public function test_getQuery_whenAggregationSet()
+ {
+ $metric = $this->makeMetric('count(%s)');
+ $this->assertSame('count(log_visit.location_country)', $metric->getQuery());
+ }
+
+ public function test_setQuery()
+ {
+ $this->metric->setQuery('count(log_visit.foobar) + 1');
+ $this->assertSame('count(log_visit.foobar) + 1', $this->metric->getQuery());
+ }
+
+ public function test_setDimension()
+ {
+ $this->assertSame($this->dimension, $this->metric->getDimension());
+ }
+
+ public function test_getDbTableName()
+ {
+ $this->assertSame('log_visit', $this->metric->getDbTableName());
+ }
+
+ public function test_setCategory_getCategoryId()
+ {
+ $this->assertSame('', $this->metric->getCategoryId());
+ $this->metric->setCategory('General_Visitors');
+ $this->assertSame('General_Visitors', $this->metric->getCategoryId());
+ }
+
+
+}
diff --git a/tests/PHPUnit/Integration/Plugin/ComputedMetricTest.php b/tests/PHPUnit/Integration/Plugin/ComputedMetricTest.php
new file mode 100644
index 0000000000..7149271535
--- /dev/null
+++ b/tests/PHPUnit/Integration/Plugin/ComputedMetricTest.php
@@ -0,0 +1,136 @@
+<?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\Integration\Plugin;
+
+use Piwik\Columns\Dimension;
+use Piwik\DataTable;
+use Piwik\Metrics\Formatter;
+use Piwik\Plugin\ComputedMetric;
+use Piwik\Site;
+use Piwik\Tests\Framework\Fixture;
+use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+use Piwik\Translate;
+
+/**
+ * @group ComputedMetric
+ * @group ComputedMetricTest
+ */
+class ComputedMetricTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ Translate::loadEnglishTranslation();
+
+ Fixture::createWebsite('2015-01-01 00:00:00');
+ }
+
+ public function tearDown()
+ {
+ Translate::unloadEnglishTranslation();
+ parent::tearDown();
+ }
+
+ private function makeMetric($metric1, $metric2, $aggregation)
+ {
+ return new ComputedMetric($metric1, $metric2, $aggregation);
+ }
+
+ /**
+ * @dataProvider getFormatValueProvider
+ */
+ public function test_formatValue($type, $value, $expected)
+ {
+ $metric = $this->makeMetric('bonuce_count', 'nb_visits', ComputedMetric::AGGREGATION_AVG);
+
+ $formatter = new Formatter();
+ $metric->setType($type);
+
+ $table = new DataTable();
+ $table->setMetadata('site', new Site(1));
+ $metric->beforeFormat(null, $table);
+ $formatted = $metric->format($value, $formatter);
+
+ $this->assertEquals($expected, $formatted);
+ }
+
+ public function getFormatValueProvider()
+ {
+ return array(
+ array($type = Dimension::TYPE_NUMBER, $value = 5.354, $expected = 5.4),
+ array($type = Dimension::TYPE_FLOAT, $value = 5.354, $expected = 5.35),
+ array($type = Dimension::TYPE_MONEY, $value = 5.392, $expected = '$ 5.39'),
+ array($type = Dimension::TYPE_PERCENT, $value = 0.343, $expected = '34.3%'),
+ array($type = Dimension::TYPE_DURATION_S, $value = 121, $expected = '2 min 1s'),
+ array($type = Dimension::TYPE_DURATION_MS, $value = 392, $expected = '0.39s'),
+ array($type = Dimension::TYPE_BYTE, $value = 392, $expected = '392 B'),
+ );
+ }
+
+ public function test_getName()
+ {
+ $metric = $this->makeMetric('bounces', 'nb_visits', ComputedMetric::AGGREGATION_AVG);
+ $this->assertSame('avg_bounces_per_visits', $metric->getName());
+
+ $metric = $this->makeMetric('bounces', 'nb_uniq_visits', ComputedMetric::AGGREGATION_AVG);
+ $this->assertSame('avg_bounces_per_uniq_visits', $metric->getName());
+
+ $metric = $this->makeMetric('sum_bounces', 'nb_uniq_visits', ComputedMetric::AGGREGATION_AVG);
+ $this->assertSame('avg_sum_bounces_per_uniq_visits', $metric->getName());
+
+ $metric = $this->makeMetric('bounces', 'nb_visits', ComputedMetric::AGGREGATION_RATE);
+ $this->assertSame('bounces_visits_rate', $metric->getName());
+
+ $metric = $this->makeMetric('bounces', 'nb_uniq_visits', ComputedMetric::AGGREGATION_RATE);
+ $this->assertSame('bounces_uniq_visits_rate', $metric->getName());
+
+ $metric = $this->makeMetric('sum_bounces', 'nb_uniq_visits', ComputedMetric::AGGREGATION_RATE);
+ $this->assertSame('sum_bounces_uniq_visits_rate', $metric->getName());
+ }
+
+ public function test_setName()
+ {
+ $metric = $this->makeMetric('bounces', 'nb_visits', ComputedMetric::AGGREGATION_AVG);
+ $metric->setName('avg_bounces');
+ $this->assertSame('avg_bounces', $metric->getName());
+ }
+
+ public function test_getTranslatedName()
+ {
+ $metric = $this->makeMetric('bounce_count', 'nb_visits', ComputedMetric::AGGREGATION_AVG);
+ $this->assertSame('Avg. Actions In Visit per Visit', $metric->getTranslatedName());
+
+ $metric = $this->makeMetric('bounce_count', 'nb_visits', ComputedMetric::AGGREGATION_RATE);
+ $this->assertSame('Bounces Rate', $metric->getTranslatedName());
+ }
+
+ public function test_getDocumentation()
+ {
+ $metric = $this->makeMetric('bounce_count', 'nb_visits', ComputedMetric::AGGREGATION_AVG);
+ $this->assertSame('Average value of "Actions In Visit" per "Visits".', $metric->getDocumentation());
+
+ $metric = $this->makeMetric('bounce_count', 'nb_visits', ComputedMetric::AGGREGATION_RATE);
+ $this->assertSame('The ratio of "Actions In Visit" out of all "Visits".', $metric->getDocumentation());
+ }
+
+ public function test_getDependentMetrics()
+ {
+ $metric = $this->makeMetric('bounce_count', 'nb_visits', ComputedMetric::AGGREGATION_AVG);
+ $this->assertSame(array('bounce_count', 'nb_visits'), $metric->getDependentMetrics());
+ }
+
+ public function test_setCategory()
+ {
+ $metric = $this->makeMetric('bounce_count', 'nb_visits', ComputedMetric::AGGREGATION_AVG);
+ $metric->setCategory('123');
+ $this->assertSame('123', $metric->getCategoryId());
+ }
+
+}
diff --git a/tests/PHPUnit/Integration/Plugin/Dimension/ActionDimensionTest.php b/tests/PHPUnit/Integration/Plugin/Dimension/ActionDimensionTest.php
index 1666b193db..006399bffd 100644
--- a/tests/PHPUnit/Integration/Plugin/Dimension/ActionDimensionTest.php
+++ b/tests/PHPUnit/Integration/Plugin/Dimension/ActionDimensionTest.php
@@ -17,7 +17,7 @@ use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
class FakeActionDimension extends ActionDimension
{
protected $columnName = 'fake_action_dimension_column';
- protected $columnType = 'INTEGER (10) DEFAULT 0';
+ protected $columnType = 'VARCHAR (255) DEFAULT 0';
public function set($param, $value)
{
@@ -79,7 +79,7 @@ class ActionDimensionTest extends IntegrationTestCase
{
$expected = array(
'log_link_visit_action' => array(
- "ADD COLUMN `fake_action_dimension_column` INTEGER (10) DEFAULT 0"
+ "ADD COLUMN `fake_action_dimension_column` VARCHAR (255) DEFAULT 0"
)
);
@@ -90,7 +90,7 @@ class ActionDimensionTest extends IntegrationTestCase
{
$expected = array(
'log_link_visit_action' => array(
- "MODIFY COLUMN `fake_action_dimension_column` INTEGER (10) DEFAULT 0"
+ "MODIFY COLUMN `fake_action_dimension_column` VARCHAR (255) DEFAULT 0"
)
);
@@ -99,7 +99,7 @@ class ActionDimensionTest extends IntegrationTestCase
public function test_getVersion_shouldUseColumnTypeAsVersion()
{
- $this->assertEquals('INTEGER (10) DEFAULT 0', $this->dimension->getVersion());
+ $this->assertEquals('VARCHAR (255) DEFAULT 0', $this->dimension->getVersion());
}
public function test_getSegment_ShouldReturnConfiguredSegments()
diff --git a/tests/PHPUnit/Integration/Plugin/Dimension/ConversionDimensionTest.php b/tests/PHPUnit/Integration/Plugin/Dimension/ConversionDimensionTest.php
index 7e6ac7191c..35cd30615d 100644
--- a/tests/PHPUnit/Integration/Plugin/Dimension/ConversionDimensionTest.php
+++ b/tests/PHPUnit/Integration/Plugin/Dimension/ConversionDimensionTest.php
@@ -17,7 +17,7 @@ use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
class FakeConversionDimension extends ConversionDimension
{
protected $columnName = 'fake_conversion_dimension_column';
- protected $columnType = 'INTEGER (10) DEFAULT 0';
+ protected $columnType = 'VARCHAR (255) DEFAULT 0';
public function set($param, $value)
{
@@ -79,7 +79,7 @@ class ConversionDimensionTest extends IntegrationTestCase
{
$expected = array(
'log_conversion' => array(
- "ADD COLUMN `fake_conversion_dimension_column` INTEGER (10) DEFAULT 0"
+ "ADD COLUMN `fake_conversion_dimension_column` VARCHAR (255) DEFAULT 0"
)
);
@@ -90,7 +90,7 @@ class ConversionDimensionTest extends IntegrationTestCase
{
$expected = array(
'log_conversion' => array(
- "MODIFY COLUMN `fake_conversion_dimension_column` INTEGER (10) DEFAULT 0"
+ "MODIFY COLUMN `fake_conversion_dimension_column` VARCHAR (255) DEFAULT 0"
)
);
@@ -99,7 +99,7 @@ class ConversionDimensionTest extends IntegrationTestCase
public function test_getVersion_shouldUseColumnTypeAsVersion()
{
- $this->assertEquals('INTEGER (10) DEFAULT 0', $this->dimension->getVersion());
+ $this->assertEquals('VARCHAR (255) DEFAULT 0', $this->dimension->getVersion());
}
public function test_getSegment_ShouldReturnConfiguredSegments()
diff --git a/tests/PHPUnit/Integration/Plugin/Dimension/VisitDimensionTest.php b/tests/PHPUnit/Integration/Plugin/Dimension/VisitDimensionTest.php
index 505880b8a8..5642feefef 100644
--- a/tests/PHPUnit/Integration/Plugin/Dimension/VisitDimensionTest.php
+++ b/tests/PHPUnit/Integration/Plugin/Dimension/VisitDimensionTest.php
@@ -19,7 +19,7 @@ use Piwik\Tracker\Visitor;
class FakeVisitDimension extends VisitDimension
{
protected $columnName = 'fake_visit_dimension_column';
- protected $columnType = 'INTEGER (10) DEFAULT 0';
+ protected $columnType = 'VARCHAR (255) DEFAULT 0';
public $requiredFields = array();
public function set($param, $value)
@@ -101,7 +101,7 @@ class VisitDimensionTest extends IntegrationTestCase
{
$expected = array(
'log_visit' => array(
- "ADD COLUMN `fake_visit_dimension_column` INTEGER (10) DEFAULT 0"
+ "ADD COLUMN `fake_visit_dimension_column` VARCHAR (255) DEFAULT 0"
)
);
@@ -112,10 +112,10 @@ class VisitDimensionTest extends IntegrationTestCase
{
$expected = array(
'log_visit' => array(
- "ADD COLUMN `fake_visit_dimension_column` INTEGER (10) DEFAULT 0"
+ "ADD COLUMN `fake_visit_dimension_column` VARCHAR (255) DEFAULT 0"
),
'log_conversion' => array(
- "ADD COLUMN `fake_visit_dimension_column` INTEGER (10) DEFAULT 0"
+ "ADD COLUMN `fake_visit_dimension_column` VARCHAR (255) DEFAULT 0"
)
);
@@ -126,49 +126,35 @@ class VisitDimensionTest extends IntegrationTestCase
{
$expected = array(
'log_visit' => array(
- "MODIFY COLUMN `fake_visit_dimension_column` INTEGER (10) DEFAULT 0"
+ "MODIFY COLUMN `fake_visit_dimension_column` VARCHAR (255) DEFAULT 0"
)
);
- $this->assertEquals($expected, $this->dimension->update(array()));
+ $this->assertEquals($expected, $this->dimension->update());
}
public function test_update_shouldUpdateLogVisitAndAddConversion_IfConversionMethodIsImplementedButNotInstalledYet()
{
$expected = array(
'log_visit' => array(
- "MODIFY COLUMN `fake_visit_dimension_column` INTEGER (10) DEFAULT 0"
+ "MODIFY COLUMN `fake_visit_dimension_column` VARCHAR (255) DEFAULT 0"
),
'log_conversion' => array(
- "ADD COLUMN `fake_visit_dimension_column` INTEGER (10) DEFAULT 0"
+ "ADD COLUMN `fake_visit_dimension_column` VARCHAR (255) DEFAULT 0"
)
);
- $this->assertEquals($expected, $this->conversionDimension->update(array()));
- }
-
- public function test_update_shouldUpdateLogVisitAndConversion_IfConversionMethodIsImplementedAndInstalled()
- {
- $expected = array(
- 'log_visit' => array(
- "MODIFY COLUMN `fake_visit_dimension_column` INTEGER (10) DEFAULT 0"
- ),
- 'log_conversion' => array(
- "MODIFY COLUMN `fake_visit_dimension_column` INTEGER (10) DEFAULT 0"
- )
- );
-
- $this->assertEquals($expected, $this->conversionDimension->update(array('fake_visit_dimension_column' => array())));
+ $this->assertEquals($expected, $this->conversionDimension->update());
}
public function test_getVersion_shouldUseColumnTypeAsVersion()
{
- $this->assertEquals('INTEGER (10) DEFAULT 0', $this->dimension->getVersion());
+ $this->assertEquals('VARCHAR (255) DEFAULT 0', $this->dimension->getVersion());
}
public function test_getVersion_shouldIncludeConversionMethodIntoVersionNumber_ToMakeSureUpdateMethodWillBeTriggeredWhenPluginAddedConversionMethodInNewVersion()
{
- $this->assertEquals('INTEGER (10) DEFAULT 01', $this->conversionDimension->getVersion());
+ $this->assertEquals('VARCHAR (255) DEFAULT 01', $this->conversionDimension->getVersion());
}
public function test_getSegment_ShouldReturnNoSegments_IfNoneConfigured()
diff --git a/tests/PHPUnit/Integration/SegmentTest.php b/tests/PHPUnit/Integration/SegmentTest.php
index 20b23065db..0558d6a381 100644
--- a/tests/PHPUnit/Integration/SegmentTest.php
+++ b/tests/PHPUnit/Integration/SegmentTest.php
@@ -512,7 +512,7 @@ class SegmentTest extends IntegrationTestCase
$this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query));
}
- public function test_getSelectQuery_whenJoinLogLinkVisitActionOnActionOnVisit_WithSameTableAliasButDifferentJoin()
+ public function test_getSelectQuery_whenJoinLogLinkVisitActionOnActionOnVisit_WithNoTableAliasButDifferentJoin()
{
$actionType = 3;
$idSite = 1;
@@ -549,7 +549,7 @@ class SegmentTest extends IntegrationTestCase
LEFT JOIN $logVisitTable AS log_visit
ON log_visit.idvisit = log_link_visit_action.idvisit
LEFT JOIN $logActionTable AS log_action
- ON (log_link_visit_action.idaction_name = log_action.idaction AND log_link_visit_action.idaction_url = log_action.idaction)
+ ON log_link_visit_action.idaction_name = log_action.idaction
WHERE ( log_link_visit_action.server_time >= ?
AND log_link_visit_action.server_time <= ?
AND log_link_visit_action.idsite = ? )
@@ -929,6 +929,99 @@ class SegmentTest extends IntegrationTestCase
$this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query));
}
+ public function test_getSelectQuery_whenLimit_withCustomJoinsAndSameColumns()
+ {
+ $select = "log_action_visit_entry_idaction_name.name AS 'EntryPageTitle', log_action_idaction_event_action.name AS 'EventAction', count(distinct log_visit.idvisit) AS 'nb_uniq_visits', count(distinct log_visit.idvisitor) AS 'nb_uniq_visitors', sum(case log_visit.visit_total_actions when 1 then 1 when 0 then 1 else 0 end) AS 'bounce_count', sum(log_visit.visit_total_actions) AS 'sum_actions', sum(log_visit.visit_goal_converted) AS 'sum_visit_goal_converted'";
+ $from = array('log_visit', array('table' => 'log_action', 'tableAlias' => 'log_action_visit_entry_idaction_name', 'joinOn' => 'log_visit.visit_entry_idaction_name = log_action_visit_entry_idaction_name.idaction'), 'log_link_visit_action', array('table' => 'log_action', 'tableAlias' => 'log_action_idaction_event_action', 'joinOn' => 'log_link_visit_action.idaction_event_action = log_action_idaction_event_action.idaction'));
+ $where = '';
+ $bind = array(1);
+
+ $segment = '';
+ $segment = new Segment($segment, $idSites = array());
+
+ $orderBy = 'nb_uniq_visits, log_action_idaction_event_action.name';
+ $groupBy = 'log_action_visit_entry_idaction_name.name, log_action_idaction_event_action.name';
+ $limit = 33;
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind, $orderBy, $groupBy, $limit);
+
+ $expected = array(
+ "sql" => "
+ SELECT log_inner.name AS 'EntryPageTitle', log_inner.name02fd90a35677a359ea5611a4bc456a6f AS 'EventAction', count(distinct log_inner.idvisit) AS 'nb_uniq_visits', count(distinct log_inner.idvisitor) AS 'nb_uniq_visitors', sum(case log_inner.visit_total_actions when 1 then 1 when 0 then 1 else 0 end) AS 'bounce_count', sum(log_inner.visit_total_actions) AS 'sum_actions', sum(log_inner.visit_goal_converted) AS 'sum_visit_goal_converted'
+ FROM (
+ SELECT log_action_visit_entry_idaction_name.name, log_action_idaction_event_action.name as name02fd90a35677a359ea5611a4bc456a6f, log_visit.idvisit, log_visit.idvisitor, log_visit.visit_total_actions, log_visit.visit_goal_converted
+ FROM log_visit AS log_visit
+ LEFT JOIN log_action AS log_action_visit_entry_idaction_name ON log_visit.visit_entry_idaction_name = log_action_visit_entry_idaction_name.idaction
+ LEFT JOIN log_link_visit_action AS log_link_visit_action ON log_link_visit_action.idvisit = log_visit.idvisit
+ LEFT JOIN log_action AS log_action_idaction_event_action ON log_link_visit_action.idaction_event_action = log_action_idaction_event_action.idaction
+ ORDER BY nb_uniq_visits, log_action_idaction_event_action.name LIMIT 0, 33 )
+ AS log_inner
+ GROUP BY log_inner.name, log_inner.name02fd90a35677a359ea5611a4bc456a6f
+ ORDER BY nb_uniq_visits, log_inner.name02fd90a35677a359ea5611a4bc456a6f",
+ "bind" => array(1));
+
+ $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query));
+ }
+
+ public function test_getSelectQuery_whenLimit_withCustomJoinsAndSameColumnsAndSimilarColumns()
+ {
+ $select = 'log_link_visit_action.idvisit,
+ log_visit.idvisit,
+ count(log_visit.idvisit) as numvisits,
+ count(distinct log_visit.idvisit ) as numvisitors,
+ log_visit.idvisitor,
+ log_action.name as url,
+ sum(log_link_visit_action.time_spent) as `13`,
+ sum(case log_visit.visit_total_actions when 1 then 1 when 0 then 1 else 0 end) as `6`';
+ $from = array('log_visit', 'log_link_visit_action');
+ $where = '';
+ $bind = array(1);
+
+ $segment = '';
+ $segment = new Segment($segment, $idSites = array());
+
+ $orderBy = 'url, log_visit.idvisit';
+ $groupBy = 'log_visit.idvisit, log_visit.idvisit , log_visit.idvisitor, log_visit.idvisitor , log_link_visit_action.idvisit';
+ $limit = 33;
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind, $orderBy, $groupBy, $limit);
+
+ // should have replaced some idvisit columns but not idvisitor column
+ $expected = array(
+ "sql" => "
+ SELECT
+ log_inner.idvisit,
+ log_inner.idvisit5d489886e80b4258a9407b219a4e2811,
+ count(log_inner.idvisit5d489886e80b4258a9407b219a4e2811) as numvisits,
+ count(distinct log_inner.idvisit5d489886e80b4258a9407b219a4e2811 ) as numvisitors,
+ log_inner.idvisitor,
+ log_inner.name as url,
+ sum(log_inner.time_spent) as `13`,
+ sum(case log_inner.visit_total_actions when 1 then 1 when 0 then 1 else 0 end) as `6`
+ FROM
+
+ (
+
+ SELECT
+ log_link_visit_action.idvisit,
+log_visit.idvisit as idvisit5d489886e80b4258a9407b219a4e2811,
+log_visit.idvisitor,
+log_action.name,
+log_link_visit_action.time_spent,
+log_visit.visit_total_actions
+ FROM
+ log_visit AS log_visit LEFT JOIN log_link_visit_action AS log_link_visit_action ON log_link_visit_action.idvisit = log_visit.idvisit
+ ORDER BY
+ url, log_visit.idvisit LIMIT 0, 33
+ ) AS log_inner
+ GROUP BY
+ log_inner.idvisit5d489886e80b4258a9407b219a4e2811, log_inner.idvisit5d489886e80b4258a9407b219a4e2811 , log_inner.idvisitor, log_inner.idvisitor , log_inner.idvisit
+ ORDER BY
+ url, log_inner.idvisit5d489886e80b4258a9407b219a4e2811",
+ "bind" => array(1));
+
+ $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query));
+ }
public function test_getSelectQuery_whenLimitAndOffset_outerQueryShouldNotHaveOffset()
{
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerHour__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerHour__API.getSuggestedValuesForSegment.xml
new file mode 100644
index 0000000000..98314b9ea4
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerHour__API.getSuggestedValuesForSegment.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>0</row>
+ <row>1</row>
+ <row>2</row>
+ <row>3</row>
+ <row>4</row>
+ <row>5</row>
+ <row>6</row>
+ <row>7</row>
+ <row>8</row>
+ <row>9</row>
+ <row>10</row>
+ <row>11</row>
+ <row>12</row>
+ <row>13</row>
+ <row>14</row>
+ <row>15</row>
+ <row>16</row>
+ <row>17</row>
+ <row>18</row>
+ <row>19</row>
+ <row>20</row>
+ <row>21</row>
+ <row>22</row>
+ <row>23</row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerHour__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerHour__VisitsSummary.get_range.xml
new file mode 100644
index 0000000000..7ace3fcbe7
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerHour__VisitsSummary.get_range.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <nb_visits>18</nb_visits>
+ <nb_actions>18</nb_actions>
+ <nb_visits_converted>18</nb_visits_converted>
+ <bounce_count>18</bounce_count>
+ <sum_visit_length>0</sum_visit_length>
+ <max_actions>1</max_actions>
+ <bounce_rate>100%</bounce_rate>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerMinute__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerMinute__API.getSuggestedValuesForSegment.xml
new file mode 100644
index 0000000000..6e7cfc1a1d
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerMinute__API.getSuggestedValuesForSegment.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>0</row>
+ <row>1</row>
+ <row>2</row>
+ <row>3</row>
+ <row>4</row>
+ <row>5</row>
+ <row>6</row>
+ <row>7</row>
+ <row>8</row>
+ <row>9</row>
+ <row>10</row>
+ <row>11</row>
+ <row>12</row>
+ <row>13</row>
+ <row>14</row>
+ <row>15</row>
+ <row>16</row>
+ <row>17</row>
+ <row>18</row>
+ <row>19</row>
+ <row>20</row>
+ <row>21</row>
+ <row>22</row>
+ <row>23</row>
+ <row>24</row>
+ <row>25</row>
+ <row>26</row>
+ <row>27</row>
+ <row>28</row>
+ <row>29</row>
+ <row>30</row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerMinute__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerMinute__VisitsSummary.get_range.xml
new file mode 100644
index 0000000000..f3bee672d6
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actionServerMinute__VisitsSummary.get_range.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <nb_visits>35</nb_visits>
+ <nb_actions>95</nb_actions>
+ <nb_visits_converted>35</nb_visits_converted>
+ <bounce_count>18</bounce_count>
+ <sum_visit_length>27557</sum_visit_length>
+ <max_actions>5</max_actions>
+ <bounce_rate>51%</bounce_rate>
+ <nb_actions_per_visit>2.7</nb_actions_per_visit>
+ <avg_time_on_site>787</avg_time_on_site>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml
index 7b9c37df18..811b7dac21 100644
--- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml
@@ -1,7 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<result>
- <row>Desktop</row>
- <row>Smartphone</row>
- <row>Phablet</row>
- <row>Tablet</row>
+ <row>desktop</row>
+ <row>smartphone</row>
+ <row>tablet</row>
+ <row>feature phone</row>
+ <row>console</row>
+ <row>tv</row>
+ <row>car browser</row>
+ <row>smart display</row>
+ <row>camera</row>
+ <row>portable media player</row>
+ <row>phablet</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_interaction_position__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_interaction_position__API.getSuggestedValuesForSegment.xml
new file mode 100644
index 0000000000..c234bed59e
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_interaction_position__API.getSuggestedValuesForSegment.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result /> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml
index 9b61eb17b1..000a8d45c4 100644
--- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>direct</row>
+ <row>website</row>
<row>search</row>
+ <row>campaign</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml
index 405fd9750c..5acd8f333f 100644
--- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>none</row>
+ <row>ordered</row>
+ <row>abandonedCart</row>
+ <row>orderedThenAbandonedCart</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEndServerMinute__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEndServerMinute__API.getSuggestedValuesForSegment.xml
new file mode 100644
index 0000000000..6e7cfc1a1d
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEndServerMinute__API.getSuggestedValuesForSegment.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>0</row>
+ <row>1</row>
+ <row>2</row>
+ <row>3</row>
+ <row>4</row>
+ <row>5</row>
+ <row>6</row>
+ <row>7</row>
+ <row>8</row>
+ <row>9</row>
+ <row>10</row>
+ <row>11</row>
+ <row>12</row>
+ <row>13</row>
+ <row>14</row>
+ <row>15</row>
+ <row>16</row>
+ <row>17</row>
+ <row>18</row>
+ <row>19</row>
+ <row>20</row>
+ <row>21</row>
+ <row>22</row>
+ <row>23</row>
+ <row>24</row>
+ <row>25</row>
+ <row>26</row>
+ <row>27</row>
+ <row>28</row>
+ <row>29</row>
+ <row>30</row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEndServerMinute__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEndServerMinute__VisitsSummary.get_range.xml
new file mode 100644
index 0000000000..7ace3fcbe7
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEndServerMinute__VisitsSummary.get_range.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <nb_visits>18</nb_visits>
+ <nb_actions>18</nb_actions>
+ <nb_visits_converted>18</nb_visits_converted>
+ <bounce_count>18</bounce_count>
+ <sum_visit_length>0</sum_visit_length>
+ <max_actions>1</max_actions>
+ <bounce_rate>100%</bounce_rate>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalMinute__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalMinute__API.getSuggestedValuesForSegment.xml
new file mode 100644
index 0000000000..6e7cfc1a1d
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalMinute__API.getSuggestedValuesForSegment.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>0</row>
+ <row>1</row>
+ <row>2</row>
+ <row>3</row>
+ <row>4</row>
+ <row>5</row>
+ <row>6</row>
+ <row>7</row>
+ <row>8</row>
+ <row>9</row>
+ <row>10</row>
+ <row>11</row>
+ <row>12</row>
+ <row>13</row>
+ <row>14</row>
+ <row>15</row>
+ <row>16</row>
+ <row>17</row>
+ <row>18</row>
+ <row>19</row>
+ <row>20</row>
+ <row>21</row>
+ <row>22</row>
+ <row>23</row>
+ <row>24</row>
+ <row>25</row>
+ <row>26</row>
+ <row>27</row>
+ <row>28</row>
+ <row>29</row>
+ <row>30</row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalMinute__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalMinute__VisitsSummary.get_range.xml
new file mode 100644
index 0000000000..d8bcdace18
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalMinute__VisitsSummary.get_range.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <nb_visits>0</nb_visits>
+ <nb_actions>0</nb_actions>
+ <nb_visits_converted>0</nb_visits_converted>
+ <bounce_count>0</bounce_count>
+ <sum_visit_length>0</sum_visit_length>
+ <max_actions>0</max_actions>
+ <bounce_rate>0%</bounce_rate>
+ <nb_actions_per_visit>0</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerMinute__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerMinute__API.getSuggestedValuesForSegment.xml
new file mode 100644
index 0000000000..6e7cfc1a1d
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerMinute__API.getSuggestedValuesForSegment.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>0</row>
+ <row>1</row>
+ <row>2</row>
+ <row>3</row>
+ <row>4</row>
+ <row>5</row>
+ <row>6</row>
+ <row>7</row>
+ <row>8</row>
+ <row>9</row>
+ <row>10</row>
+ <row>11</row>
+ <row>12</row>
+ <row>13</row>
+ <row>14</row>
+ <row>15</row>
+ <row>16</row>
+ <row>17</row>
+ <row>18</row>
+ <row>19</row>
+ <row>20</row>
+ <row>21</row>
+ <row>22</row>
+ <row>23</row>
+ <row>24</row>
+ <row>25</row>
+ <row>26</row>
+ <row>27</row>
+ <row>28</row>
+ <row>29</row>
+ <row>30</row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerMinute__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerMinute__VisitsSummary.get_range.xml
new file mode 100644
index 0000000000..7ace3fcbe7
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerMinute__VisitsSummary.get_range.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <nb_visits>18</nb_visits>
+ <nb_actions>18</nb_actions>
+ <nb_visits_converted>18</nb_visits_converted>
+ <bounce_count>18</bounce_count>
+ <sum_visit_length>0</sum_visit_length>
+ <max_actions>1</max_actions>
+ <bounce_rate>100%</bounce_rate>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerHour__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerHour__API.getSuggestedValuesForSegment.xml
new file mode 100644
index 0000000000..98314b9ea4
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerHour__API.getSuggestedValuesForSegment.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>0</row>
+ <row>1</row>
+ <row>2</row>
+ <row>3</row>
+ <row>4</row>
+ <row>5</row>
+ <row>6</row>
+ <row>7</row>
+ <row>8</row>
+ <row>9</row>
+ <row>10</row>
+ <row>11</row>
+ <row>12</row>
+ <row>13</row>
+ <row>14</row>
+ <row>15</row>
+ <row>16</row>
+ <row>17</row>
+ <row>18</row>
+ <row>19</row>
+ <row>20</row>
+ <row>21</row>
+ <row>22</row>
+ <row>23</row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerHour__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerHour__VisitsSummary.get_range.xml
new file mode 100644
index 0000000000..7ace3fcbe7
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerHour__VisitsSummary.get_range.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <nb_visits>18</nb_visits>
+ <nb_actions>18</nb_actions>
+ <nb_visits_converted>18</nb_visits_converted>
+ <bounce_count>18</bounce_count>
+ <sum_visit_length>0</sum_visit_length>
+ <max_actions>1</max_actions>
+ <bounce_rate>100%</bounce_rate>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerMinute__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerMinute__API.getSuggestedValuesForSegment.xml
new file mode 100644
index 0000000000..6e7cfc1a1d
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerMinute__API.getSuggestedValuesForSegment.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>0</row>
+ <row>1</row>
+ <row>2</row>
+ <row>3</row>
+ <row>4</row>
+ <row>5</row>
+ <row>6</row>
+ <row>7</row>
+ <row>8</row>
+ <row>9</row>
+ <row>10</row>
+ <row>11</row>
+ <row>12</row>
+ <row>13</row>
+ <row>14</row>
+ <row>15</row>
+ <row>16</row>
+ <row>17</row>
+ <row>18</row>
+ <row>19</row>
+ <row>20</row>
+ <row>21</row>
+ <row>22</row>
+ <row>23</row>
+ <row>24</row>
+ <row>25</row>
+ <row>26</row>
+ <row>27</row>
+ <row>28</row>
+ <row>29</row>
+ <row>30</row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerMinute__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerMinute__VisitsSummary.get_range.xml
new file mode 100644
index 0000000000..7ace3fcbe7
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitStartServerMinute__VisitsSummary.get_range.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <nb_visits>18</nb_visits>
+ <nb_actions>18</nb_actions>
+ <nb_visits_converted>18</nb_visits_converted>
+ <bounce_count>18</bounce_count>
+ <sum_visit_length>0</sum_visit_length>
+ <max_actions>1</max_actions>
+ <bounce_rate>100%</bounce_rate>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>0</avg_time_on_site>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml
index 84613aaaf2..e598eaeee8 100644
--- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>returningCustomer</row>
+ <row>returning</row>
<row>new</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml
index b6cff4f6c8..66b9eb6bd3 100644
--- a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml
@@ -8,7 +8,7 @@
<name>Visits per server time</name>
<module>VisitTime</module>
<action>getVisitInformationPerServerTime</action>
- <dimension>Server time</dimension>
+ <dimension>Server time - hour (End of visit)</dimension>
<documentation>This graph shows what time it was in the &lt;strong&gt; server's time zone &lt;/strong&gt; during the visits.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
@@ -43,7 +43,7 @@
<uniqueId>VisitTime_getVisitInformationPerServerTime</uniqueId>
</metadata>
<columns>
- <label>Server time</label>
+ <label>Server time - hour (End of visit)</label>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
index f59cb9522a..442db1a9b3 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
@@ -8,7 +8,7 @@
<name>Page titles</name>
<module>Actions</module>
<action>getPageTitles</action>
- <dimension>Page Name</dimension>
+ <dimension>Page Title</dimension>
<documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metricsDocumentation>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
@@ -34,7 +34,7 @@
<uniqueId>Actions_getPageTitles</uniqueId>
</metadata>
<columns>
- <label>Page Name</label>
+ <label>Page Title</label>
<exit_rate>Exit rate</exit_rate>
</columns>
<reportData>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml
index 92feaea19a..2137a5f645 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml
@@ -8,7 +8,7 @@
<name>Visits per server time</name>
<module>VisitTime</module>
<action>getVisitInformationPerServerTime</action>
- <dimension>Server time</dimension>
+ <dimension>Server time - hour (End of visit)</dimension>
<documentation>This graph shows what time it was in the &lt;strong&gt; server's time zone &lt;/strong&gt; during the visits.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
@@ -28,7 +28,7 @@
<uniqueId>VisitTime_getVisitInformationPerServerTime</uniqueId>
</metadata>
<columns>
- <label>Server time</label>
+ <label>Server time - hour (End of visit)</label>
<nb_visits>Visits</nb_visits>
<revenue>Revenue</revenue>
</columns>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
index a9e1f34081..33c6b4c63d 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
@@ -8,7 +8,7 @@
<name>Page titles</name>
<module>Actions</module>
<action>getPageTitles</action>
- <dimension>Page Name</dimension>
+ <dimension>Page Title</dimension>
<documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
@@ -38,7 +38,7 @@
<uniqueId>Actions_getPageTitles</uniqueId>
</metadata>
<columns>
- <label>Page Name</label>
+ <label>Page Title</label>
<nb_hits>Pageviews</nb_hits>
<bounce_rate>Bounce Rate</bounce_rate>
</columns>
diff --git a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml
index 649d127ab5..55f88165ef 100644
--- a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml
@@ -190,7 +190,7 @@
<max>1</max>
</nb_hits_1>
</metrics>
- <dimension>Page Name</dimension>
+ <dimension>Page Title</dimension>
<columns>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml
index 573c484414..1da0cd6ff6 100644
--- a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml
@@ -48,7 +48,7 @@
<change>+100%</change>
</nb_hits_1>
</metrics>
- <dimension>Page Name</dimension>
+ <dimension>Page Title</dimension>
<columns>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml
index 5b049977a4..b5a37adbc8 100644
--- a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml
@@ -153,6 +153,6 @@
<max>2.8</max>
</avg_time_generation>
</metrics>
- <dimension>Page Name</dimension>
+ <dimension>Page Title</dimension>
</metadata>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml
index a4d4962bb2..a30e3f3a2e 100644
--- a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml
@@ -89,6 +89,6 @@
<change>-92%</change>
</avg_time_generation>
</metrics>
- <dimension>Page Name</dimension>
+ <dimension>Page Title</dimension>
</metadata>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
index 3808a4f5b5..289959a721 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,7 +8,7 @@
<name>Page titles</name>
<module>Actions</module>
<action>getPageTitles</action>
- <dimension>Page Name</dimension>
+ <dimension>Page Title</dimension>
<documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
@@ -45,7 +45,7 @@
<uniqueId>Actions_getPageTitles</uniqueId>
</metadata>
<columns>
- <label>Page Name</label>
+ <label>Page Title</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
index f88c7b0657..a61bf4e2b8 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
@@ -8,7 +8,7 @@
<name>Page titles</name>
<module>Actions</module>
<action>getPageTitles</action>
- <dimension>Page Name</dimension>
+ <dimension>Page Title</dimension>
<documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
@@ -45,7 +45,7 @@
<uniqueId>Actions_getPageTitles</uniqueId>
</metadata>
<columns>
- <label>Page Name</label>
+ <label>Page Title</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
index ba0c0464ac..2ba4f93a54 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,7 +8,7 @@
<name>Page titles</name>
<module>Actions</module>
<action>getPageTitles</action>
- <dimension>Page Name</dimension>
+ <dimension>Page Title</dimension>
<documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
@@ -46,7 +46,7 @@
<uniqueId>Actions_getPageTitles</uniqueId>
</metadata>
<columns>
- <label>Page Name</label>
+ <label>Page Title</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html
index e30020a41d..5135698bdc 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html
@@ -898,7 +898,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Operating System versions&nbsp;&nbsp;
+ &nbsp;Operating system version&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -2878,7 +2878,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Local time&nbsp;&nbsp;
+ &nbsp;Local time - hour (Start of visit)&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -3475,7 +3475,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Server time&nbsp;&nbsp;
+ &nbsp;Server time - hour (End of visit)&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -4898,7 +4898,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Page Name&nbsp;&nbsp;
+ &nbsp;Page Title&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Pageviews&nbsp;&nbsp;
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
index 4ccc27edec..d503e5ebd0 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
@@ -849,7 +849,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Operating System versions&nbsp;&nbsp;
+ &nbsp;Operating system version&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -2703,7 +2703,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Local time&nbsp;&nbsp;
+ &nbsp;Local time - hour (Start of visit)&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -3293,7 +3293,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Server time&nbsp;&nbsp;
+ &nbsp;Server time - hour (End of visit)&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -4653,7 +4653,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Page Name&nbsp;&nbsp;
+ &nbsp;Page Title&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Pageviews&nbsp;&nbsp;
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdf b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdf
index 4b292c91f7..130ab4d3a0 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdf
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdf
Binary files differ
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
index 50e1fd9532..fe04019899 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
@@ -332,7 +332,7 @@
<name>Operating System versions</name>
<module>DevicesDetection</module>
<action>getOsVersions</action>
- <dimension>Operating System versions</dimension>
+ <dimension>Operating system version</dimension>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
@@ -918,7 +918,7 @@
<name>Visits per local time</name>
<module>VisitTime</module>
<action>getVisitInformationPerLocalTime</action>
- <dimension>Local time</dimension>
+ <dimension>Local time - hour (Start of visit)</dimension>
<documentation>This graph shows what time it was in the &lt;strong&gt; visitors' time zones &lt;/strong&gt; during their visits.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
@@ -959,7 +959,7 @@
<name>Visits per server time</name>
<module>VisitTime</module>
<action>getVisitInformationPerServerTime</action>
- <dimension>Server time</dimension>
+ <dimension>Server time - hour (End of visit)</dimension>
<documentation>This graph shows what time it was in the &lt;strong&gt; server's time zone &lt;/strong&gt; during the visits.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
@@ -1265,7 +1265,7 @@
<name>Page titles</name>
<module>Actions</module>
<action>getPageTitles</action>
- <dimension>Page Name</dimension>
+ <dimension>Page Title</dimension>
<documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
index 326487de23..d72a0e6802 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
@@ -2,135 +2,86 @@
<result>
<row>
<type>metric</type>
- <category>Visit</category>
+ <category>Visitors</category>
+ <name>Actions In Visit</name>
+ <segment>actions</segment>
+ </row>
+ <row>
+ <type>metric</type>
+ <category>Visitors</category>
<name>Days since first visit</name>
<segment>daysSinceFirstVisit</segment>
</row>
<row>
<type>metric</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Days since last Ecommerce order</name>
<segment>daysSinceLastEcommerceOrder</segment>
</row>
<row>
<type>metric</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Days since last visit</name>
<segment>daysSinceLastVisit</segment>
</row>
<row>
<type>metric</type>
- <category>Visit</category>
- <name>Number of Actions</name>
- <segment>actions</segment>
+ <category>Visitors</category>
+ <name>Local time - minute (Start of visit)</name>
+ <segment>visitLocalMinute</segment>
+ <acceptedValues>0, 1, 2, 3, ..., 67, 57, 58, 59</acceptedValues>
</row>
<row>
<type>metric</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Number of Interactions</name>
<segment>interactions</segment>
<acceptedValues>Any positive integer</acceptedValues>
</row>
<row>
<type>metric</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Number of Internal Searches</name>
<segment>searches</segment>
<acceptedValues>To select all visits who used internal Site Search, use: &amp;segment=searches&gt;0</acceptedValues>
</row>
<row>
<type>metric</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Number of visits</name>
<segment>visitCount</segment>
</row>
<row>
<type>metric</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Total events</name>
<segment>events</segment>
<acceptedValues>To select all visits who triggered an Event, use: &amp;segment=events&gt;0</acceptedValues>
</row>
<row>
<type>metric</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Visit Duration (in seconds)</name>
<segment>visitDuration</segment>
</row>
<row>
<type>metric</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Visitor IP</name>
<segment>visitIp</segment>
<acceptedValues>13.54.122.1. &lt;/code&gt;Select IP ranges with notation: &lt;code&gt;visitIp&gt;13.54.122.0;visitIp&lt;13.54.122.255</acceptedValues>
<permission>1</permission>
</row>
<row>
- <type>metric</type>
- <category>Actions</category>
- <name>Bandwidth</name>
- <segment>bandwidth</segment>
- <acceptedValues>Any number in bytes, eg. 1000</acceptedValues>
- </row>
- <row>
- <type>dimension</type>
- <category>Visit Location</category>
- <name>City</name>
- <segment>city</segment>
- <acceptedValues>Sydney, Sao Paolo, Rome, etc.</acceptedValues>
- </row>
- <row>
- <type>dimension</type>
- <category>Visit Location</category>
- <name>Continent</name>
- <segment>continentCode</segment>
- <acceptedValues>eur, asi, amc, amn, ams, afr, ant, oce</acceptedValues>
- </row>
- <row>
- <type>dimension</type>
- <category>Visit Location</category>
- <name>Country</name>
- <segment>countryCode</segment>
- <acceptedValues>de, us, fr, in, es, etc.</acceptedValues>
- </row>
- <row>
- <type>dimension</type>
- <category>Visit Location</category>
- <name>Language</name>
- <segment>languageCode</segment>
- <acceptedValues>de, fr, en-gb, zh-cn, etc.</acceptedValues>
- </row>
- <row>
- <type>dimension</type>
- <category>Visit Location</category>
- <name>Latitude</name>
- <segment>latitude</segment>
- <acceptedValues>-33.578, 40.830, etc.&lt;br/&gt;You can select visitors within a lat/long range using &amp;segment=lat&gt;X;lat&lt;Y;long&gt;M;long&lt;N.</acceptedValues>
- </row>
- <row>
<type>dimension</type>
- <category>Visit Location</category>
- <name>Longitude</name>
- <segment>longitude</segment>
- <acceptedValues>-70.664, 14.326, etc.</acceptedValues>
- </row>
- <row>
- <type>dimension</type>
- <category>Visit Location</category>
- <name>Region</name>
- <segment>regionCode</segment>
- <acceptedValues>01 02, OR, P8, etc.&lt;br/&gt;eg. region=A1;country=fr</acceptedValues>
- </row>
- <row>
- <type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Browser</name>
<segment>browserCode</segment>
<acceptedValues>FF, IE, CH, SF, OP, etc.</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Browser engine</name>
<segment>browserEngine</segment>
<acceptedValues>Trident, WebKit, Presto, Gecko, Blink, etc.</acceptedValues>
@@ -138,63 +89,84 @@
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Browser version</name>
<segment>browserVersion</segment>
<acceptedValues>1.0, 8.0, etc.</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Device brand</name>
<segment>deviceBrand</segment>
<acceptedValues>3Q, 4Good, Acer, Ainol, Airness, Airties, Alcatel, Allview, Altech UEC, Amazon, Amoi, Apple, Archos, Arnova, ARRIS, Asus, Audiovox, Avvio, Axxion, BangOlufsen, Barnes &amp; Noble, BBK, Becker, Beetel, BenQ, BenQ-Siemens, Bird, Blackview, Blaupunkt, Blu, Bmobile, Boway, bq, Bravis, Brondi, Bush, Capitel, Captiva, Carrefour, Casio, Cat, Celkon, Changhong, Cherry Mobile, China Mobile, CnM, Coby Kyros, Compal, Compaq, ConCorde, Coolpad, Cowon, CreNova, Cricket, Crius Mea, Crosscall, Cube, CUBOT, Cyrus, Danew, Datang, Dbtel, Dell, Denver, Desay, DEXP, Dicam, Digma, DMM, DNS, DoCoMo, Doogee, Doov, Dopod, Dune HD, E-Boda, Easypix, EBEST, ECS, Elephone, Energy Sistem, Ericsson, Ericy, Eton, eTouch, Evertek, Evolveo, Explay, Ezio, Ezze, Fairphone, Fly, Foxconn, Freetel, Fujitsu, Garmin-Asus, Gateway, Gemini, Gigabyte, Gigaset, Gionee, GOCLEVER, Goly, Google, Gradiente, Grundig, Haier, Hasee, Hi-Level, Hisense, Homtom, Hosin, HP, HTC, Huawei, Humax, Hyrican, Hyundai, i-Joy, i-mate, i-mobile, iBall, iBerry, IconBIT, Ikea, iKoMo, iNew, Infinix, Inkti, Innostream, INQ, Intek, Intex, Inverto, iOcean, iTel, JAY-Tech, Jiayu, Jolla, K-Touch, Karbonn, Kazam, KDDI, Kiano, Kingsun, Komu, Konka, Konrow, Koobee, KOPO, Koridy, KT-Tech, Kumai, Kyocera, Landvo, Lanix, Lava, LCT, LeEco, Lenco, Lenovo, Le Pan, Lexibook, LG, Lingwin, Loewe, Logicom, LYF, M.T.T., Majestic, Manta Multimedia, Mecer, Mediacom, MediaTek, Medion, MEEG, Meizu, Memup, Metz, MEU, MicroMax, Microsoft, Mio, Mitsubishi, MIXC, MLLED, Mobistel, Modecom, Mofut, Motorola, Mpman, MSI, MyPhone, NEC, Neffos, Netgear, Newgen, Nexian, NextBook, NGM, Nikon, Nintendo, Noain, Nokia, Nomi, Nous, Nvidia, O2, Odys, Onda, OnePlus, OPPO, Opsson, Orange, Ouki, OUYA, Overmax, Oysters, Palm, Panasonic, Pantech, PEAQ, Pentagram, Philips, phoneOne, Pioneer, Ployer, Point of View, Polaroid, PolyPad, Pomp, Positivo, PPTV, Prestigio, ProScan, PULID, Qilive, QMobile, Qtek, Quechua, Ramos, RCA Tablets, Readboy, Rikomagic, RIM, Roku, Rover, Sagem, Samsung, Sanyo, Sega, Selevision, Sencor, Sendo, Senseit, SFR, Sharp, Siemens, Skyworth, Smart, Smartfren, Smartisan, Softbank, Sony, Sony Ericsson, Spice, Star, Stonex, Storex, Sumvision, SunVan, SuperSonic, Supra, Symphony, T-Mobile, TB Touch, TCL, TechniSat, TechnoTrend, Tecno Mobile, Telefunken, Telenor, Telit, Tesco, Tesla, teXet, ThL, Thomson, TIANYU, TiPhone, Tolino, Toplux, Toshiba, TrekStor, Trevi, Tunisie Telecom, Turbo-X, TVC, UMIDIGI, Uniscope, Unknown, Unowhy, UTStarcom, Vastking, Vertu, Vestel, Videocon, Videoweb, ViewSonic, Vitelcom, Vivo, Vizio, VK Mobile, Vodafone, Voto, Voxtel, Walton, Web TV, WellcoM, Wexler, Wiko, Wileyfox, Wolder, Wolfgang, Wonu, Woxter, Xiaomi, Xolo, Yarvik, Ytone, Yuandao, Yusun, Zeemi, Zen, Zonda, Zopo, ZTE</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Device type</name>
<segment>deviceType</segment>
<acceptedValues>desktop, smartphone, tablet, feature phone, console, tv, car browser, smart display, camera, portable media player, phablet</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
- <name>Local time</name>
+ <category>Visitors</category>
+ <name>Local time - hour (Start of visit)</name>
<segment>visitLocalHour</segment>
<acceptedValues>0, 1, 2, 3, ..., 20, 21, 22, 23</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Operating system</name>
<segment>operatingSystemCode</segment>
<acceptedValues>WIN, MAC, LIN, AND, IPD, etc.</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Operating system version</name>
<segment>operatingSystemVersion</segment>
<acceptedValues>XP, 7, 2.3, 5.1, ...</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Resolution</name>
<segment>resolution</segment>
<acceptedValues>1280x1024, 800x600, etc.</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
- <name>Server time</name>
+ <category>Visitors</category>
+ <name>Server time - hour (End of visit)</name>
<segment>visitServerHour</segment>
<acceptedValues>0, 1, 2, 3, ..., 20, 21, 22, 23</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
+ <name>Server time - hour (Start of visit)</name>
+ <segment>visitStartServerHour</segment>
+ <acceptedValues>0, 1, 2, 3, ..., 20, 21, 22, 23</acceptedValues>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Visitors</category>
+ <name>Server time - minute (End of visit)</name>
+ <segment>visitEndServerMinute</segment>
+ <acceptedValues>0, 1, 2, 3, ..., 56, 57, 58, 59</acceptedValues>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Visitors</category>
+ <name>Server time - minute (Start of visit)</name>
+ <segment>visitStartServerMinute</segment>
+ <acceptedValues>0, 1, 2, 3, ..., 56, 57, 58, 59</acceptedValues>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Visitors</category>
<name>User ID</name>
<segment>userId</segment>
<acceptedValues>any non empty unique string identifying the user (such as an email address or a username).</acceptedValues>
@@ -202,14 +174,14 @@
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Visit Ecommerce status at the end of the visit</name>
<segment>visitEcommerceStatus</segment>
<acceptedValues>none, ordered, abandonedCart, orderedThenAbandonedCart. For example, to select all visits that have made an Ecommerce order, the API request would contain &quot;&amp;segment=visitEcommerceStatus==ordered,visitEcommerceStatus==orderedThenAbandonedCart&quot;</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Visit ID</name>
<segment>visitId</segment>
<acceptedValues>Any integer.</acceptedValues>
@@ -217,28 +189,28 @@
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Visit converted a specific Goal Id</name>
<segment>visitConvertedGoalId</segment>
<acceptedValues>1, 2, 3, etc.</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Visit converted at least one Goal</name>
<segment>visitConverted</segment>
<acceptedValues>0, 1</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Visit type</name>
<segment>visitorType</segment>
<acceptedValues>new, returning, returningCustomer. For example, to select all visitors who have returned to the website, including those who have bought something in their previous visits, the API request would contain &quot;&amp;segment=visitorType==returning,visitorType==returningCustomer&quot;</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Visit</category>
+ <category>Visitors</category>
<name>Visitor ID</name>
<segment>visitorId</segment>
<acceptedValues>34c31e04394bdc63 - any 16 Hexadecimal chars ID, which can be fetched using the Tracking API function getVisitorId()</acceptedValues>
@@ -246,49 +218,52 @@
</row>
<row>
<type>dimension</type>
- <category>Referrers</category>
- <name>Keyword</name>
- <segment>referrerKeyword</segment>
- <acceptedValues>Encoded%20Keyword, keyword</acceptedValues>
+ <category>Visit Location</category>
+ <name>City</name>
+ <segment>city</segment>
+ <acceptedValues>Sydney, Sao Paolo, Rome, etc.</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Referrers</category>
- <name>Referrer Name</name>
- <segment>referrerName</segment>
- <acceptedValues>twitter.com, www.facebook.com, Bing, Google, Yahoo, CampaignName</acceptedValues>
+ <category>Visit Location</category>
+ <name>Continent</name>
+ <segment>continentCode</segment>
+ <acceptedValues>eur, asi, amc, amn, ams, afr, ant, oce</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Referrers</category>
- <name>Referrer Type</name>
- <segment>referrerType</segment>
- <acceptedValues>direct, search, website, campaign</acceptedValues>
+ <category>Visit Location</category>
+ <name>Country</name>
+ <segment>countryCode</segment>
+ <acceptedValues>de, us, fr, in, es, etc.</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Referrers</category>
- <name>Referrer URL</name>
- <segment>referrerUrl</segment>
- <acceptedValues>http%3A%2F%2Fwww.example.org%2Freferer-page.htm</acceptedValues>
+ <category>Visit Location</category>
+ <name>Language</name>
+ <segment>languageCode</segment>
+ <acceptedValues>de, fr, en-gb, zh-cn, etc.</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Events</category>
- <name>Event Action</name>
- <segment>eventAction</segment>
+ <category>Visit Location</category>
+ <name>Latitude</name>
+ <segment>latitude</segment>
+ <acceptedValues>-33.578, 40.830, etc.&lt;br/&gt;You can select visitors within a lat/long range using &amp;segment=lat&gt;X;lat&lt;Y;long&gt;M;long&lt;N.</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Events</category>
- <name>Event Category</name>
- <segment>eventCategory</segment>
+ <category>Visit Location</category>
+ <name>Longitude</name>
+ <segment>longitude</segment>
+ <acceptedValues>-70.664, 14.326, etc.</acceptedValues>
</row>
<row>
<type>dimension</type>
- <category>Events</category>
- <name>Event Name</name>
- <segment>eventName</segment>
+ <category>Visit Location</category>
+ <name>Region</name>
+ <segment>regionCode</segment>
+ <acceptedValues>01 02, OR, P8, etc.&lt;br/&gt;eg. region=A1;country=fr</acceptedValues>
</row>
<row>
<type>dimension</type>
@@ -463,6 +438,13 @@
<segment>customVariableValue5</segment>
</row>
<row>
+ <type>metric</type>
+ <category>Actions</category>
+ <name>Bandwidth</name>
+ <segment>bandwidth</segment>
+ <acceptedValues>Any number in bytes, eg. 1000</acceptedValues>
+ </row>
+ <row>
<type>dimension</type>
<category>Actions</category>
<name>Action Type</name>
@@ -553,7 +535,7 @@
<row>
<type>dimension</type>
<category>Actions</category>
- <name>Page Name</name>
+ <name>Page Title</name>
<segment>pageTitle</segment>
</row>
<row>
@@ -563,4 +545,63 @@
<segment>pageUrl</segment>
<acceptedValues>All these segments must be URL encoded, for example: http%3A%2F%2Fexample.com%2Fpath%2Fpage%3Fquery</acceptedValues>
</row>
+ <row>
+ <type>dimension</type>
+ <category>Actions</category>
+ <name>Server time - hour</name>
+ <segment>actionServerHour</segment>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Actions</category>
+ <name>Server time - minute</name>
+ <segment>actionServerMinute</segment>
+ <acceptedValues>0, 1, 2, 3, ..., 56, 57, 58, 59</acceptedValues>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Events</category>
+ <name>Event Action</name>
+ <segment>eventAction</segment>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Events</category>
+ <name>Event Category</name>
+ <segment>eventCategory</segment>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Events</category>
+ <name>Event Name</name>
+ <segment>eventName</segment>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Referrers</category>
+ <name>Keyword</name>
+ <segment>referrerKeyword</segment>
+ <acceptedValues>Encoded%20Keyword, keyword</acceptedValues>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Referrers</category>
+ <name>Referrer Name</name>
+ <segment>referrerName</segment>
+ <acceptedValues>twitter.com, www.facebook.com, Bing, Google, Yahoo, CampaignName</acceptedValues>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Referrers</category>
+ <name>Referrer Type</name>
+ <segment>referrerType</segment>
+ <acceptedValues>direct, search, website, campaign</acceptedValues>
+ </row>
+ <row>
+ <type>dimension</type>
+ <category>Referrers</category>
+ <name>Referrer URL</name>
+ <segment>referrerUrl</segment>
+ <acceptedValues>http%3A%2F%2Fwww.example.org%2Freferer-page.htm</acceptedValues>
+ </row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
index 6c39c185b3..f4fea49b13 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
@@ -8,7 +8,7 @@
<name>Visits per server time</name>
<module>VisitTime</module>
<action>getVisitInformationPerServerTime</action>
- <dimension>Server time</dimension>
+ <dimension>Server time - hour (End of visit)</dimension>
<documentation>This graph shows what time it was in the &lt;strong&gt; server's time zone &lt;/strong&gt; during the visits.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
@@ -43,7 +43,7 @@
<uniqueId>VisitTime_getVisitInformationPerServerTime</uniqueId>
</metadata>
<columns>
- <label>Server time</label>
+ <label>Server time - hour (End of visit)</label>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
<nb_actions>Actions</nb_actions>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html
index 03c3ee692b..a6c31c80a0 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html
@@ -1018,7 +1018,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Operating System versions&nbsp;&nbsp;
+ &nbsp;Operating system version&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -2733,7 +2733,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Local time&nbsp;&nbsp;
+ &nbsp;Local time - hour (Start of visit)&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -3330,7 +3330,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Server time&nbsp;&nbsp;
+ &nbsp;Server time - hour (End of visit)&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -4591,7 +4591,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Page Name&nbsp;&nbsp;
+ &nbsp;Page Title&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Pageviews&nbsp;&nbsp;
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
index 6177dda553..0a0b0ba34f 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
@@ -962,7 +962,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Operating System versions&nbsp;&nbsp;
+ &nbsp;Operating system version&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -2551,7 +2551,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Local time&nbsp;&nbsp;
+ &nbsp;Local time - hour (Start of visit)&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -3141,7 +3141,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Server time&nbsp;&nbsp;
+ &nbsp;Server time - hour (End of visit)&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Visits&nbsp;&nbsp;
@@ -4339,7 +4339,7 @@
<table style="border-collapse:collapse; border:1px solid rgb(231,231,231); padding:5px;">
<thead style="background-color: rgb(242,242,242);">
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif;">
- &nbsp;Page Name&nbsp;&nbsp;
+ &nbsp;Page Title&nbsp;&nbsp;
</th>
<th style="border-bottom:1px solid rgb(231,231,231);font-size: 15px;text-align: left;font-weight:normal;padding:13px 0 13px 10px;color:#0d0d0d;font-family:-apple-system, BlinkMacSystemFont, &#039;Segoe UI&#039;, Roboto, Oxygen-Sans, Cantarell, &#039;Helvetica Neue&#039;, sans-serif; text-align:right;">
&nbsp;Pageviews&nbsp;&nbsp;
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf
index a7165b7710..fa8a66e86f 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf
Binary files differ
diff --git a/tests/PHPUnit/Unit/DataAccess/LogQueryBuilder/JoinGeneratorTest.php b/tests/PHPUnit/Unit/DataAccess/LogQueryBuilder/JoinGeneratorTest.php
index 8e1ead3aec..0f75716c9c 100644
--- a/tests/PHPUnit/Unit/DataAccess/LogQueryBuilder/JoinGeneratorTest.php
+++ b/tests/PHPUnit/Unit/DataAccess/LogQueryBuilder/JoinGeneratorTest.php
@@ -255,6 +255,7 @@ class JoinGeneratorTest extends \PHPUnit_Framework_TestCase
usort($tables, array($generator, 'sortTablesForJoin'));
$expected = array(
+ 'log_link_visit_action',
array (
'table' => 'log_link_visit_action',
'tableAlias' => 'log_link_visit_action_foo',
@@ -265,7 +266,6 @@ class JoinGeneratorTest extends \PHPUnit_Framework_TestCase
'tableAlias' => 'log_action_foo',
'joinOn' => 'log_link_visit_action_foo.idaction_url = log_action_foo.idaction',
),
- 'log_link_visit_action',
'log_action',
);
@@ -293,6 +293,42 @@ class JoinGeneratorTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($expected, $tables);
}
+ public function test_sortTablesForJoin_shouldSortTablesWithCustomJoinRequiringEachOther2()
+ {
+ $tables = array(
+ array(
+ 'table' => 'log_action',
+ 'tableAlias' => 'log_action_visit_entry_idaction_name',
+ 'joinOn' => "log_visit.visit_entry_idaction_name = log_action_visit_entry_idaction_name.idaction"
+ ),
+ 'log_link_visit_action',
+ array(
+ 'table' => 'log_action',
+ 'tableAlias' => 'log_action_idaction_event_action',
+ 'joinOn' => "log_link_visit_action.idaction_event_action = log_action_idaction_event_action.idaction"
+ )
+ );
+
+ $generator = $this->makeGenerator($tables);
+ usort($tables, array($generator, 'sortTablesForJoin'));
+
+ $expected = array(
+ array(
+ 'table' => 'log_action',
+ 'tableAlias' => 'log_action_visit_entry_idaction_name',
+ 'joinOn' => "log_visit.visit_entry_idaction_name = log_action_visit_entry_idaction_name.idaction"
+ ),
+ 'log_link_visit_action',
+ array(
+ 'table' => 'log_action',
+ 'tableAlias' => 'log_action_idaction_event_action',
+ 'joinOn' => "log_link_visit_action.idaction_event_action = log_action_idaction_event_action.idaction"
+ )
+ );
+
+ $this->assertEquals($expected, $tables);
+ }
+
private function generate($tables)
{
$generator = $this->makeGenerator($tables);
diff --git a/tests/PHPUnit/Unit/DataTable/Filter/AddSegmentFilterBySegmentValueTest.php b/tests/PHPUnit/Unit/DataTable/Filter/AddSegmentFilterBySegmentValueTest.php
index 050009d6df..8291db620a 100644
--- a/tests/PHPUnit/Unit/DataTable/Filter/AddSegmentFilterBySegmentValueTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Filter/AddSegmentFilterBySegmentValueTest.php
@@ -80,14 +80,6 @@ class AddSegmentBySegmentValueTest extends \PHPUnit_Framework_TestCase
$this->assertSegment('city==mytest', $row);
}
- public function test_filter_shouldUseTheFirstSegment_IfAReportHasMultiple()
- {
- $report = new GetCountry();
- $this->assertCount(2, $report->getDimension()->getSegments());
-
- $this->assertSegmentForSegmentValueAndReport($report, $segmentValue = 'existing', 'countryCode==existing');
- }
-
public function test_filter_shouldNotGenerateASegment_IfReportHasNoDimension()
{
$report = new Get(); // VisitsSummary.get has no dimension
diff --git a/tests/PHPUnit/Unit/DeprecatedMethodsTest.php b/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
index bea7551e1e..a0cd9905f0 100644
--- a/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
+++ b/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
@@ -81,6 +81,9 @@ class DeprecatedMethodsTest extends \PHPUnit_Framework_TestCase
$this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updates', 'update');
$this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updates', 'getMigrationQueries');
$this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updater', 'executeMigrationQueries');
+
+ // THIS IS A REMINDER FOR PIWIK 4: We need to rename getColumnType() to getDbColumnType() and $columnType to $dbColumnType
+ $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Columns\Dimension', 'getType');
}