From 411ef081f833f4bc1f4185b882559c4547a95660 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Wed, 6 Aug 2025 19:32:49 +0200 Subject: [PATCH 1/5] update expected test files --- ...ITest__Live.getLastVisitsDetails_range.xml | 70 +++++++++++++++++++ ...temTest__Live.getLastVisitsDetails_day.xml | 2 + 2 files changed, 72 insertions(+) diff --git a/tests/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml b/tests/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml index 05015fd..6c96324 100644 --- a/tests/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml +++ b/tests/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml @@ -86,6 +86,8 @@ plugins/Morpheus/icons/dist/searchEngines/google.com.png + + fr French Desktop @@ -316,6 +318,8 @@ + + fr French Desktop @@ -473,6 +477,8 @@ + + fr French Desktop @@ -692,6 +698,8 @@ + + fr French Desktop @@ -858,6 +866,8 @@ + + fr French Desktop @@ -1128,6 +1138,8 @@ + + fr French Desktop @@ -1285,6 +1297,8 @@ + + fr French Desktop @@ -1504,6 +1518,8 @@ + + fr French Desktop @@ -1661,6 +1677,8 @@ + + fr French Desktop @@ -1899,6 +1917,8 @@ + + fr French Desktop @@ -2065,6 +2085,8 @@ + + fr French Desktop @@ -2316,6 +2338,8 @@ + + Unknown Tablet @@ -2559,6 +2583,8 @@ + + fr French Desktop @@ -2716,6 +2742,8 @@ + + Unknown Tablet @@ -2873,6 +2901,8 @@ + + fr French Desktop @@ -3111,6 +3141,8 @@ + + Unknown Desktop @@ -3341,6 +3373,8 @@ + + fr French Desktop @@ -3498,6 +3532,8 @@ + + Unknown Desktop @@ -3655,6 +3691,8 @@ + + fr French Desktop @@ -3874,6 +3912,8 @@ + + fr French Desktop @@ -4093,6 +4133,8 @@ + + Unknown Desktop @@ -4304,6 +4346,8 @@ + + fr French Smartphone @@ -4523,6 +4567,8 @@ + + fr French Desktop @@ -4689,6 +4735,8 @@ + + fr French Desktop @@ -4855,6 +4903,8 @@ + + Unknown Desktop @@ -5021,6 +5071,8 @@ + + fr French Smartphone @@ -5187,6 +5239,8 @@ + + fr French Desktop @@ -5457,6 +5511,8 @@ + + fr French Phablet @@ -5727,6 +5783,8 @@ + + Unknown Desktop @@ -5989,6 +6047,8 @@ + + fr French Smartphone @@ -6259,6 +6319,8 @@ + + fr French Desktop @@ -6416,6 +6478,8 @@ + + fr French Phablet @@ -6573,6 +6637,8 @@ + + fr French Desktop @@ -6730,6 +6796,8 @@ + + fr French Smartphone @@ -6887,6 +6955,8 @@ + + fr French Desktop diff --git a/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml b/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml index d98c6c6..402e922 100644 --- a/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml +++ b/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml @@ -120,6 +120,8 @@ plugins/Morpheus/icons/dist/searchEngines/google.com.png + + fr French Desktop From 1b15aa83dda6b14ef62f697d772a37604514e3d5 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Thu, 7 Aug 2025 13:28:28 +0200 Subject: [PATCH 2/5] adjust expected test results --- ...sitsWithCustomVariablesSegmentMatchVisitorTypeTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php b/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php index c5430cb..ce63d67 100644 --- a/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php +++ b/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php @@ -97,9 +97,9 @@ public function testCheck() // 1) CHECK 'day' archive stored in January // We expect 2 segments // * (1 custom variable name + 2 ref metrics - // + 1 subtable chunk for the custom var values + 6 Referrers blob (2 of them subtables) + // + 1 subtable chunk for the custom var values + 7 Referrers blob (2 of them subtables) // ) - 'archive_blob_2010_01' => 20, + 'archive_blob_2010_01' => 22, // This contains all 'last N' weeks & days, // (8 metrics // + 6 referrer metrics @@ -109,8 +109,8 @@ public function testCheck() 'archive_numeric_2010_01' => 34, // 2) CHECK 'week' archive stored in December (week starts the month before) - // We expect 2 segments * (2 custom variable name + 2 ref metrics + 1 subtable chunk for the values of the name + 6 referrers blob (2 of them subtables)) - 'archive_blob_2009_12' => 20, + // We expect 2 segments * (2 custom variable name + 2 ref metrics + 1 subtable chunk for the values of the name + 7 referrers blob (2 of them subtables)) + 'archive_blob_2009_12' => 22, // 8 metrics, // 6 Referrer metrics, // 3 done flag (referrers, CustomVar, VisitsSummary), all for period = 2, day w/ visits is in new year, other days have no data From d1eda7087774369ee3a712c29f92cd3ebe75805d Mon Sep 17 00:00:00 2001 From: sgiehl Date: Thu, 7 Aug 2025 13:44:53 +0200 Subject: [PATCH 3/5] update expected test results --- ...ithCustomVariablesSegmentMatchVisitorTypeTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php b/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php index ce63d67..d30f664 100644 --- a/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php +++ b/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php @@ -99,23 +99,23 @@ public function testCheck() // * (1 custom variable name + 2 ref metrics // + 1 subtable chunk for the custom var values + 7 Referrers blob (2 of them subtables) // ) - 'archive_blob_2010_01' => 22, + 'archive_blob_2010_01' => 22, // This contains all 'last N' weeks & days, // (8 metrics - // + 6 referrer metrics + // + 7 referrer metrics // + 3 done flag ) // * 2 segments // for each "Last N" date that has data (just one date) - 'archive_numeric_2010_01' => 34, + 'archive_numeric_2010_01' => 36, // 2) CHECK 'week' archive stored in December (week starts the month before) // We expect 2 segments * (2 custom variable name + 2 ref metrics + 1 subtable chunk for the values of the name + 7 referrers blob (2 of them subtables)) - 'archive_blob_2009_12' => 22, + 'archive_blob_2009_12' => 22, // 8 metrics, - // 6 Referrer metrics, + // 7 Referrer metrics, // 3 done flag (referrers, CustomVar, VisitsSummary), all for period = 2, day w/ visits is in new year, other days have no data // X * 2 segments - 'archive_numeric_2009_12' => (8 + 6 + 3) * 2, + 'archive_numeric_2009_12' => (8 + 7 + 3) * 2, ); foreach ($tests as $table => $expectedRows) { From aa6cb6d1dc0e252840348404fa816f5e35a6da76 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Mon, 18 Aug 2025 23:31:35 +0200 Subject: [PATCH 4/5] fix tests for older releases --- tests/System/AutoSuggestAPITest.php | 5 +++++ tests/System/CustomVariablesSystemTest.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tests/System/AutoSuggestAPITest.php b/tests/System/AutoSuggestAPITest.php index ca6c78e..44eabdd 100644 --- a/tests/System/AutoSuggestAPITest.php +++ b/tests/System/AutoSuggestAPITest.php @@ -57,6 +57,11 @@ public function getApiForTesting() $xmlFieldsToRemove = ['latitude', 'longitude']; + if (version_compare(Version::VERSION, '5.4.0-b5', '<')) { + // In Matomo 5.4 ai referrer had been added + $xmlFieldsToRemove = array_merge($xmlFieldsToRemove, ['referrerAIAssistantUrl', 'referrerAIAssistantIcon']); + } + $apiForTesting[] = [ 'Live.getLastVisitsDetails', [ diff --git a/tests/System/CustomVariablesSystemTest.php b/tests/System/CustomVariablesSystemTest.php index 9de4106..59a4985 100644 --- a/tests/System/CustomVariablesSystemTest.php +++ b/tests/System/CustomVariablesSystemTest.php @@ -53,6 +53,11 @@ public function getApiForTesting() ]; } + if (version_compare(Version::VERSION, '5.4.0-b5', '<')) { + // In Matomo 5.4 ai referrer had been added + $xmlFieldsToRemove = array_merge($xmlFieldsToRemove, ['referrerAIAssistantUrl', 'referrerAIAssistantIcon']); + } + return [ [ $apiToCall, From 632552495180259bba4672f49a63d978f2c543be Mon Sep 17 00:00:00 2001 From: sgiehl Date: Mon, 25 Aug 2025 15:16:56 +0200 Subject: [PATCH 5/5] adjust version --- tests/System/AutoSuggestAPITest.php | 4 ++-- tests/System/CustomVariablesSystemTest.php | 4 ++-- ...woVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/System/AutoSuggestAPITest.php b/tests/System/AutoSuggestAPITest.php index 44eabdd..296f9de 100644 --- a/tests/System/AutoSuggestAPITest.php +++ b/tests/System/AutoSuggestAPITest.php @@ -57,8 +57,8 @@ public function getApiForTesting() $xmlFieldsToRemove = ['latitude', 'longitude']; - 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 $xmlFieldsToRemove = array_merge($xmlFieldsToRemove, ['referrerAIAssistantUrl', 'referrerAIAssistantIcon']); } diff --git a/tests/System/CustomVariablesSystemTest.php b/tests/System/CustomVariablesSystemTest.php index 59a4985..85cf234 100644 --- a/tests/System/CustomVariablesSystemTest.php +++ b/tests/System/CustomVariablesSystemTest.php @@ -53,8 +53,8 @@ public function getApiForTesting() ]; } - 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 $xmlFieldsToRemove = array_merge($xmlFieldsToRemove, ['referrerAIAssistantUrl', 'referrerAIAssistantIcon']); } diff --git a/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php b/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php index d30f664..3ad2e01 100644 --- a/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php +++ b/tests/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php @@ -78,7 +78,7 @@ public function getApiForTesting() */ public function testCheck() { - if (version_compare(Version::VERSION, '5.4.0-b3', '<')) { + if (version_compare(Version::VERSION, '5.5.0-b1', '<')) { self::markTestSkipped('archive numbers have changed'); }