<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[5948] sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0: Browse Happy API: Convert crude unit tests to PHPUnit.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/5948">5948</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/5948","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>coffee2code</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-09-21 19:05:14 +0000 (Thu, 21 Sep 2017)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Browse Happy API: Convert crude unit tests to PHPUnit.

Includes 5 (previously, and still) failing tests.

Props SergeyBiryukov.
See <a href="http://meta.trac.wordpress.org/ticket/2587">#2587</a>.</pre>

<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkapiwordpressorgpublic_htmlcorebrowsehappy10phpunitxml">sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/phpunit.xml</a></li>
<li>sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/</li>
<li>sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/</li>
<li>sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/</li>
<li><a href="#sitestrunkapiwordpressorgpublic_htmlcorebrowsehappy10testsphpunittestsbrowsehappyphp">sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#sitestrunkapiwordpressorgpublic_htmlcorebrowsehappy10testsphp">sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkapiwordpressorgpublic_htmlcorebrowsehappy10phpunitxml"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/phpunit.xml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/phpunit.xml                               (rev 0)
+++ sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/phpunit.xml 2017-09-21 19:05:14 UTC (rev 5948)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,14 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<phpunit
+       backupGlobals="false"
+       colors="true"
+       convertErrorsToExceptions="true"
+       convertNoticesToExceptions="true"
+       convertWarningsToExceptions="true"
+       >
+       <testsuites>
+               <testsuite>
+                       <directory suffix=".php">tests/</directory>
+               </testsuite>
+       </testsuites>
+</phpunit>
+
</ins></span></pre></div>
<a id="sitestrunkapiwordpressorgpublic_htmlcorebrowsehappy10testsphpunittestsbrowsehappyphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php                              (rev 0)
+++ sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php        2017-09-21 19:05:14 UTC (rev 5948)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,220 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+include dirname( __FILE__ ) . '/../../../parse.php';
+
+/**
+ *
+ * @group browse-happy
+ */
+class Tests_Browse_Happy extends PHPUnit_Framework_TestCase {
+
+       /**
+        * Data provider for test_browsehappy_parse_user_agent().
+        *
+        * @return array {
+        *     @type array {
+        *         @type string $header   'User-Agent' header value.
+        *         @type string $expected Expected browser name and version.
+        *     }
+        * }
+        */
+       function data_browse_happy() {
+               return [
+                       [
+                               'Mozilla/4.0 (Windows; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)',
+                               'Windows Internet Explorer 6.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (MSIE 6.0; Windows NT 5.1)',
+                               'Windows Internet Explorer 6.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)',
+                               'Windows Internet Explorer 6.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (compatible;MSIE 6.0;Windows 98;Q312461)',
+                               'Windows Internet Explorer 6.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0) (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
+                               'Windows Internet Explorer 6.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (compatible; U; MSIE 6.0; Windows NT 5.1)',
+                               'Windows Internet Explorer 6.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
+                               'Windows Internet Explorer 7.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; Tablet PC 2.0)',
+                               'Windows Internet Explorer 8.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; Tablet PC 2.0)',
+                               'Windows Internet Explorer 8.0',
+                       ],
+                       [
+                               'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
+                               'Windows Internet Explorer 9.0',
+                       ],
+                       [
+                               'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.21022)',
+                               'Windows Firefox 3.5.5',
+                       ],
+                       [
+                               'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 FirePHP/0.5',
+                               'Windows Firefox 3.6.15',
+                       ],
+                       [
+                               'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13',
+                               'Windows Chrome 9.0.597.98',
+                       ],
+                       [
+                               'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.114 Safari/534.16',
+                               'Windows Chrome 10.0.648.114',
+                       ],
+                       [
+                               'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7',
+                               'Windows Chrome 7.0.517.41',
+                       ],
+                       [
+                               'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.8.99 Version/11.10',
+                               'Windows Opera 11.10',
+                       ],
+                       [
+                               'Opera/9.80 (Windows NT 5.1; U; cs) Presto/2.7.62 Version/11.01',
+                               'Windows Opera 11.01',
+                       ],
+                       [
+                               'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101213 Opera/9.80 (Windows NT 6.1; U; zh-tw) Presto/2.7.62 Version/11.01',
+                               'Windows Opera 11.01',
+                       ],
+                       [
+                               'Mozilla/5.0 (Windows NT 6.1; U; nl; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 Opera 11.01',
+                               'Windows Opera 11.01',
+                       ],
+                       [
+                               'Mozilla/5.0 (Windows NT 6.1; U; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 Opera 11.01',
+                               'Windows Opera 11.01',
+                       ],
+                       [
+                               'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; de) Opera 11.01',
+                               'Windows Opera 11.01',
+                       ],
+                       [
+                               'Mozilla/5.0 (Windows; U; Windows NT 6.1; tr-TR) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
+                               'Windows Safari 5.0.4',
+                       ],
+                       [
+                               'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3',
+                               'Macintosh Firefox 3.6.3',
+                       ],
+                       [
+                               'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7',
+                               'Macintosh Safari 4.0.5',
+                       ],
+                       [
+                               'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/4.1.2 Safari/533.18.5',
+                               'Macintosh Safari 4.1.2',
+                       ],
+                       [
+                               'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.9 (KHTML, like Gecko) Safari/312.6',
+                               'Macintosh Safari 312.6',
+                       ],
+                       [
+                               'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16',
+                               'Macintosh Safari 5.0',
+                       ],
+                       [
+                               'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; it; rv:1.9.0.19) Gecko/2010111021 Camino/2.0.6 (MultiLang) (like Firefox/3.0.19)',
+                               'Macintosh Camino 2.0.6',
+                       ],
+                       [
+                               'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en; rv:1.9.0.18) Gecko/2010021619 Camino/2.0.2 (like Firefox/3.0.18)',
+                               'Macintosh Camino 2.0.2',
+                       ],
+                       [
+                               'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; it; rv:1.8.1.21) Gecko/20090327 Camino/1.6.7 (MultiLang) (like Firefox/2.0.0.21pre)',
+                               'Macintosh Camino 1.6.7',
+                       ],
+                       [
+                               'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.11) Gecko/20071128 Camino/1.5.4',
+                               'Macintosh Camino 1.5.4',
+                       ],
+                       [
+                               'Mozilla/5.0 (Linux; U; Android 2.2; en-us; SGH-T959 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
+                               'Linux Mobile Safari 4.0',
+                       ],
+                       [
+                               'Mozilla/5.0 (iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10',
+                               'iPad Safari 4.0.4',
+                       ],
+                       [
+                               'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
+                               'iPad Safari 4.0.4',
+                       ],
+                       [
+                               'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_6 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8E200 Safari/6533.18.5',
+                               'iPhone Safari 5.0.2',
+                       ],
+                       [
+                               'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C25 Safari/419.3',
+                               'iPhone Safari 3.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0) Asus;Galaxy6',
+                               'Windows Phone OS Internet Explorer Mobile 7.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; LG; GW910)',
+                               'Windows Phone OS Internet Explorer Mobile 7.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0) LG;LG-E900h)',
+                               'Windows Phone OS Internet Explorer Mobile 7.0',
+                       ],
+                       [
+                               'Mozilla/4.0 (compatible; Linux 2.6.10) NetFront/3.3 Kindle/1.0 (screen 600x800)',
+                               'Kindle Kindle 1.0',
+                       ],
+                       [
+                               'Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) Version/4.0 Kindle/3.0 (screen 600x800; rotate)',
+                               'Kindle Kindle 4.0',
+                       ],
+                       [
+                               'Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/538.5+) Version/4.0 Kindle/3.0 (screen 600x800; rotate)',
+                               'Kindle Kindle 4.0',
+                       ],
+                       [
+                               'Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.8 (KHTML, like Gecko) Version/0.0.1 Safari/534.8',
+                               'PlayBook PlayBook 0.0.1',
+                       ],
+                       [
+                               'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) RockMelt/0.9.58.494 Chrome/11.0.696.71 Safari/534.24',
+                               'Macintosh RockMelt 0.9.58.494',
+                       ],
+                       [
+                               'Mozilla/5.0 (Linux; U; Android 3.1; en-us; GT-P7510 Build/HMJ37) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13',
+                               'Android Safari 4.0',
+                       ],
+               ];
+       }
+
+       /**
+        * @dataProvider data_browse_happy
+        *
+        * @param string $header   'User-Agent' header value.
+        * @param string $expected Expected browser name and version.
+        */
+       function test_browsehappy_parse_user_agent( $header, $expected ) {
+               $parsed = browsehappy_parse_user_agent( $header );
+               $result = $parsed['platform'] . ' ' . $parsed['name'] . ' ' . $parsed['version'];
+
+               $this->assertEquals( $expected, $result );
+       }
+
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkapiwordpressorgpublic_htmlcorebrowsehappy10testsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests.php 2017-09-21 18:53:00 UTC (rev 5947)
+++ sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests.php   2017-09-21 19:05:14 UTC (rev 5948)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,75 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-include dirname( __FILE__ ) . '/parse.php';
-
-$tests = array (
-  'Mozilla/4.0 (Windows; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)' => 'Windows Internet Explorer 6.0',
-  'Mozilla/4.0 (MSIE 6.0; Windows NT 5.1)' => 'Windows Internet Explorer 6.0',
-  'Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)' => 'Windows Internet Explorer 6.0',
-  'Mozilla/4.0 (compatible;MSIE 6.0;Windows 98;Q312461)' => 'Windows Internet Explorer 6.0',
-  'Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0) (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)' => 'Windows Internet Explorer 6.0',
-  'Mozilla/4.0 (compatible; U; MSIE 6.0; Windows NT 5.1)' => 'Windows Internet Explorer 6.0',
-  'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)' => 'Windows Internet Explorer 7.0',
-  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; Tablet PC 2.0)' => 'Windows Internet Explorer 8.0',
-  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; Tablet PC 2.0)' => 'Windows Internet Explorer 8.0',
-  'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)' => 'Windows Internet Explorer 9.0',
-  'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.21022)' => 'Windows Firefox 3.5.5',
-  'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 FirePHP/0.5' => 'Windows Firefox 3.6.15',
-  'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13' => 'Windows Chrome 9.0.597.98',
-  'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.114 Safari/534.16' => 'Windows Chrome 10.0.648.114',
-  'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7' => 'Windows Chrome 7.0.517.41',
-  'Opera/9.80 (Windows NT 6.0; U; en) Presto/2.8.99 Version/11.10' => 'Windows Opera 11.10',
-  'Opera/9.80 (Windows NT 5.1; U; cs) Presto/2.7.62 Version/11.01' => 'Windows Opera 11.01',
-  'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101213 Opera/9.80 (Windows NT 6.1; U; zh-tw) Presto/2.7.62 Version/11.01' => 'Windows Opera 11.01',
-  'Mozilla/5.0 (Windows NT 6.1; U; nl; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 Opera 11.01' => 'Windows Opera 11.01',
-  'Mozilla/5.0 (Windows NT 6.1; U; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 Opera 11.01' => 'Windows Opera 11.01',
-  'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; de) Opera 11.01' => 'Windows Opera 11.01',
-  'Mozilla/5.0 (Windows; U; Windows NT 6.1; tr-TR) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27' => 'Windows Safari 5.0.4',
-  'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3' => 'Macintosh Firefox 3.6.3',
-  'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7' => 'Macintosh Safari 4.0.5',
-  'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/4.1.2 Safari/533.18.5' => 'Macintosh Safari 4.1.2',
-  'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.9 (KHTML, like Gecko) Safari/312.6' => 'Macintosh Safari 312.6',
-  'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16' => 'Macintosh Safari 5.0',
-  'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; it; rv:1.9.0.19) Gecko/2010111021 Camino/2.0.6 (MultiLang) (like Firefox/3.0.19)' => 'Macintosh Camino 2.0.6',
-  'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en; rv:1.9.0.18) Gecko/2010021619 Camino/2.0.2 (like Firefox/3.0.18)' => 'Macintosh Camino 2.0.2',
-  'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; it; rv:1.8.1.21) Gecko/20090327 Camino/1.6.7 (MultiLang) (like Firefox/2.0.0.21pre)' => 'Macintosh Camino 1.6.7',
-  'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.11) Gecko/20071128 Camino/1.5.4' => 'Macintosh Camino 1.5.4',
-  'Mozilla/5.0 (Linux; U; Android 2.2; en-us; SGH-T959 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1' => 'Linux Mobile Safari 4.0',
-  'Mozilla/5.0 (iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10' => 'iPad Safari 4.0.4',
-  'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10' => 'iPad Safari 4.0.4',
-  'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_6 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8E200 Safari/6533.18.5' => 'iPhone Safari 5.0.2',
-  'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C25 Safari/419.3' => 'iPhone Safari 3.0',
-  'Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0) Asus;Galaxy6' => 'Windows Phone OS Internet Explorer Mobile 7.0',
-  'Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; LG; GW910)' => 'Windows Phone OS Internet Explorer Mobile 7.0',
-  'Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0) LG;LG-E900h)' => 'Windows Phone OS Internet Explorer Mobile 7.0',
-  'Mozilla/4.0 (compatible; Linux 2.6.10) NetFront/3.3 Kindle/1.0 (screen 600x800)' => 'Kindle Kindle 1.0',
-  'Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) Version/4.0 Kindle/3.0 (screen 600x800; rotate)' => 'Kindle Kindle 4.0',
-  'Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/538.5+) Version/4.0 Kindle/3.0 (screen 600x800; rotate)' => 'Kindle Kindle 4.0',
-  'Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.8 (KHTML, like Gecko) Version/0.0.1 Safari/534.8' => 'PlayBook PlayBook 0.0.1',
-  'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) RockMelt/0.9.58.494 Chrome/11.0.696.71 Safari/534.24' => 'Macintosh RockMelt 0.9.58.494',
-  'Mozilla/5.0 (Linux; U; Android 3.1; en-us; GT-P7510 Build/HMJ37) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13' => 'Android Safari 4.0',
-);
-
-$pass = $fail = 0;
-$fails = array();
-
-foreach ( $tests as $ua => $assert ) {
-       $parsed = browsehappy_parse_user_agent( $ua );
-       $result = $parsed['platform'] . ' ' . $parsed['name'] . ' ' . $parsed['version'];
-       if ( $assert === $result ) {
-               ++$pass;
-       } else {
-               ++$fail;
-               $fails[ $ua ] = array( $assert, $result );
-       }
-}
-
-if ( 'cli' != php_sapi_name() )
-       echo '<pre>';
-
-echo "$pass passes, $fail failures.\n\n";
-
-foreach ( $fails as $ua => $data ) {
-       list( $assert, $result ) = $data;
-       echo "$ua\n should be  : $assert\n detected as: $result\n\n";
-}
</del></span></pre>
</div>
</div>

</body>
</html>