diff options
author | Dhruv <dhruv.goel92@gmail.com> | 2013-04-29 02:25:22 +0530 |
---|---|---|
committer | Dhruv <dhruv.goel92@gmail.com> | 2013-04-29 02:29:19 +0530 |
commit | 679183385fc070269ea2356722eff0f3b6defdfc (patch) | |
tree | b3c10f834ff6df0eb99d43f5970a1479059d56ac /tests/download | |
parent | Merge remote-tracking branch 'dhruvgoel92/ticket/10820' into ticket/10820-dev... (diff) | |
download | phpbb-679183385fc070269ea2356722eff0f3b6defdfc.tar.gz phpbb-679183385fc070269ea2356722eff0f3b6defdfc.tar.bz2 phpbb-679183385fc070269ea2356722eff0f3b6defdfc.zip |
[ticket/10820] add unit tests for phpbb_is_greater_ie7
PHPBB3-10820
Diffstat (limited to 'tests/download')
-rw-r--r-- | tests/download/http_user_agent_test.php | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/tests/download/http_user_agent_test.php b/tests/download/http_user_agent_test.php new file mode 100644 index 0000000000..601561f44e --- /dev/null +++ b/tests/download/http_user_agent_test.php @@ -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)); + } +} |