File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414use Piwik \Filesystem ;
1515use Piwik \Plugins \DeviceDetectorCache \CachedEntry ;
1616use 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 ());
You can’t perform that action at this time.
0 commit comments