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:
authorStefan Giehl <stefan@matomo.org>2020-06-09 11:58:32 +0300
committerGitHub <noreply@github.com>2020-06-09 11:58:32 +0300
commit8e25f1c68ab44fb0795b34f3459eabf362976f61 (patch)
treedb4ad5c8474c73fbd1420d734be5cafbe15c5a9b /tests/PHPUnit/Fixtures
parentbc626e6a3676f075f0b71d3534107da4d504ec44 (diff)
Track ecommerce views as new dimensions instead of custom variables (#15999)
* Adds new columns to log_link_visit_action table to track ecommerce view data * update piwik.js to track ecommerce view s the new way * Adjust archiving * update tests * [TEMP] use php-tracker branch for composer * Archive custom variables the old way, only if Matomo was installed before 4.0 * add fallback to custom variables to keep bc when replaying old logs * update some expected test files * fix jslint errors * update javascript test * update dimension names * updates some expected test files * add product view data to visitor details and add suggested segment values * updates some expected test files * rebuilt piwik.js * adjust checked version * update expected ui files * updates some expected test files * submodule updates * apply some review feedback * Show product views in action tooltips * updates expected UI files Co-authored-by: sgiehl <sgiehl@users.noreply.github.com>
Diffstat (limited to 'tests/PHPUnit/Fixtures')
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithGeoIPAndEcommerce.php5
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php6
2 files changed, 6 insertions, 5 deletions
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIPAndEcommerce.php b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIPAndEcommerce.php
index cb9e24c543..064179e7af 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIPAndEcommerce.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIPAndEcommerce.php
@@ -20,6 +20,11 @@ class ManyVisitsWithGeoIPAndEcommerce extends ManyVisitsWithGeoIP
*/
protected function trackVisit(\MatomoTracker $t, $fixtureCounter, $visitorCounter, $doBulk, array $params)
{
+ // Add some ecommerce views
+ if (($visitorCounter % 3) == 1) {
+ $t->setEcommerceView('Custom SKU', 'MyName', ['Category1', 'Category2', 'Category3', 'Category' . $visitorCounter], 17.4);
+ }
+
parent::trackVisit($t, $fixtureCounter, $visitorCounter, $doBulk, $params);
// Add a few ecommerce orders
diff --git a/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php b/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php
index 8c5f945d0e..c5fe09b667 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php
@@ -66,10 +66,6 @@ class TwoSitesEcommerceOrderWithItems extends Fixture
$t->setEcommerceView('SKU2', 'PRODUCT name', $category, $price);
$t->setCustomVariable(5, 'VisitorType', 'NewLoggedOut', 'visit');
$t->setCustomVariable(4, 'ValueIsZero', '0', 'visit');
- self::assertEquals(array('_pks', 'SKU2'), $t->getCustomVariable(3, 'page'));
- self::assertEquals(array('_pkn', 'PRODUCT name'), $t->getCustomVariable(4, 'page'));
- self::assertEquals(array('_pkc', $category), $t->getCustomVariable(5, 'page'));
- self::assertEquals(array('_pkp', $price), $t->getCustomVariable(2, 'page'));
self::assertEquals(array('VisitorType', 'NewLoggedOut'), $t->getCustomVariable(5, 'visit'));
// this is also a goal conversion (visitConvertedGoalId==1)
@@ -85,7 +81,7 @@ class TwoSitesEcommerceOrderWithItems extends Fixture
self::checkResponse($t->doTrackPageView('Another Product page with no category'));
$t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.2)->getDatetime());
- $t->setEcommerceView($sku = 'SKU VERY nice indeed', $name = 'PRODUCT name', $categories = array('Multiple Category 1', '', 0, 'Multiple Category 2', 'Electronics & Cameras', 'Multiple Category 4', 'Multiple Category 5', 'SHOULD NOT BE REPORTEDSSSSSSSSSSSSSSssssssssssssssssssssssssssstttttttttttttttttttttttuuuu!'));
+ $t->setEcommerceView($sku = 'SKU VERY nice indeed', $name = 'PRODUCT name', $categories = ['Multiple Category 1', '', 0, 'Multiple Category 2', 'Electronics & Cameras', 'Multiple Category 4', 'Multiple Category 5', 'SHOULD NOT BE REPORTEDSSSSSSSSSSSSSSssssssssssssssssssssssssssstttttttttttttttttttttttuuuu!']);
self::checkResponse($t->doTrackPageView('Another Product page with multiple categories'));
// VISIT NO 2