1--TEST--
2Test get_browser() function : error functionality
3--INI--
4browscap={PWD}/browscap.ini
5--FILE--
6<?php
7$browsers = include __DIR__ . DIRECTORY_SEPARATOR . 'browsernames.inc';
8
9echo "*** Testing get_browser() : error functionality ***\n";
10
11/* Unknown browser uses defaults. */
12var_dump( get_browser( 'foobar', true ) );
13
14/* Some wrong parameters, no HTTP_USER_AGENT set */
15var_dump( get_browser( null, 'foobar' ) );
16
17?>
18--EXPECTF--
19*** Testing get_browser() : error functionality ***
20array(34) {
21  ["browser_name_regex"]=>
22  string(6) "~^.*$~"
23  ["browser_name_pattern"]=>
24  string(1) "*"
25  ["browser"]=>
26  string(15) "Default Browser"
27  ["version"]=>
28  string(1) "0"
29  ["majorver"]=>
30  string(1) "0"
31  ["minorver"]=>
32  string(1) "0"
33  ["platform"]=>
34  string(7) "unknown"
35  ["alpha"]=>
36  string(0) ""
37  ["beta"]=>
38  string(0) ""
39  ["win16"]=>
40  string(0) ""
41  ["win32"]=>
42  string(0) ""
43  ["win64"]=>
44  string(0) ""
45  ["frames"]=>
46  string(1) "1"
47  ["iframes"]=>
48  string(0) ""
49  ["tables"]=>
50  string(1) "1"
51  ["cookies"]=>
52  string(0) ""
53  ["backgroundsounds"]=>
54  string(0) ""
55  ["authenticodeupdate"]=>
56  string(1) "0"
57  ["cdf"]=>
58  string(0) ""
59  ["vbscript"]=>
60  string(0) ""
61  ["javaapplets"]=>
62  string(0) ""
63  ["javascript"]=>
64  string(0) ""
65  ["activexcontrols"]=>
66  string(0) ""
67  ["stripper"]=>
68  string(0) ""
69  ["isbanned"]=>
70  string(0) ""
71  ["wap"]=>
72  string(0) ""
73  ["ismobiledevice"]=>
74  string(0) ""
75  ["issyndicationreader"]=>
76  string(0) ""
77  ["crawler"]=>
78  string(0) ""
79  ["css"]=>
80  string(1) "0"
81  ["cssversion"]=>
82  string(1) "0"
83  ["supportscss"]=>
84  string(0) ""
85  ["aol"]=>
86  string(0) ""
87  ["aolversion"]=>
88  string(1) "0"
89}
90
91Warning: get_browser(): HTTP_USER_AGENT variable is not set, cannot determine user agent name in %s on line %d
92bool(false)
93