本文整理匯總了PHP中core_useragent::check_gecko_version方法的典型用法代碼示例。如果您正苦於以下問題:PHP core_useragent::check_gecko_version方法的具體用法?PHP core_useragent::check_gecko_version怎麽用?PHP core_useragent::check_gecko_version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core_useragent
的用法示例。
在下文中一共展示了core_useragent::check_gecko_version方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_useragent_gecko
/**
* @dataProvider user_agents_providers
*/
public function test_useragent_gecko($useragent, $tests)
{
// Setup the core_useragent instance.
core_useragent::instance(true, $useragent);
if (isset($tests['is_gecko']) && $tests['is_gecko']) {
$this->assertTrue(core_useragent::is_gecko(), "Browser was not identified as a gecko browser");
$this->assertTrue(core_useragent::check_gecko_version());
} else {
$this->assertFalse(core_useragent::is_gecko(), "Browser was incorrectly identified as a gecko browser");
$this->assertFalse(core_useragent::check_gecko_version());
}
$versions = array('1' => false, '2' => false, '3.6' => false, '4.0' => false, '20030516' => false, '20051116' => false, '2006010100' => false, '20100101' => false, '15.0' => false, '18.0' => false, '19.0' => false);
if (isset($tests['check_gecko_version'])) {
// The test provider has overwritten some of the above checks.
// Must use the '+' operator, because array_merge will incorrectly rewrite the array keys for integer-based indexes.
$versions = $tests['check_gecko_version'] + $versions;
}
foreach ($versions as $version => $result) {
$this->assertEquals($result, core_useragent::check_gecko_version($version), "Version incorrectly determined for Gecko version '{$version}'");
}
}
示例2: test_check_browser_version
//.........這裏部分代碼省略.........
$this->assertTrue(core_useragent::is_ie());
$this->assertTrue(core_useragent::check_ie_version());
$this->assertTrue(core_useragent::check_ie_version(0));
$this->assertTrue(core_useragent::check_ie_version('5.0'));
$this->assertTrue(core_useragent::check_ie_version('9.0'));
$this->assertTrue(core_useragent::check_ie_version('10'));
$this->assertTrue(core_useragent::check_ie_compatibility_view());
$this->assertFalse(core_useragent::check_ie_version('11'));
core_useragent::instance(true, $this->user_agents['MSIE']['11.0']['Windows 8.1']);
$this->assertTrue(core_useragent::is_ie());
$this->assertTrue(core_useragent::check_ie_version());
$this->assertTrue(core_useragent::check_ie_version(0));
$this->assertTrue(core_useragent::check_ie_version('5.0'));
$this->assertTrue(core_useragent::check_ie_version('9.0'));
$this->assertTrue(core_useragent::check_ie_version('10'));
$this->assertTrue(core_useragent::check_ie_version('11'));
$this->assertFalse(core_useragent::check_ie_compatibility_view());
$this->assertFalse(core_useragent::check_ie_version('12'));
core_useragent::instance(true, $this->user_agents['MSIE']['11.0i']['Windows 8.1']);
$this->assertTrue(core_useragent::is_ie());
$this->assertTrue(core_useragent::check_ie_version());
$this->assertTrue(core_useragent::check_ie_version(0));
$this->assertTrue(core_useragent::check_ie_version('5.0'));
$this->assertTrue(core_useragent::check_ie_version('9.0'));
$this->assertTrue(core_useragent::check_ie_version('10'));
$this->assertTrue(core_useragent::check_ie_version('11'));
$this->assertTrue(core_useragent::check_ie_compatibility_view());
$this->assertFalse(core_useragent::check_ie_version('12'));
core_useragent::instance(true, $this->user_agents['Firefox']['2.0']['Windows XP']);
$this->assertTrue(core_useragent::is_firefox());
$this->assertTrue(core_useragent::check_firefox_version());
$this->assertTrue(core_useragent::check_firefox_version('1.5'));
$this->assertFalse(core_useragent::check_firefox_version('3.0'));
$this->assertTrue(core_useragent::check_gecko_version('2'));
$this->assertTrue(core_useragent::check_gecko_version(20030516));
$this->assertTrue(core_useragent::check_gecko_version(20051106));
$this->assertTrue(core_useragent::check_gecko_version(2006010100));
core_useragent::instance(true, $this->user_agents['Firefox']['1.0.6']['Windows XP']);
$this->assertTrue(core_useragent::is_firefox());
$this->assertTrue(core_useragent::check_firefox_version());
$this->assertTrue(core_useragent::check_gecko_version('1'));
$this->assertFalse(core_useragent::check_gecko_version(20030516));
$this->assertFalse(core_useragent::check_gecko_version(20051106));
$this->assertFalse(core_useragent::check_gecko_version(2006010100));
$this->assertFalse(core_useragent::check_firefox_version('1.5'));
$this->assertFalse(core_useragent::check_firefox_version('3.0'));
$this->assertFalse(core_useragent::check_gecko_version('2'));
core_useragent::instance(true, $this->user_agents['Firefox']['2.0']['Windows XP']);
$this->assertTrue(core_useragent::is_firefox());
$this->assertTrue(core_useragent::check_firefox_version());
$this->assertTrue(core_useragent::check_firefox_version('1.5'));
$this->assertTrue(core_useragent::check_gecko_version('1'));
$this->assertTrue(core_useragent::check_gecko_version('2'));
$this->assertTrue(core_useragent::check_gecko_version(20030516));
$this->assertTrue(core_useragent::check_gecko_version(20051106));
$this->assertTrue(core_useragent::check_gecko_version(2006010100));
$this->assertFalse(core_useragent::check_firefox_version('3.0'));
core_useragent::instance(true, $this->user_agents['Firefox']['3.6']['Linux']);
$this->assertTrue(core_useragent::is_firefox());
$this->assertTrue(core_useragent::check_firefox_version());
$this->assertTrue(core_useragent::check_firefox_version('1.5'));
$this->assertTrue(core_useragent::check_firefox_version('3.0'));
$this->assertTrue(core_useragent::check_gecko_version('2'));
$this->assertTrue(core_useragent::check_gecko_version('3.6'));
$this->assertTrue(core_useragent::check_gecko_version(20030516));
$this->assertTrue(core_useragent::check_gecko_version(20051106));
示例3: test_check_browser_version
//.........這裏部分代碼省略.........
$this->assertTrue(core_useragent::check_ie_version('5.0'));
$this->assertTrue(core_useragent::check_ie_version('9.0'));
$this->assertTrue(core_useragent::check_ie_version('10'));
$this->assertTrue(core_useragent::check_ie_compatibility_view());
$this->assertFalse(core_useragent::check_ie_version('11'));
$this->assertFalse(core_useragent::is_msword());
core_useragent::instance(true, $this->user_agents['MSIE']['11.0']['Windows 8.1']);
$this->assertTrue(core_useragent::is_ie());
$this->assertTrue(core_useragent::check_ie_version());
$this->assertTrue(core_useragent::check_ie_version(0));
$this->assertTrue(core_useragent::check_ie_version('5.0'));
$this->assertTrue(core_useragent::check_ie_version('9.0'));
$this->assertTrue(core_useragent::check_ie_version('10'));
$this->assertTrue(core_useragent::check_ie_version('11'));
$this->assertFalse(core_useragent::check_ie_compatibility_view());
$this->assertFalse(core_useragent::check_ie_version('12'));
$this->assertFalse(core_useragent::is_msword());
core_useragent::instance(true, $this->user_agents['MSIE']['11.0i']['Windows 8.1']);
$this->assertTrue(core_useragent::is_ie());
$this->assertTrue(core_useragent::check_ie_version());
$this->assertTrue(core_useragent::check_ie_version(0));
$this->assertTrue(core_useragent::check_ie_version('5.0'));
$this->assertTrue(core_useragent::check_ie_version('9.0'));
$this->assertTrue(core_useragent::check_ie_version('10'));
$this->assertTrue(core_useragent::check_ie_version('11'));
$this->assertTrue(core_useragent::check_ie_compatibility_view());
$this->assertFalse(core_useragent::check_ie_version('12'));
$this->assertFalse(core_useragent::is_msword());
core_useragent::instance(true, $this->user_agents['Firefox']['2.0']['Windows XP']);
$this->assertTrue(core_useragent::is_firefox());
$this->assertTrue(core_useragent::check_firefox_version());
$this->assertTrue(core_useragent::check_firefox_version('1.5'));
$this->assertFalse(core_useragent::check_firefox_version('3.0'));
$this->assertTrue(core_useragent::check_gecko_version('2'));
$this->assertTrue(core_useragent::check_gecko_version(20030516));
$this->assertTrue(core_useragent::check_gecko_version(20051106));
$this->assertTrue(core_useragent::check_gecko_version(2006010100));
$this->assertFalse(core_useragent::is_msword());
core_useragent::instance(true, $this->user_agents['Firefox']['1.0.6']['Windows XP']);
$this->assertTrue(core_useragent::is_firefox());
$this->assertTrue(core_useragent::check_firefox_version());
$this->assertTrue(core_useragent::check_gecko_version('1'));
$this->assertFalse(core_useragent::check_gecko_version(20030516));
$this->assertFalse(core_useragent::check_gecko_version(20051106));
$this->assertFalse(core_useragent::check_gecko_version(2006010100));
$this->assertFalse(core_useragent::check_firefox_version('1.5'));
$this->assertFalse(core_useragent::check_firefox_version('3.0'));
$this->assertFalse(core_useragent::check_gecko_version('2'));
$this->assertFalse(core_useragent::is_msword());
core_useragent::instance(true, $this->user_agents['Firefox']['2.0']['Windows XP']);
$this->assertTrue(core_useragent::is_firefox());
$this->assertTrue(core_useragent::check_firefox_version());
$this->assertTrue(core_useragent::check_firefox_version('1.5'));
$this->assertTrue(core_useragent::check_gecko_version('1'));
$this->assertTrue(core_useragent::check_gecko_version('2'));
$this->assertTrue(core_useragent::check_gecko_version(20030516));
$this->assertTrue(core_useragent::check_gecko_version(20051106));
$this->assertTrue(core_useragent::check_gecko_version(2006010100));
$this->assertFalse(core_useragent::check_firefox_version('3.0'));
$this->assertFalse(core_useragent::is_msword());
core_useragent::instance(true, $this->user_agents['Firefox']['3.6']['Linux']);
$this->assertTrue(core_useragent::is_firefox());
$this->assertTrue(core_useragent::check_firefox_version());
$this->assertTrue(core_useragent::check_firefox_version('1.5'));
$this->assertTrue(core_useragent::check_firefox_version('3.0'));
$this->assertTrue(core_useragent::check_gecko_version('2'));