TYPO3 CMS  TYPO3_6-2
ClientUtilityTest.php
Go to the documentation of this file.
1 <?php
3 
23 
25  // Utility Functions
27 
33  private function analyzeUserAgentStrings($browserStrings, $expectedMembers) {
34  $actual = $expected = array();
35  foreach ($browserStrings as $browserString) {
36  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($browserString);
37  $expected[] = $expectedMembers;
38  $actual[] = array(
39  'browser' => $infoArray['browser'],
40  'version' => array_shift(explode('.', $infoArray['version']))
41  );
42  }
43  $this->assertSame($expected, $actual);
44  }
45 
47  // Tests concerning getBrowserInfo
49 
52  public function checkBrowserInfoIE6() {
53  $browserStrings = array(
54  'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
55  'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
56  'Mozilla/4.0 (compatible; MSIE 6.01; Windows NT 6.0)',
57  'Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)',
58  'Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)',
59  'Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4325)',
60  'Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1)',
61  'Mozilla/45.0 (compatible; MSIE 6.0; Windows NT 5.1)',
62  'Mozilla/4.08 (compatible; MSIE 6.0; Windows NT 5.1)',
63  'Mozilla/4.01 (compatible; MSIE 6.0; Windows NT 5.1)',
64  'Mozilla/4.0 (X11; MSIE 6.0; i686; .NET CLR 1.1.4322; .NET CLR 2.0.50727; FDM)',
65  'Mozilla/4.0 (Windows; MSIE 6.0; Windows NT 6.0)',
66  'Mozilla/4.0 (Windows; MSIE 6.0; Windows NT 5.2)',
67  'Mozilla/4.0 (Windows; MSIE 6.0; Windows NT 5.0)',
68  'Mozilla/4.0 (Windows; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)',
69  'Mozilla/4.0 (MSIE 6.0; Windows NT 5.1)',
70  'Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)',
71  'Mozilla/4.0 (compatible;MSIE 6.0;Windows 98;Q312461)',
72  'Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0) (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
73  'Mozilla/4.0 (compatible; U; MSIE 6.0; Windows NT 5.1)',
74  'Mozilla/4.0 (compatible; MSIE 6,0; Windows NT 5,1; SV1; Alexa Toolbar)'
75  );
76  $expectedMembers = array(
77  'browser' => 'msie',
78  'version' => '6'
79  );
80  $this->analyzeUserAgentStrings($browserStrings, $expectedMembers);
81  }
82 
86  public function checkBrowserInfoIE7() {
87  $browserStrings = array(
88  'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
89  'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; el-GR)',
90  'Mozilla/5.0 (MSIE 7.0; Macintosh; U; SunOS; X11; gu; SV1; InfoPath.2; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)',
91  'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; c .NET CLR 3.0.04506; .NET CLR 3.5.30707; InfoPath.1; el-GR)',
92  'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; c .NET CLR 3.0.04506; .NET CLR 3.5.30707; InfoPath.1; el-GR)',
93  'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; fr-FR)',
94  'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; en-US)',
95  'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.2; WOW64; .NET CLR 2.0.50727)',
96  'Mozilla/4.79 [en] (compatible; MSIE 7.0; Windows NT 5.0; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)',
97  'Mozilla/4.0 (Windows; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)',
98  'Mozilla/4.0 (Mozilla/4.0; MSIE 7.0; Windows NT 5.1; FDM; SV1; .NET CLR 3.0.04506.30)',
99  'Mozilla/4.0 (Mozilla/4.0; MSIE 7.0; Windows NT 5.1; FDM; SV1)',
100  'Mozilla/4.0 (compatible;MSIE 7.0;Windows NT 6.0)',
101  'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)',
102  'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;)',
103  'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; YPC 3.2.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
104  'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; YPC 3.2.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)',
105  'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; Media Center PC 5.0; .NET CLR 2.0.50727)',
106  'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 3.0.04506)',
107  'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET CLR 1.1.4322)',
108  'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C)',
109  'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)',
110  );
111  $expectedMembers = array(
112  'browser' => 'msie',
113  'version' => '7'
114  );
115  $this->analyzeUserAgentStrings($browserStrings, $expectedMembers);
116  }
117 
121  public function checkBrowserInfoIE8() {
122  $browserStrings = array(
123  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)',
124  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8)',
125  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
126  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 3.0)',
127  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; msn OptimizedIE8;ZHCN)',
128  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8)',
129  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; Zune 4.0)',
130  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3)',
131  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; yie8)',
132  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; Zune 3.0; MS-RTC LM 8)',
133  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; MS-RTC LM 8; Zune 4.0)',
134  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8)',
135  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; FDM; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; .NET CLR 1.1.4322)',
136  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E; FDM)',
137  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 4.0.20402; MS-RTC LM 8)',
138  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; InfoPath.2; MS-RTC LM 8)',
139  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; InfoPath.2)',
140  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.3; .NET CLR 4.0.20506)',
141  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
142  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; MRA 5.5 (build 02842); SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)',
143  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)'
144  );
145  $expectedMembers = array(
146  'browser' => 'msie',
147  'version' => '8'
148  );
149  $this->analyzeUserAgentStrings($browserStrings, $expectedMembers);
150  }
151 
155  public function checkBrowserInfoIE9() {
156  $browserStrings = array(
157  'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
158  );
159  $expectedMembers = array(
160  'browser' => 'msie',
161  'version' => '9'
162  );
163  $this->analyzeUserAgentStrings($browserStrings, $expectedMembers);
164  }
165 
169  public function checkBrowserInfoIE10() {
170  $browserStrings = array(
171  'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)',
172  );
173  $expectedMembers = array(
174  'browser' => 'msie',
175  'version' => '10'
176  );
177  $this->analyzeUserAgentStrings($browserStrings, $expectedMembers);
178  }
179 
183  public function checkBrowserInfoIE11() {
184  $browserStrings = array(
185  'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko',
186  'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko',
187  );
188  $expectedMembers = array(
189  'browser' => 'msie',
190  'version' => '11'
191  );
192  $this->analyzeUserAgentStrings($browserStrings, $expectedMembers);
193  }
194 
198  public function checkGeckoVersion() {
199  $userAgentString = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3';
200  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
201  $this->assertEquals('1.9.2.3', $infoArray['all']['gecko']);
202  }
203 
208  $userAgentString = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';
209  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
210  $this->assertContains('win8', $infoArray['all_systems']);
211  }
212 
213 
218  $userAgentString = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; Trident/6.0)';
219  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
220  $this->assertContains('win8', $infoArray['all_systems']);
221  }
222 
227  $userAgentString = 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)';
228  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
229  $this->assertContains('win7', $infoArray['all_systems']);
230  }
231 
236  $userAgentString = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)';
237  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
238  $this->assertContains('winVista', $infoArray['all_systems']);
239  }
240 
245  $userAgentString = 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)';
246  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
247  $this->assertContains('winXP', $infoArray['all_systems']);
248  }
249 
254  $userAgentString = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; SV1)';
255  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
256  $this->assertContains('win2k', $infoArray['all_systems']);
257  }
258 
263  $userAgentString = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.01; SV1)';
264  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
265  $this->assertContains('win2k', $infoArray['all_systems']);
266  }
267 
272  $userAgentString = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)';
273  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
274  $this->assertContains('winNT', $infoArray['all_systems']);
275  }
276 
281  $userAgentString = 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7W367a Safari/531.21.10';
282  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
283  $this->assertContains('iOS', $infoArray['all_systems']);
284  }
285 
290  $userAgentString = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7';
291  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
292  $this->assertContains('iOS', $infoArray['all_systems']);
293  }
294 
299  $userAgentString = 'Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Geckto) Version/3.0 Mobile/3A101a Safari/419.3';
300  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
301  $this->assertContains('iOS', $infoArray['all_systems']);
302  }
303 
308  $userAgentString = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-us) AppleWebKit/534.15+ (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4';
309  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
310  $this->assertContains('mac', $infoArray['all_systems']);
311  }
312 
317  $userAgentString = 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8';
318  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
319  $this->assertContains('linux', $infoArray['all_systems']);
320  }
321 
326  $userAgentString = 'Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.9) Gecko/20100525 Firefox/3.5.9';
327  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
328  $this->assertContains('unix_sun', $infoArray['all_systems']);
329  }
330 
337  static public function androidUserAgentsProvider() {
338  $agents = array(
339  'defaultBrowser' => array(
340  'agent' => 'Mozilla/5.0 (Linux; U; Android 2.3; en-US; sdk Build/GRH55) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'
341  ),
342  'operaMini' => array(
343  'agent' => 'Opera/9.80 (Android; Opera Mini/6.0.24556/24.816; U; en) Presto/2.5.25 Version/10.54'
344  )
345  );
346  return $agents;
347  }
348 
354  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
355  $this->assertContains('android', $infoArray['all_systems']);
356  }
357 
362  $userAgentString = 'Links (1.00pre20; OpenBSD 4.8 i386; 80x25)';
363  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
364  $this->assertContains('unix_bsd', $infoArray['all_systems']);
365  }
366 
371  $userAgentString = 'Links (2.2; NetBSD 5.1 amd64; 80x25)';
372  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
373  $this->assertContains('unix_bsd', $infoArray['all_systems']);
374  }
375 
380  $userAgentString = 'Mozilla/5.0 (X11; U; FreeBSD amd64; c) AppleWebKit/531.2+ (KHTML, like Gecko) Safari 531.2+ Epiphany/230.2';
381  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
382  $this->assertContains('unix_bsd', $infoArray['all_systems']);
383  }
384 
389  $userAgentString = 'Mozilla/5.0 (X11; U; CrOS i686 9.10.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.253.0 Safari 532.5';
390  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
391  $this->assertContains('chrome', $infoArray['all_systems']);
392  }
393 
398  $userAgentString = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9';
399  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
400  $this->assertSame('safari', $infoArray['browser']);
401  }
402 
407  $userAgentString = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b8) Gecko/20100101 Firefox/4.0b8';
408  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
409  $this->assertSame('firefox', $infoArray['browser']);
410  }
411 
416  $userAgentString = 'Opera/9.80 (X11; FreeBSD 8.1-RELEASE amd64; U; en) Presto/2.2.15 Version/10.10';
417  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
418  $this->assertSame('opera', $infoArray['browser']);
419  }
420 
425  $userAgentString = 'Mozilla/5.0 (Linux; U; Android WildPuzzleROM v8.0.7 froyo 2.2; de-de; HTC Wildfire Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1';
426  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
427  $this->assertSame('safari', $infoArray['browser']);
428  }
429 
434  $userAgentString = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5';
435  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
436  $this->assertSame('safari', $infoArray['browser']);
437  }
438 
443  $userAgentString = 'Mozilla/5.0 (compatible; Konqueror/4.4; FreeBSD) KHTML/4.4.5 (like Gecko)';
444  $infoArray = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo($userAgentString);
445  $this->assertSame('konqueror', $infoArray['browser']);
446  }
447 
448 }
getBrowserInfoReturnsCorrectSystemValueForUserAgentStringOfAndroid($userAgentString)
analyzeUserAgentStrings($browserStrings, $expectedMembers)