本文整理汇总了PHP中PMA_Config::checkClient方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Config::checkClient方法的具体用法?PHP PMA_Config::checkClient怎么用?PHP PMA_Config::checkClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Config
的用法示例。
在下文中一共展示了PMA_Config::checkClient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCheckClient
/**
* Tests client parsing code.
*
* @param string $agent User agent string
* @param string $os Expected parsed OS (or null if none)
* @param string $browser Expected parsed browser (or null if none)
* @param string $version Expected browser version (or null if none)
*
* @dataProvider userAgentProvider
*/
public function testCheckClient($agent, $os, $browser = null, $version = null)
{
$_SERVER['HTTP_USER_AGENT'] = $agent;
$this->object->checkClient();
$this->assertEquals($os, $this->object->get('PMA_USR_OS'));
if ($os != null) {
$this->assertEquals($browser, $this->object->get('PMA_USR_BROWSER_AGENT'));
}
if ($version != null) {
$this->assertEquals($version, $this->object->get('PMA_USR_BROWSER_VER'));
}
}
示例2: testCheckClient
public function testCheckClient()
{
$_SERVER['HTTP_USER_AGENT'] = 'Opera/9.80 (X11; Linux x86_64; U; pl) Presto/2.7.62 Version/11.00';
$this->object->checkClient();
$this->assertEquals("Linux", $this->object->get('PMA_USR_OS'), "User OS expected to be Linux");
$this->assertEquals("OPERA", $this->object->get('PMA_USR_BROWSER_AGENT'), "Browser expected to be Opera");
$this->assertEquals("9.80", $this->object->get('PMA_USR_BROWSER_VER'), "Browser ver expected to be 9.80");
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/528.16 OmniWeb/622.8.0.112941';
$this->object->checkClient();
$this->assertEquals("Mac", $this->object->get('PMA_USR_OS'), "User OS expected to be Mac");
$this->assertEquals("OMNIWEB", $this->object->get('PMA_USR_BROWSER_AGENT'), "Browser expected to be OmniWeb");
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)';
$this->object->checkClient();
$this->assertEquals("Win", $this->object->get('PMA_USR_OS'), "User OS expected to be Windows");
$this->assertEquals("IE", $this->object->get('PMA_USR_BROWSER_AGENT'), "Browser expected to be IE");
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Unknown; U; Unix BSD/SYSV system; C -) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.10.2';
$this->object->checkClient();
$this->assertEquals("Unix", $this->object->get('PMA_USR_OS'), "User OS expected to be Unix");
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/4.0 (compatible; OS/2 Webexplorer)';
$this->object->checkClient();
$this->assertEquals("OS/2", $this->object->get('PMA_USR_OS'), "User OS expected to be OS/2");
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows; U; Win95; en-US; rv:1.9b) Gecko/20031208';
$this->object->checkClient();
$this->assertEquals("GECKO", $this->object->get('PMA_USR_BROWSER_AGENT'), "Browser expected to be Gecko");
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (compatible; Konqueror/4.5; NetBSD 5.0.2; X11; amd64; en_US) KHTML/4.5.4 (like Gecko)';
$this->object->checkClient();
$this->assertEquals("KONQUEROR", $this->object->get('PMA_USR_BROWSER_AGENT'), "Browser expected to be Konqueror");
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0';
$this->object->checkClient();
$this->assertEquals("MOZILLA", $this->object->get('PMA_USR_BROWSER_AGENT'), "Browser expected to be Mozilla");
$this->assertEquals("Linux", $this->object->get('PMA_USR_OS'), "User OS expected to be Linux");
}