From 346756669a8f6705b70be30cf7e57cfbb29d06df Mon Sep 17 00:00:00 2001 From: sgiehl Date: Wed, 6 Aug 2025 23:54:20 +0200 Subject: [PATCH 1/3] update expected test files --- .../System/expected/test___Live.getLastVisitsDetails_day.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/System/expected/test___Live.getLastVisitsDetails_day.xml b/tests/System/expected/test___Live.getLastVisitsDetails_day.xml index 2b1de897..5b1c84b7 100644 --- a/tests/System/expected/test___Live.getLastVisitsDetails_day.xml +++ b/tests/System/expected/test___Live.getLastVisitsDetails_day.xml @@ -114,6 +114,8 @@ + + fr French Smartphone @@ -241,6 +243,8 @@ + + fr French Desktop From 92709cc7c78e04699fb0cf483e3fba78595869d7 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Mon, 18 Aug 2025 23:34:47 +0200 Subject: [PATCH 2/3] fix tests for older releases --- tests/System/DeviceDetectorCacheTest.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/System/DeviceDetectorCacheTest.php b/tests/System/DeviceDetectorCacheTest.php index d28e0b42..7a8b81d9 100644 --- a/tests/System/DeviceDetectorCacheTest.php +++ b/tests/System/DeviceDetectorCacheTest.php @@ -11,6 +11,7 @@ use Piwik\Plugins\DeviceDetectorCache\tests\Fixtures\SimpleFixtureTrackFewVisits; use Piwik\Tests\Framework\TestCase\SystemTestCase; +use Piwik\Version; /** * @group DeviceDetectorCache @@ -38,6 +39,18 @@ public function getApiForTesting() 'Live.getLastVisitsDetails', ]; + $columnsToHide = []; + + if (version_compare(Version::VERSION, '5.2.0-alpha', '<')) { + // In Matomo 5.2 referrer columns had been added to ecommerce actions. For tests with older Matomo releases we therefor ignore those columns + $columnsToHide = array_merge($columnsToHide, ['referrerType', 'referrerName', 'referrerKeyword']); + } + + if (version_compare(Version::VERSION, '5.4.0-b5', '<')) { + // In Matomo 5.4 ai referrer had been added + $columnsToHide = array_merge($columnsToHide, ['referrerAIAssistantUrl', 'referrerAIAssistantIcon']); + } + $apiToTest = []; $apiToTest[] = [ $api, @@ -46,8 +59,7 @@ public function getApiForTesting() 'date' => self::$fixture->dateTime, 'periods' => ['day'], 'testSuffix' => '', - // fields were added in Matomo 5.2-alpha, so ignore them as they are not relevant for this plugin anyways - 'xmlFieldsToRemove' => ['referrerType', 'referrerName', 'referrerKeyword'] + 'xmlFieldsToRemove' => $columnsToHide, ], ]; From 96bc584a892c725c87f817871786d68123507e4a Mon Sep 17 00:00:00 2001 From: sgiehl Date: Mon, 25 Aug 2025 15:17:50 +0200 Subject: [PATCH 3/3] adjust version --- tests/System/DeviceDetectorCacheTest.php | 4 ++-- .../test___Live.getLastVisitsDetails_day.xml | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/System/DeviceDetectorCacheTest.php b/tests/System/DeviceDetectorCacheTest.php index 7a8b81d9..0866d900 100644 --- a/tests/System/DeviceDetectorCacheTest.php +++ b/tests/System/DeviceDetectorCacheTest.php @@ -46,8 +46,8 @@ public function getApiForTesting() $columnsToHide = array_merge($columnsToHide, ['referrerType', 'referrerName', 'referrerKeyword']); } - if (version_compare(Version::VERSION, '5.4.0-b5', '<')) { - // In Matomo 5.4 ai referrer had been added + if (version_compare(Version::VERSION, '5.5.0-b1', '<')) { + // In Matomo 5.5 ai referrer had been added $columnsToHide = array_merge($columnsToHide, ['referrerAIAssistantUrl', 'referrerAIAssistantIcon']); } diff --git a/tests/System/expected/test___Live.getLastVisitsDetails_day.xml b/tests/System/expected/test___Live.getLastVisitsDetails_day.xml index 5b1c84b7..87aa078b 100644 --- a/tests/System/expected/test___Live.getLastVisitsDetails_day.xml +++ b/tests/System/expected/test___Live.getLastVisitsDetails_day.xml @@ -51,9 +51,9 @@ 1 - - - + direct + + SKU_ID2 @@ -104,10 +104,10 @@ 1 2 2 - + direct Direct Entry - - + + @@ -233,10 +233,10 @@ 0 1 1 - + direct Direct Entry - - + +