Skip to content

Commit 082cf4f

Browse files
committed
fix tests for older versions
[ignore_release]
1 parent 3635535 commit 082cf4f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/Unit/DeviceDetectorCacheFactoryTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Piwik\Filesystem;
1515
use Piwik\Plugins\DeviceDetectorCache\CachedEntry;
1616
use Piwik\Plugins\DeviceDetectorCache\Factory;
17+
use Piwik\Version;
1718

1819
/**
1920
* @group DeviceDetectorCache
@@ -125,6 +126,20 @@ public function testGetInstanceFromCacheWithClientHints()
125126
'engine_version' => '97.0.4692.71',
126127
'family' => 'Internet Explorer',
127128
];
129+
130+
if (version_compare('4.11.0', Version::VERSION, '>=')) {
131+
// On older versions client hints were not supported and thus the result differed.
132+
$expected['os'] = [
133+
'name' => 'Windows',
134+
'version' => '10',
135+
];
136+
$expected['client'] = [
137+
'type' => 'browser',
138+
'name' => 'Microsoft Edge',
139+
'version' => '97.0.1072.66'
140+
];
141+
}
142+
128143
$this->assertInstanceOf(CachedEntry::class, $deviceDetection);
129144
$this->assertEquals(null, $deviceDetection->getBot());
130145
$this->assertEquals($expected['brand'], $deviceDetection->getBrandName());

0 commit comments

Comments
 (0)