Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions tests/System/DeviceDetectorCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Piwik\Plugins\DeviceDetectorCache\tests\Fixtures\SimpleFixtureTrackFewVisits;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
use Piwik\Version;

/**
* @group DeviceDetectorCache
Expand Down Expand Up @@ -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,
Expand All @@ -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,
],
];

Expand Down
22 changes: 13 additions & 9 deletions tests/System/expected/test___Live.getLastVisitsDetails_day.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
<items>1</items>





<referrerType>direct</referrerType>
<referrerName />
<referrerKeyword />
<itemDetails>
<row>
<itemSKU>SKU_ID2</itemSKU>
Expand Down Expand Up @@ -104,16 +104,18 @@
<searches>1</searches>
<actions>2</actions>
<interactions>2</interactions>

<referrerType>direct</referrerType>
<referrerTypeName>Direct Entry</referrerTypeName>


<referrerName />
<referrerKeyword />
<referrerKeywordPosition />
<referrerUrl />
<referrerSearchEngineUrl />
<referrerSearchEngineIcon />
<referrerSocialNetworkUrl />
<referrerSocialNetworkIcon />
<referrerAIAssistantUrl />
<referrerAIAssistantIcon />
<languageCode>fr</languageCode>
<language>French</language>
<deviceType>Smartphone</deviceType>
Expand Down Expand Up @@ -231,16 +233,18 @@
<searches>0</searches>
<actions>1</actions>
<interactions>1</interactions>

<referrerType>direct</referrerType>
<referrerTypeName>Direct Entry</referrerTypeName>


<referrerName />
<referrerKeyword />
<referrerKeywordPosition />
<referrerUrl />
<referrerSearchEngineUrl />
<referrerSearchEngineIcon />
<referrerSocialNetworkUrl />
<referrerSocialNetworkIcon />
<referrerAIAssistantUrl />
<referrerAIAssistantIcon />
<languageCode>fr</languageCode>
<language>French</language>
<deviceType>Desktop</deviceType>
Expand Down