diff --git a/tests/System/DeviceDetectorCacheTest.php b/tests/System/DeviceDetectorCacheTest.php index d28e0b42..0866d900 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.5.0-b1', '<')) { + // In Matomo 5.5 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, ], ]; diff --git a/tests/System/expected/test___Live.getLastVisitsDetails_day.xml b/tests/System/expected/test___Live.getLastVisitsDetails_day.xml index 2b1de897..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,16 +104,18 @@ 1 2 2 - + direct Direct Entry - - + + + + fr French Smartphone @@ -231,16 +233,18 @@ 0 1 1 - + direct Direct Entry - - + + + + fr French Desktop