1--TEST-- 2Test get_browser() function variation : Return data as object 3--INI-- 4browscap={PWD}/browscap.ini 5--SKIPIF-- 6<?php 7 /** 8 * Basic test, it would be pretty much coincidence if there's 9 * a browscap.ini on another place that isn't valid. 10 */ 11 if(! is_readable( ini_get( 'browscap' ) ) ) { 12 die( 'skip: browscap.ini file ' . ini_get('browscap') . " not readable" ); 13 } 14?> 15--FILE-- 16<?php 17 18$agent = "Opera/7.11 (Windows NT 5.1; U) [en]"; 19var_dump(get_browser($agent)); 20 21?> 22--EXPECT-- 23object(stdClass)#1 (35) { 24 ["browser_name_regex"]=> 25 string(41) "~^opera/7\.1.* \(windows nt 5\.1; .\).*$~" 26 ["browser_name_pattern"]=> 27 string(31) "Opera/7.1* (Windows NT 5.1; ?)*" 28 ["parent"]=> 29 string(9) "Opera 7.1" 30 ["platform"]=> 31 string(5) "WinXP" 32 ["win32"]=> 33 string(1) "1" 34 ["browser"]=> 35 string(5) "Opera" 36 ["version"]=> 37 string(3) "7.1" 38 ["majorver"]=> 39 string(1) "7" 40 ["minorver"]=> 41 string(1) "1" 42 ["frames"]=> 43 string(1) "1" 44 ["iframes"]=> 45 string(1) "1" 46 ["tables"]=> 47 string(1) "1" 48 ["cookies"]=> 49 string(1) "1" 50 ["backgroundsounds"]=> 51 string(1) "1" 52 ["javaapplets"]=> 53 string(1) "1" 54 ["javascript"]=> 55 string(1) "1" 56 ["css"]=> 57 string(1) "2" 58 ["cssversion"]=> 59 string(1) "2" 60 ["supportscss"]=> 61 string(1) "1" 62 ["alpha"]=> 63 string(0) "" 64 ["beta"]=> 65 string(0) "" 66 ["win16"]=> 67 string(0) "" 68 ["win64"]=> 69 string(0) "" 70 ["authenticodeupdate"]=> 71 string(0) "" 72 ["cdf"]=> 73 string(0) "" 74 ["vbscript"]=> 75 string(0) "" 76 ["activexcontrols"]=> 77 string(0) "" 78 ["stripper"]=> 79 string(0) "" 80 ["isbanned"]=> 81 string(0) "" 82 ["wap"]=> 83 string(0) "" 84 ["ismobiledevice"]=> 85 string(0) "" 86 ["issyndicationreader"]=> 87 string(0) "" 88 ["crawler"]=> 89 string(0) "" 90 ["aol"]=> 91 string(0) "" 92 ["aolversion"]=> 93 string(1) "0" 94} 95