mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-04 21:44:57 +02:00
[ticket/10820] add unit tests for phpbb_is_greater_ie7
PHPBB3-10820
This commit is contained in:
parent
cba5dde0ee
commit
679183385f
65
tests/download/http_user_agent_test.php
Normal file
65
tests/download/http_user_agent_test.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package testing
|
||||
* @copyright (c) 2010 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_download.php';
|
||||
|
||||
class phpbb_download_http_user_agent_test extends phpbb_test_case
|
||||
{
|
||||
public function user_agents()
|
||||
{
|
||||
return array(
|
||||
// user agent
|
||||
// expected
|
||||
array(
|
||||
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
|
||||
true,
|
||||
),
|
||||
array(
|
||||
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)',
|
||||
true,
|
||||
),
|
||||
array(
|
||||
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.4; InfoPath.2; SV1; .NET CLR 3.3.69573; WOW64; en-US)',
|
||||
true,
|
||||
),
|
||||
array(
|
||||
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
|
||||
false,
|
||||
),
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
|
||||
false,
|
||||
),
|
||||
array(
|
||||
'Mozilla/4.0 (compatible; MSIE 6.01; Windows NT 6.0)',
|
||||
false,
|
||||
),
|
||||
array(
|
||||
'Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)',
|
||||
false,
|
||||
),
|
||||
array(
|
||||
'Mozilla/5.0 (Windows NT 6.2; Win64; x64;) Gecko/20100101 Firefox/20.0',
|
||||
false,
|
||||
),
|
||||
array(
|
||||
'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1464.0 Safari/537.36',
|
||||
false,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider user_agents
|
||||
*/
|
||||
public function test_is_greater_ie7($user_agent, $expected)
|
||||
{
|
||||
$this->assertEquals($expected, phpbb_is_greater_ie7($user_agent));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user