From d096fc8bdca8a658a71fabe61779ff4689902dd0 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Thu, 7 Aug 2025 13:04:24 +0200 Subject: [PATCH 1/3] updates expected test files --- tests/System/expected/test___API.get_year.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/System/expected/test___API.get_year.xml b/tests/System/expected/test___API.get_year.xml index 8eab3ab..6fec697 100644 --- a/tests/System/expected/test___API.get_year.xml +++ b/tests/System/expected/test___API.get_year.xml @@ -17,11 +17,13 @@ 0 0 0 + 0 1 0 0 0 0 + 0 0 0 0 @@ -69,6 +71,7 @@ 0 100% 0% + 0% 0% 0% 0% From 3db06055261c330280a3236455cf956578570379 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Mon, 18 Aug 2025 23:13:25 +0200 Subject: [PATCH 2/3] fix tests for older releases --- tests/System/TasksTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/System/TasksTest.php b/tests/System/TasksTest.php index 1e15bac..2717c4c 100644 --- a/tests/System/TasksTest.php +++ b/tests/System/TasksTest.php @@ -13,6 +13,7 @@ use Piwik\Piwik; use Piwik\Plugins\AnonymousPiwikUsageMeasurement\tests\Fixtures\SendSystemReportTaskFixture; use Piwik\Tests\Framework\TestCase\SystemTestCase; +use Piwik\Version; /** * @group AnonymousPiwikUsageMeasurement @@ -79,6 +80,12 @@ public function getApiForTesting() 'CustomVariables', ]; + $xmlFieldsToRemove = []; + + if (version_compare(Version::VERSION, '5.4.0-b5', '<')) { + $xmlFieldsToRemove = ['Referrers_visitorsFromAIAssistants', 'Referrers_distinctAIAssistants', 'Referrers_visitorsFromAIAssistants_percent']; + } + $apiToTest = []; foreach ($apis as $api) { $apiToTest[] = [ @@ -94,6 +101,7 @@ public function getApiForTesting() // when calling CustomVariables.getUsagesOfSlots, new archives are created until 'today', // which increments idsubdatatable, but we need to have deterministic idsubdatatable 'apiNotToCall' => ['CustomVariables.getUsagesOfSlots'], + 'xmlFieldsToRemove' => $xmlFieldsToRemove, ] ]; } From d555283d0664c61922ddffc2a95c04579860ed90 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Mon, 25 Aug 2025 15:14:39 +0200 Subject: [PATCH 3/3] adjust version --- tests/System/TasksTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/System/TasksTest.php b/tests/System/TasksTest.php index 2717c4c..4adcf46 100644 --- a/tests/System/TasksTest.php +++ b/tests/System/TasksTest.php @@ -82,7 +82,7 @@ public function getApiForTesting() $xmlFieldsToRemove = []; - if (version_compare(Version::VERSION, '5.4.0-b5', '<')) { + if (version_compare(Version::VERSION, '5.5.0-b1', '<')) { $xmlFieldsToRemove = ['Referrers_visitorsFromAIAssistants', 'Referrers_distinctAIAssistants', 'Referrers_visitorsFromAIAssistants_percent']; }