aboutsummaryrefslogtreecommitdiffstats
path: root/tests/download
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2013-04-29 02:25:22 +0530
committerDhruv <dhruv.goel92@gmail.com>2013-04-29 02:29:19 +0530
commit679183385fc070269ea2356722eff0f3b6defdfc (patch)
treeb3c10f834ff6df0eb99d43f5970a1479059d56ac /tests/download
parentcba5dde0ee0a2f4c2197959f45c5b53389798837 (diff)
downloadforums-679183385fc070269ea2356722eff0f3b6defdfc.tar
forums-679183385fc070269ea2356722eff0f3b6defdfc.tar.gz
forums-679183385fc070269ea2356722eff0f3b6defdfc.tar.bz2
forums-679183385fc070269ea2356722eff0f3b6defdfc.tar.xz
forums-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.php65
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));
+ }
+}