<!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>[6037] sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0: Browse Happy API: Refactor to reduce both code duplication and the number of repeated checks performed.</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/6037">6037</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/6037","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-10-16 22:32:50 +0000 (Mon, 16 Oct 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: Refactor to reduce both code duplication and the number of repeated checks performed.
* Compacts near-identical handling for explicitly identifiable browsers into single handler
* Removes individual handlers for 17 browsers
* Adds `browsehappy_get_explicit_browser_tokens()` to return data for the similarly-handled explicitly identifiable browsers</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkapiwordpressorgpublic_htmlcorebrowsehappy10parsephp">sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/parse.php</a></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>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkapiwordpressorgpublic_htmlcorebrowsehappy10parsephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/parse.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/parse.php 2017-10-16 19:15:40 UTC (rev 6036)
+++ sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/parse.php 2017-10-16 22:32:50 UTC (rev 6037)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,6 +6,101 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require dirname( __FILE__ ) . '/browsers.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Returns an associative array of explicit browser token names and their
+ * associated info.
+ *
+ * Explicit tokens are tokens that, if present, indicate a specific browser.
+ *
+ * If a browser is not identified by an explicit token, or requires special
+ * handling not supported by the default handler, then a new conditional block
+ * for the browser instead needs to be added in browsehappy_parse_user_agent().
+ *
+ * In any case, the browser token name also needs to be added to the regex for
+ * browser tokens in browsehappy_parse_user_agent().
+ *
+ * @return array {
+ * Associative array of browser tokens and their associated data.
+ *
+ * @type array $data {
+ * Associative array of browser data. All are optional.
+ *
+ * @type string $name Name of browser, if it differs from the
+ * token name. Default is token name.
+ * @type bool $use_version Should the 'Version' token, if present,
+ * supercede the version associated with the
+ * browser token? Default false.
+ * @type bool $mobile Does the browser signify the platform is
+ * mobile (for situations where it may no
+ * already be apparent)? Default false.
+ * @type string $platform The name of the platform, to supercede
+ * whatever platform may have been detected.
+ * Default empty string.
+ * }
+ * }
+ */
+function browsehappy_get_explicit_browser_tokens() {
+ return array(
+ 'Camino' => array(),
+ 'Chromium' => array(),
+ 'Edge' => array(
+ 'name' => 'Microsoft Edge',
+ ),
+ 'Kindle' => array(
+ 'name' => 'Kindle Browser',
+ 'use_version' => true,
+ ),
+ 'Konqueror' => array(),
+ 'konqueror' => array(
+ 'name' => 'Konqueror',
+ ),
+ 'NokiaBrowser' => array(
+ 'name' => 'Nokia Browser',
+ 'mobile' => true,
+ ),
+ 'Opera Mini' => array( // Must be before 'Opera'
+ 'mobile' => true,
+ 'use_version' => true,
+ ),
+ 'Opera' => array(
+ 'use_version' => true,
+ ),
+ 'OPR' => array(
+ 'name' => 'Opera',
+ 'use_version' => true,
+ ),
+ 'PaleMoon' => array(
+ 'name' => 'Pale Moon',
+ ),
+ 'QQBrowser' => array(
+ 'name' => 'QQ Browser',
+ ),
+ 'RockMelt' => array(),
+ 'SamsungBrowser' => array(
+ 'name' => 'Samsung Browser',
+ ),
+ 'SeaMonkey' => array(),
+ 'Silk' => array(
+ 'name' => 'Amazon Silk',
+ ),
+ 'S40OviBrowser' => array(
+ 'name' => 'Ovi Browser',
+ 'mobile' => true,
+ 'platform' => 'Symbian',
+ ),
+ 'UCBrowser' => array( // Must be before 'UCWEB'
+ 'name' => 'UC Browser',
+ ),
+ 'UCWEB' => array(
+ 'name' => 'UC Browser',
+ ),
+ 'Vivaldi' => array(),
+ 'IEMobile' => array( // Keep last just in case
+ 'name' => 'Internet Explorer Mobile',
+ ),
+ );
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Parses a user agent string into its important parts.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $user_agent The user agent string for a browser.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,6 +199,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $result['version'][ $key ] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $explicit_tokens = browsehappy_get_explicit_browser_tokens();
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // No indentifiers provided
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $result['name'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'BlackBerry' === $mobile_device ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,79 +209,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data['name'] = 'unknown';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Opera
- elseif (
- false !== ( $key = array_search( 'Opera Mini', $result['name'] ) )
- ||
- false !== ( $key = array_search( 'Opera', $result['name'] ) )
- ||
- false !== ( $key = array_search( 'OPR', $result['name'] ) )
- ) {
- $data['name'] = $result['name'][ $key ];
- if ( 'OPR' === $data['name'] ) {
- $data['name'] = 'Opera';
- } elseif ( 'Opera Mini' === $data['name'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Explicitly identified browser (info defined above in $explicit_tokens).
+ elseif ( $found = array_intersect( array_keys( $explicit_tokens ), $result['name'] ) ) {
+ $tokens = array_combine( $result['name'], $result['version'] );
+ $token = reset( $found );
+
+ $data['name'] = $explicit_tokens[ $token ]['name'] ?? $token;
+ $data['version'] = $tokens[ $token ];
+ if ( empty( $explicit_tokens[ $token ]['use_version'] ) ) {
+ $version = '';
+ }
+ if ( ! empty( $explicit_tokens[ $token ]['mobile'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $data['mobile'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $data['version'] = $result['version'][ $key ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $explicit_tokens[ $token ]['platform'] ) ) {
+ $data['platform'] = $explicit_tokens[ $token ]['platform'];
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // UC Browser
- elseif (
- false !== ( $key = array_search( 'UCBrowser', $result['name'] ) )
- ||
- false !== ( $key = array_search( 'UCWEB', $result['name'] ) )
- ) {
- $data['name'] = 'UC Browser';
- $data['version'] = $result['version'][ $key ];
- $version = '';
- }
- // QQ Browser
- elseif ( false !== ( $key = array_search( 'QQBrowser', $result['name'] ) ) ) {
- $data['name'] = 'QQ Browser';
- $data['version'] = $result['version'][ $key ];
- $version = '';
- }
- // Nokia Browser
- elseif ( false !== ( $key = array_search( 'NokiaBrowser', $result['name'] ) ) ) {
- $data['name'] = 'Nokia Browser';
- $data['version'] = $result['version'][ $key ];
- $data['mobile'] = true;
- }
- // Amazon Silk
- elseif ( false !== ( $key = array_search( 'Silk', $result['name'] ) ) ) {
- $data['name'] = 'Amazon Silk';
- $data['version'] = $result['version'][ $key ];
- $version = '';
- }
- // Kindle Browser
- elseif ( false !== ( $key = array_search( 'Kindle', $result['name'] ) ) ) {
- $data['name'] = 'Kindle Browser';
- $data['version'] = $result['version'][ $key ];
- }
- // Samsung Browser
- elseif ( false !== ( $key = array_search( 'SamsungBrowser', $result['name'] ) ) ) {
- $data['name'] = 'Samsung Browser';
- $data['version'] = $result['version'][ $key ];
- }
- // Chromium
- elseif ( false !== ( $key = array_search( 'Chromium', $result['name'] ) ) ) {
- $data['name'] = 'Chromium';
- $data['version'] = $result['version'][ $key ];
- }
- // Konqueror
- elseif (
- false !== ( $key = array_search( 'Konqueror', $result['name'] ) )
- ||
- false !== ( $key = array_search( 'konqueror', $result['name'] ) )
- ) {
- $data['name'] = 'Konqueror';
- $data['version'] = $result['version'][ $key ];
- }
- // Pale Moon
- elseif ( false !== ( $key = array_search( 'PaleMoon', $result['name'] ) ) ) {
- $data['name'] = 'Pale Moon';
- $data['version'] = $result['version'][ $key ];
- }
</del><span class="cx" style="display: block; padding: 0 10px"> // Puffin
</span><span class="cx" style="display: block; padding: 0 10px"> elseif ( false !== ( $key = array_search( 'Puffin', $result['name'] ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $data['name'] = 'Puffin';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,51 +237,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data['platform'] = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // SeaMonkey
- elseif ( false !== ( $key = array_search( 'SeaMonkey', $result['name'] ) ) ) {
- $data['name'] = 'SeaMonkey';
- $data['version'] = $result['version'][ $key ];
- }
- // Vivaldi
- elseif ( false !== ( $key = array_search( 'Vivaldi', $result['name'] ) ) ) {
- $data['name'] = 'Vivaldi';
- $data['version'] = $result['version'][ $key ];
- }
</del><span class="cx" style="display: block; padding: 0 10px"> // Trident (Internet Explorer)
</span><span class="cx" style="display: block; padding: 0 10px"> elseif ( false !== ( $key = array_search( 'Trident', $result['name'] ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // IE 8-10 more reliably report version via Trident token than MSIE token.
</span><span class="cx" style="display: block; padding: 0 10px"> // IE 11 uses Trident token without an MSIE token.
</span><span class="cx" style="display: block; padding: 0 10px"> // https://msdn.microsoft.com/library/hh869301(v=vs.85).aspx
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( false !== ( $key2 = array_search( 'IEMobile', $result['name'] ) ) ) {
- $data['name'] = 'Internet Explorer Mobile';
- $data['version'] = $result['version'][ $key2 ];
- } else {
- $data['name'] = 'Internet Explorer';
- $trident_ie_mapping = array(
- '4.0' => '8.0',
- '5.0' => '9.0',
- '6.0' => '10.0',
- '7.0' => '11.0',
- );
- $ver = $result['version'][ $key ];
- $data['version'] = $trident_ie_mapping[ $ver ] ?? $ver;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data['name'] = 'Internet Explorer';
+ $trident_ie_mapping = array(
+ '4.0' => '8.0',
+ '5.0' => '9.0',
+ '6.0' => '10.0',
+ '7.0' => '11.0',
+ );
+ $ver = $result['version'][ $key ];
+ $data['version'] = $trident_ie_mapping[ $ver ] ?? $ver;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // Internet Explorer (pre v8.0)
</span><span class="cx" style="display: block; padding: 0 10px"> elseif ( false !== ( $key = array_search( 'MSIE', $result['name'] ) ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( false !== ( $key = array_search( 'IEMobile', $result['name'] ) ) ) {
- $data['name'] = 'Internet Explorer Mobile';
- } else {
- $data['name'] = 'Internet Explorer';
- $key = 0;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data['name'] = 'Internet Explorer';
+ $key = 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> $data['version'] = $result['version'][ $key ];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // AppleWebKit-emulating browsers
</span><span class="cx" style="display: block; padding: 0 10px"> elseif ( false !== ( $key = array_search( 'AppleWebKit', $result['name'] ) ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( false !== ( $key = array_search( 'Edge', $result['name'] ) ) ) {
- $data['name'] = 'Microsoft Edge';
- } elseif ( false !== ( $key = array_search( 'Mobile Safari', $result['name'] ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( false !== ( $key = array_search( 'Mobile Safari', $result['name'] ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false !== ( $key2 = array_search( 'Chrome', $result['name'] ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $data['name'] = 'Chrome';
</span><span class="cx" style="display: block; padding: 0 10px"> $version = $result['version'][ $key2 ];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,8 +280,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data['name'] = 'Mobile Safari';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // } elseif ( ( 'Android' == $data['platform'] && !($key = 0) ) || $key = array_search( 'Chrome', $result['name'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( false !== ( $key = array_search( 'RockMelt', $result['name'] ) ) ) {
- $data['name'] = 'RockMelt';
</del><span class="cx" style="display: block; padding: 0 10px"> } elseif ( false !== ( $key = array_search( 'Chrome', $result['name'] ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $data['name'] = 'Chrome';
</span><span class="cx" style="display: block; padding: 0 10px"> $version = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,13 +302,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $data['version'] = $result['version'][ $key ];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Ovi Browser
- elseif ( false !== ( $key = array_search( 'S40OviBrowser', $result['name'] ) ) ) {
- $data['name'] = 'Ovi Browser';
- $data['version'] = $result['version'][ $key ];
- $data['platform'] = 'Symbian';
- $data['mobile'] = true;
- }
</del><span class="cx" style="display: block; padding: 0 10px"> // Fall back to whatever is being reported.
</span><span class="cx" style="display: block; padding: 0 10px"> else {
</span><span class="cx" style="display: block; padding: 0 10px"> $data['name'] = $result['name'][0];
</span></span></pre></div>
<a id="sitestrunkapiwordpressorgpublic_htmlcorebrowsehappy10testsphpunittestsbrowsehappyphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: 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 2017-10-16 19:15:40 UTC (rev 6036)
+++ sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/tests/phpunit/tests/browse-happy.php 2017-10-16 22:32:50 UTC (rev 6037)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -865,4 +865,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function test_browsehappy_get_explicit_browser_tokens() {
+ $tokens = browsehappy_get_explicit_browser_tokens();
+
+ $this->assertTrue( is_array( $tokens ) );
+
+ $this->assertArrayHasKey( 'Camino', $tokens );
+ $this->assertEmpty( $tokens['Camino'] );
+
+ $this->assertArrayHasKey( 'S40OviBrowser', $tokens );
+ $this->assertArrayHasKey( 'name', $tokens['S40OviBrowser'] );
+ $this->assertEquals( 'Ovi Browser', $tokens['S40OviBrowser']['name'] );
+ $this->assertArrayHasKey( 'mobile', $tokens['S40OviBrowser'] );
+ $this->assertTrue( $tokens['S40OviBrowser']['mobile'] );
+ $this->assertArrayHasKey( 'platform', $tokens['S40OviBrowser'] );
+ $this->assertEquals( 'Symbian', $tokens['S40OviBrowser']['platform'] );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>