<!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>[407] Pinking shears</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, #logmsg > ol { margin-left: 0; 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">
<dt>Revision</dt> <dd>407</dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2011-08-04 20:38:26 +0000 (Thu, 04 Aug 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Pinking shears</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#wpconfigsamplephp">wp-config-sample.php</a></li>
<li><a href="#wpmailrealtestphp">wp-mail-real-test.php</a></li>
<li><a href="#wptestphp">wp-test.php</a></li>
<li><a href="#wptestcasetest_actionsphp">wp-testcase/test_actions.php</a></li>
<li><a href="#wptestcasetest_admin_includes_templatephp">wp-testcase/test_admin_includes_template.php</a></li>
<li><a href="#wptestcasetest_cronphp">wp-testcase/test_cron.php</a></li>
<li><a href="#wptestcasetest_filtersphp">wp-testcase/test_filters.php</a></li>
<li><a href="#wptestcasetest_httpphp">wp-testcase/test_http.php</a></li>
<li><a href="#wptestcasetest_imagephp">wp-testcase/test_image.php</a></li>
<li><a href="#wptestcasetest_import_wpphp">wp-testcase/test_import_wp.php</a></li>
<li><a href="#wptestcasetest_includes_canonicalphp">wp-testcase/test_includes_canonical.php</a></li>
<li><a href="#wptestcasetest_includes_classwpdependenciesphp">wp-testcase/test_includes_class-wp-dependencies.php</a></li>
<li><a href="#wptestcasetest_includes_compatphp">wp-testcase/test_includes_compat.php</a></li>
<li><a href="#wptestcasetest_includes_filephp">wp-testcase/test_includes_file.php</a></li>
<li><a href="#wptestcasetest_includes_formattingphp">wp-testcase/test_includes_formatting.php</a></li>
<li><a href="#wptestcasetest_includes_metaphp">wp-testcase/test_includes_meta.php</a></li>
<li><a href="#wptestcasetest_includes_pluggablephp">wp-testcase/test_includes_pluggable.php</a></li>
<li><a href="#wptestcasetest_includes_postphp">wp-testcase/test_includes_post.php</a></li>
<li><a href="#wptestcasetest_includes_taxonomyphp">wp-testcase/test_includes_taxonomy.php</a></li>
<li><a href="#wptestcasetest_includes_wpscriptsphp">wp-testcase/test_includes_wp-scripts.php</a></li>
<li><a href="#wptestcasetest_metaphp">wp-testcase/test_meta.php</a></li>
<li><a href="#wptestcasetest_post_filteringphp">wp-testcase/test_post_filtering.php</a></li>
<li><a href="#wptestcasetest_post_outputphp">wp-testcase/test_post_output.php</a></li>
<li><a href="#wptestcasetest_queryphp">wp-testcase/test_query.php</a></li>
<li><a href="#wptestcasetest_uploadsphp">wp-testcase/test_uploads.php</a></li>
<li><a href="#wptestcasetest_userphp">wp-testcase/test_user.php</a></li>
<li><a href="#wptestcasetest_user_capabilitiesphp">wp-testcase/test_user_capabilities.php</a></li>
<li><a href="#wptestlibbasephp">wp-testlib/base.php</a></li>
<li><a href="#wptestlibgetoptphp">wp-testlib/getopt.php</a></li>
<li><a href="#wptestlibwpprofilerphp">wp-testlib/wp-profiler.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="wpconfigsamplephp"></a>
<div class="modfile"><h4>Modified: wp-config-sample.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-config-sample.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-config-sample.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -1,29 +1,29 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> // ** MySQL settings ** //
</span><del>-
</del><ins>+
</ins><span class="cx"> // these will be used by the copy of wordpress being tested.
</span><span class="cx"> // wordpress/wp-config.php will be ignored.
</span><del>-
</del><ins>+
</ins><span class="cx"> // WARNING WARNING WARNING!
</span><span class="cx"> // wp-test will DROP ALL TABLES in the database named below.
</span><span class="cx"> // DO NOT use a production database or one that is shared with something else.
</span><del>-
</del><ins>+
</ins><span class="cx"> define('DB_NAME', 'putyourdbnamehere');    // The name of the database
</span><span class="cx"> define('DB_USER', 'usernamehere');     // Your MySQL username
</span><span class="cx"> define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
</span><span class="cx"> define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
</span><span class="cx"> define('DB_CHARSET', 'utf8');
</span><span class="cx"> define('DB_COLLATE', '');
</span><del>-
</del><ins>+
</ins><span class="cx"> // You can have multiple installations in one database if you give each a unique prefix
</span><span class="cx"> $table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
</span><del>-
</del><ins>+
</ins><span class="cx"> // Change this to localize WordPress.  A corresponding MO file for the
</span><span class="cx"> // chosen language must be installed to wp-content/languages.
</span><span class="cx"> // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
</span><span class="cx"> // to enable German language support.
</span><span class="cx"> define ('WPLANG', '');
</span><del>-
</del><ins>+
</ins><span class="cx"> // uncomment and change this if you'd like to load plugins from a particular directory prior to testing
</span><span class="cx"> #define('DIR_TESTPLUGINS', './wp-plugins');
</span><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="wpmailrealtestphp"></a>
<div class="modfile"><h4>Modified: wp-mail-real-test.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-mail-real-test.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-mail-real-test.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> /**
</span><span class="cx">  * wp-mail-real-test.php
</span><del>- * 
</del><ins>+ *
</ins><span class="cx">  * Test script for wp_mail with real addresses.
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx"> $options = 'v:r:d';
</span><span class="cx"> if (is_callable('getopt')) {
</span><span class="cx">         $opts = getopt($options);
</span><del>-} else {        
</del><ins>+} else {
</ins><span class="cx">         include( dirname(__FILE__) . '/wp-testlib/getopt.php' );
</span><span class="cx">         $opts = getoptParser::getopt($options);
</span><span class="cx"> }
</span></span></pre></div>
<a id="wptestphp"></a>
<div class="modfile"><h4>Modified: wp-test.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-test.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-test.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -1,20 +1,20 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> /**
</span><span class="cx">  * wp-test.php
</span><del>- * 
</del><ins>+ *
</ins><span class="cx">  * WordPress Testrunner
</span><del>- * 
</del><ins>+ *
</ins><span class="cx">  * Example:
</span><del>- * 
</del><ins>+ *
</ins><span class="cx">  * # php wp-test.php -l
</span><del>- * 
</del><ins>+ *
</ins><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> // parse options
</span><span class="cx"> $options = 'v:t:r:sflndq';
</span><span class="cx"> if (is_callable('getopt')) {
</span><span class="cx">         $opts = getopt($options);
</span><del>-} else {        
</del><ins>+} else {
</ins><span class="cx">         include( dirname(__FILE__) . '/wp-testlib/getopt.php' );
</span><span class="cx">         $opts = getoptParser::getopt($options);
</span><span class="cx"> }
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">         wptest_listall_testcases($classes);
</span><span class="cx"> } else {
</span><span class="cx">         do_action('test_start');
</span><del>-        
</del><ins>+
</ins><span class="cx">         // hide warnings during testing, since that's the normal WP behaviour
</span><span class="cx">         if ( !WP_DEBUG ) {
</span><span class="cx">                 error_reporting(E_ALL ^ E_NOTICE);
</span></span></pre></div>
<a id="wptestcasetest_actionsphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_actions.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_actions.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_actions.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -1,48 +1,48 @@
</span><span class="cx"> &lt;?php
</span><del>-
</del><ins>+
</ins><span class="cx"> // test do_action and related functions
</span><del>-
</del><ins>+
</ins><span class="cx"> class WPTestActions extends WPTestCase {
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_simple_action() {
</span><span class="cx">                 $a = new MockAction();
</span><span class="cx">                 $tag = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 add_action($tag, array(&amp;$a, 'action'));
</span><span class="cx">                 do_action($tag);
</span><del>-
</del><ins>+
</ins><span class="cx">                 // only one event occurred for the hook, with empty args
</span><span class="cx">                 $this-&gt;assertEquals(1, $a-&gt;get_call_count());
</span><span class="cx">                 // only our hook was called
</span><span class="cx">                 $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
</span><del>-
</del><ins>+
</ins><span class="cx">                 $args = array_pop($a-&gt;get_args());
</span><span class="cx">                 $this-&gt;assertEquals(array(''), $args);
</span><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_remove_action() {
</span><span class="cx">                 $a = new MockAction();
</span><span class="cx">                 $tag = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 add_action($tag, array(&amp;$a, 'action'));
</span><span class="cx">                 do_action($tag);
</span><del>-
</del><ins>+
</ins><span class="cx">                 // make sure our hook was called correctly
</span><span class="cx">                 $this-&gt;assertEquals(1, $a-&gt;get_call_count());
</span><span class="cx">                 $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
</span><del>-
</del><ins>+
</ins><span class="cx">                 // now remove the action, do it again, and make sure it's not called this time
</span><span class="cx">                 remove_action($tag, array(&amp;$a, 'action'));
</span><span class="cx">                 do_action($tag);
</span><span class="cx">                 $this-&gt;assertEquals(1, $a-&gt;get_call_count());
</span><span class="cx">                 $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
</span><del>-
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_has_action() {
</span><span class="cx">                         $tag = rand_str();
</span><span class="cx">                         $func = rand_str();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $this-&gt;assertFalse( has_action($tag, $func) );
</span><span class="cx">                         $this-&gt;assertFalse( has_action($tag) );
</span><span class="cx">                         add_action($tag, $func);
</span><span class="lines">@@ -52,70 +52,70 @@
</span><span class="cx">                         $this-&gt;assertFalse( has_action($tag, $func) );
</span><span class="cx">                         $this-&gt;assertFalse( has_action($tag) );
</span><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         // one tag with multiple actions
</span><span class="cx">         function test_multiple_actions() {
</span><span class="cx">                 $a1 = new MockAction();
</span><span class="cx">                 $a2 = new MockAction();
</span><span class="cx">                 $tag = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 // add both actions to the hook
</span><span class="cx">                 add_action($tag, array(&amp;$a1, 'action'));
</span><span class="cx">                 add_action($tag, array(&amp;$a2, 'action'));
</span><del>-
</del><ins>+
</ins><span class="cx">                 do_action($tag);
</span><del>-
</del><ins>+
</ins><span class="cx">                 // both actions called once each
</span><span class="cx">                 $this-&gt;assertEquals(1, $a1-&gt;get_call_count());
</span><span class="cx">                 $this-&gt;assertEquals(1, $a2-&gt;get_call_count());
</span><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_action_args_1() {
</span><span class="cx">                 $a = new MockAction();
</span><span class="cx">                 $tag = rand_str();
</span><span class="cx">                 $val = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 add_action($tag, array(&amp;$a, 'action'));
</span><span class="cx">                 // call the action with a single argument
</span><span class="cx">                 do_action($tag, $val);
</span><del>-
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(1, $a-&gt;get_call_count());
</span><span class="cx">                 $this-&gt;assertEquals(array($val), array_pop($a-&gt;get_args()));
</span><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_action_args_2() {
</span><span class="cx">                 $a1 = new MockAction();
</span><span class="cx">                 $a2 = new MockAction();
</span><span class="cx">                 $tag = rand_str();
</span><span class="cx">                 $val1 = rand_str();
</span><span class="cx">                 $val2 = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 // a1 accepts two arguments, a2 doesn't
</span><span class="cx">                 add_action($tag, array(&amp;$a1, 'action'), 10, 2);
</span><span class="cx">                 add_action($tag, array(&amp;$a2, 'action'));
</span><span class="cx">                 // call the action with two arguments
</span><span class="cx">                 do_action($tag, $val1, $val2);
</span><del>-
</del><ins>+
</ins><span class="cx">                 // a1 should be called with both args
</span><span class="cx">                 $this-&gt;assertEquals(1, $a1-&gt;get_call_count());
</span><span class="cx">                 $this-&gt;assertEquals(array($val1, $val2), array_pop($a1-&gt;get_args()));
</span><del>-
</del><ins>+
</ins><span class="cx">                 // a2 should be called with one only
</span><span class="cx">                 $this-&gt;assertEquals(1, $a2-&gt;get_call_count());
</span><span class="cx">                 $this-&gt;assertEquals(array($val1), array_pop($a2-&gt;get_args()));
</span><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_action_priority() {
</span><span class="cx">                 $a = new MockAction();
</span><span class="cx">                 $tag = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 add_action($tag, array(&amp;$a, 'action'), 10);
</span><span class="cx">                 add_action($tag, array(&amp;$a, 'action2'), 9);
</span><span class="cx">                 do_action($tag);
</span><del>-
</del><ins>+
</ins><span class="cx">                 // two events, one per action
</span><span class="cx">                 $this-&gt;assertEquals(2, $a-&gt;get_call_count());
</span><del>-
</del><ins>+
</ins><span class="cx">                 $expected = array (
</span><span class="cx">                         // action2 is called first because it has priority 9
</span><span class="cx">                         array (
</span><span class="lines">@@ -130,35 +130,35 @@
</span><span class="cx">                                 'args' =&gt; array('')
</span><span class="cx">                         ),
</span><span class="cx">                 );
</span><del>-
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals($expected, $a-&gt;get_events());
</span><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_did_action() {
</span><span class="cx">                 $tag1 = rand_str();
</span><span class="cx">                 $tag2 = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 // do action tag1 but not tag2
</span><span class="cx">                 do_action($tag1);
</span><span class="cx">                 $this-&gt;assertEquals(1, did_action($tag1));
</span><span class="cx">                 $this-&gt;assertEquals(0, did_action($tag2));
</span><del>-
</del><ins>+
</ins><span class="cx">                 // do action tag2 a random number of times
</span><span class="cx">                 $count = rand(0, 10);
</span><span class="cx">                 for ($i=0; $i&lt;$count; $i++)
</span><span class="cx">                         do_action($tag2);
</span><del>-
</del><ins>+
</ins><span class="cx">                 // tag1's count hasn't changed, tag2 should be correct
</span><span class="cx">                 $this-&gt;assertEquals(1, did_action($tag1));
</span><span class="cx">                 $this-&gt;assertEquals($count, did_action($tag2));
</span><del>-
</del><ins>+
</ins><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_all_action() {
</span><span class="cx">                 $a = new MockAction();
</span><span class="cx">                 $tag1 = rand_str();
</span><span class="cx">                 $tag2 = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 // add an 'all' action
</span><span class="cx">                 add_action('all', array(&amp;$a, 'action'));
</span><span class="cx">                 $this-&gt;assertEquals(10, has_filter('all', array(&amp;$a, 'action')));
</span><span class="lines">@@ -167,29 +167,29 @@
</span><span class="cx">                 do_action($tag2);
</span><span class="cx">                 do_action($tag1);
</span><span class="cx">                 do_action($tag1);
</span><del>-
</del><ins>+
</ins><span class="cx">                 // our action should have been called once for each tag
</span><span class="cx">                 $this-&gt;assertEquals(4, $a-&gt;get_call_count());
</span><span class="cx">                 // only our hook was called
</span><span class="cx">                 $this-&gt;assertEquals(array($tag1, $tag2, $tag1, $tag1), $a-&gt;get_tags());
</span><del>-
</del><ins>+
</ins><span class="cx">                 remove_action('all', array(&amp;$a, 'action'));
</span><span class="cx">                 $this-&gt;assertFalse(has_filter('all', array(&amp;$a, 'action')));
</span><del>-
</del><ins>+
</ins><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_remove_all_action() {
</span><span class="cx">                 $a = new MockAction();
</span><span class="cx">                 $tag = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 add_action('all', array(&amp;$a, 'action'));
</span><span class="cx">                 $this-&gt;assertEquals(10, has_filter('all', array(&amp;$a, 'action')));
</span><span class="cx">                 do_action($tag);
</span><del>-
</del><ins>+
</ins><span class="cx">                 // make sure our hook was called correctly
</span><span class="cx">                 $this-&gt;assertEquals(1, $a-&gt;get_call_count());
</span><span class="cx">                 $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
</span><del>-
</del><ins>+
</ins><span class="cx">                 // now remove the action, do it again, and make sure it's not called this time
</span><span class="cx">                 remove_action('all', array(&amp;$a, 'action'));
</span><span class="cx">                 $this-&gt;assertFalse(has_filter('all', array(&amp;$a, 'action')));
</span><span class="lines">@@ -197,17 +197,17 @@
</span><span class="cx">                 $this-&gt;assertEquals(1, $a-&gt;get_call_count());
</span><span class="cx">                 $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
</span><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_action_performance() {
</span><span class="cx">                 $a = new MockAction();
</span><span class="cx">                 $tags = array(rand_str(), rand_str(), rand_str(), rand_str(), rand_str());
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // two actions per tag
</span><span class="cx">                 foreach ($tags as $tag) {
</span><span class="cx">                         add_action($tag, array(&amp;$a, 'action'));
</span><span class="cx">                         add_action($tag, array(&amp;$a, 'action2'));
</span><span class="cx">                 }
</span><del>-
</del><ins>+
</ins><span class="cx">                 $delta = 0.0;
</span><span class="cx">                 $count = 0;
</span><span class="cx">                 for ($i=0; $i&lt;100; $i++) {
</span><span class="lines">@@ -218,75 +218,75 @@
</span><span class="cx">                                 ++$count;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-
</del><ins>+
</ins><span class="cx">                 printf(&quot;Action Time: %0.8f (%0.8f each)\n&quot;, $delta, $delta/$count);
</span><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_action_ref_array() {
</span><span class="cx">                 $obj = new stdClass();
</span><span class="cx">                 $a = new MockAction();
</span><span class="cx">                 $tag = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 add_action($tag, array(&amp;$a, 'action'));
</span><del>-
</del><ins>+
</ins><span class="cx">                 do_action_ref_array($tag, array(&amp;$obj));
</span><del>-
</del><ins>+
</ins><span class="cx">                 $args = $a-&gt;get_args();
</span><span class="cx">                 $this-&gt;assertSame($args[0][0], $obj);
</span><span class="cx">                 // just in case we don't trust assertSame
</span><span class="cx">                 $obj-&gt;foo = true;
</span><span class="cx">                 $this-&gt;assertFalse( empty($args[0][0]-&gt;foo) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_action_keyed_array() {
</span><span class="cx">                 $this-&gt;knownWPBug(11241);
</span><span class="cx">                 $a = new MockAction();
</span><del>-
</del><ins>+
</ins><span class="cx">                 $tag = rand_str();
</span><del>-
</del><ins>+
</ins><span class="cx">                 add_action($tag, array(&amp;$a, 'action'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $context = array( rand_str() =&gt; rand_str() );
</span><span class="cx">                 do_action($tag, $context);
</span><del>-
</del><ins>+
</ins><span class="cx">                 $args = $a-&gt;get_args();
</span><span class="cx">                 $this-&gt;assertSame($args[0][0], $context);
</span><del>-
</del><ins>+
</ins><span class="cx">                 $context2 = array( rand_str() =&gt; rand_str(), rand_str() =&gt; rand_str() );
</span><span class="cx">                 do_action($tag, $context2);
</span><del>-
</del><ins>+
</ins><span class="cx">                 $args = $a-&gt;get_args();
</span><span class="cx">                 $this-&gt;assertSame($args[1][0], $context2);
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         function test_action_closure() {
</span><span class="cx">                 $this-&gt;checkAtLeastPHPVersion('5.3');
</span><span class="cx">                 $this-&gt;knownWPBug(10493);
</span><del>-
</del><ins>+
</ins><span class="cx">                 $tag = rand_str();
</span><span class="cx">                 $closure = function($a, $b) { $GLOBALS[$a] = $b;};
</span><span class="cx">                 add_action($tag, $closure, 10, 2);
</span><del>-
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertSame( 10, has_action($tag, $closure) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $context = array( rand_str(), rand_str() );
</span><span class="cx">                 do_action($tag, $context[0], $context[1]);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertSame($GLOBALS[$context[0]], $context[1]);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $tag2 = rand_str();
</span><span class="cx">                 $closure2 = function() { $GLOBALS['closure_no_args'] = true;};
</span><span class="cx">                 add_action($tag2, $closure2);
</span><del>-
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertSame( 10, has_action($tag2, $closure2) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 do_action($tag2);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue($GLOBALS['closure_no_args']);
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="wptestcasetest_admin_includes_templatephp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_admin_includes_template.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_admin_includes_template.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_admin_includes_template.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -3,42 +3,42 @@
</span><span class="cx">         function test_equal() {
</span><span class="cx">                 $this-&gt;assertEquals(' selected=\'selected\'', selected('foo','foo',false));
</span><span class="cx">                 $this-&gt;assertEquals(' checked=\'checked\'', checked('foo','foo',false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(' selected=\'selected\'', selected('1',1,false));
</span><span class="cx">                 $this-&gt;assertEquals(' checked=\'checked\'', checked('1',1,false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(' selected=\'selected\'', selected('1',true,false));
</span><span class="cx">                 $this-&gt;assertEquals(' checked=\'checked\'', checked('1',true,false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(' selected=\'selected\'', selected(1,1,false));
</span><span class="cx">                 $this-&gt;assertEquals(' checked=\'checked\'', checked(1,1,false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(' selected=\'selected\'', selected(1,true,false));
</span><span class="cx">                 $this-&gt;assertEquals(' checked=\'checked\'', checked(1,true,false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(' selected=\'selected\'', selected(true,true,false));
</span><span class="cx">                 $this-&gt;assertEquals(' checked=\'checked\'', checked(true,true,false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(' selected=\'selected\'', selected('0',0,false));
</span><span class="cx">                 $this-&gt;assertEquals(' checked=\'checked\'', checked('0',0,false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(' selected=\'selected\'', selected(0,0,false));
</span><span class="cx">                 $this-&gt;assertEquals(' checked=\'checked\'', checked(0,0,false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(' selected=\'selected\'', selected('',false,false));
</span><span class="cx">                 $this-&gt;assertEquals(' checked=\'checked\'', checked('',false,false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(' selected=\'selected\'', selected(false,false,false));
</span><span class="cx">                 $this-&gt;assertEquals(' checked=\'checked\'', checked(false,false,false));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_notequal() {
</span><span class="cx">                 $this-&gt;assertEquals('', selected('0','',false));
</span><span class="cx">                 $this-&gt;assertEquals('', checked('0','',false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals('', selected(0,'',false));
</span><span class="cx">                 $this-&gt;assertEquals('', checked(0,'',false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals('', selected(0,false,false));
</span><span class="cx">                 $this-&gt;assertEquals('', checked(0,false,false));
</span><span class="cx">         }
</span></span></pre></div>
<a id="wptestcasetest_cronphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_cron.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_cron.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_cron.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx">                 // make sure the schedule is clear
</span><span class="cx">                 _set_cron_array(array());
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_wp_get_schedule_empty() {
</span><span class="cx">                 // nothing scheduled
</span><span class="cx">                 $hook = rand_str();
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx">                 $args = array(rand_str());
</span><span class="cx">                 $multi_hook = rand_str();
</span><span class="cx">                 $multi_args = array(rand_str(), rand_str());
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // schedule several events with and without arguments
</span><span class="cx">                 wp_schedule_single_event( strtotime('+1 hour'), $hook );
</span><span class="cx">                 wp_schedule_single_event( strtotime('+2 hour'), $hook );
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx">                 wp_schedule_single_event( strtotime('+4 hour'), $hook, $args );
</span><span class="cx">                 wp_schedule_single_event( strtotime('+5 hour'), $multi_hook, $multi_args );
</span><span class="cx">                 wp_schedule_single_event( strtotime('+6 hour'), $multi_hook, $multi_args );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make sure they're returned by wp_next_scheduled()
</span><span class="cx">                 $this-&gt;assertTrue( wp_next_scheduled($hook) &gt; 0 );
</span><span class="cx">                 $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
</span><span class="lines">@@ -180,7 +180,7 @@
</span><span class="cx">                 // wp_clear_scheduled_hook() should take args as an array like the other functions and does from WP 3.0
</span><span class="cx">                 wp_clear_scheduled_hook($multi_hook, $multi_args);
</span><span class="cx">                 $this-&gt;assertFalse( wp_next_scheduled($multi_hook, $multi_args) );
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function test_duplicate_event() {
</span><span class="lines">@@ -190,12 +190,12 @@
</span><span class="cx">                 $args = array(rand_str());
</span><span class="cx">                 $ts1 = strtotime('+5 minutes');
</span><span class="cx">                 $ts2 = strtotime('+3 minutes');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // first one works
</span><span class="cx">                 wp_schedule_single_event( $ts1, $hook, $args );
</span><span class="cx">                 // second one is ignored
</span><span class="cx">                 wp_schedule_single_event( $ts2, $hook, $args );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // the next event should be at +5 minutes, not +3
</span><span class="cx">                 $this-&gt;assertEquals( $ts1, wp_next_scheduled($hook, $args) );
</span><span class="cx">         }
</span><span class="lines">@@ -207,12 +207,12 @@
</span><span class="cx">                 $args = array(rand_str());
</span><span class="cx">                 $ts1 = strtotime('+30 minutes');
</span><span class="cx">                 $ts2 = strtotime('+3 minutes');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // first one works
</span><span class="cx">                 wp_schedule_single_event( $ts1, $hook, $args );
</span><span class="cx">                 // second works too
</span><span class="cx">                 wp_schedule_single_event( $ts2, $hook, $args );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // the next event should be at +5 minutes, not +3
</span><span class="cx">                 $this-&gt;assertEquals( $ts2, wp_next_scheduled($hook, $args) );
</span><span class="cx">                 wp_unschedule_event( $ts2, $hook, $args );
</span><span class="lines">@@ -224,7 +224,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Disable the WP Cron running test for the moment as it kills the whole test suite.
</span><span class="cx">  * TODO - Fix it to work with the new cron implementation in trunk
</span><del>- * 
</del><ins>+ *
</ins><span class="cx"> class WPTestCronRunning extends _WPEmptyBlog {
</span><span class="cx">         function setUp() {
</span><span class="cx">                 parent::setUp();
</span><span class="lines">@@ -263,12 +263,12 @@
</span><span class="cx">                 // our action should have been called once with the correct args
</span><span class="cx">                 $this-&gt;assertEquals( 1, $a-&gt;get_call_count() );
</span><span class="cx">                 $this-&gt;assertEquals( array($args), $a-&gt;get_args() );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // it shouldn't appear in the schedule anymore
</span><span class="cx">                 $this-&gt;assertFalse( wp_next_scheduled($hook, $args) );
</span><span class="cx"> 
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_run_schedule_recurring() {
</span><span class="cx">                 // schedule a recurring event, run it, and make sure the hook is called
</span><span class="cx">                 $hook = rand_str();
</span><span class="lines">@@ -291,7 +291,7 @@
</span><span class="cx">                 // our action should have been called once with the correct args
</span><span class="cx">                 $this-&gt;assertEquals( 1, $a-&gt;get_call_count() );
</span><span class="cx">                 $this-&gt;assertEquals( array($args), $a-&gt;get_args() );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // it should appear in the schedule to run again in an hour's time
</span><span class="cx">                 $this-&gt;assertEquals( $timestamp + 3600, wp_next_scheduled($hook, $args) );
</span><span class="cx"> 
</span></span></pre></div>
<a id="wptestcasetest_filtersphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_filters.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_filters.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_filters.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -40,11 +40,11 @@
</span><span class="cx">                 $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
</span><span class="cx"> 
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_has_filter() {
</span><span class="cx">                         $tag = rand_str();
</span><span class="cx">                         $func = rand_str();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $this-&gt;assertFalse( has_filter($tag, $func) );
</span><span class="cx">                         $this-&gt;assertFalse( has_filter($tag) );
</span><span class="cx">                         add_filter($tag, $func);
</span><span class="lines">@@ -215,11 +215,11 @@
</span><span class="cx"> 
</span><span class="cx">                 add_action($tag, array(&amp;$a, 'filter_append'), 10, 2);
</span><span class="cx">                 add_action($tag, array(&amp;$b, 'filter_append'), 10, 2);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $result = apply_filters_ref_array($tag, array('string', &amp;$obj));
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;assertEquals($result, 'string_append_append');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $args = $a-&gt;get_args();
</span><span class="cx">                 $this-&gt;assertSame($args[0][1], $obj);
</span><span class="cx">                 // just in case we don't trust assertSame
</span><span class="lines">@@ -231,7 +231,7 @@
</span><span class="cx">                 // just in case we don't trust assertSame
</span><span class="cx">                 $obj-&gt;foo = true;
</span><span class="cx">                 $this-&gt;assertFalse( empty($args[0][1]-&gt;foo) );
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="wptestcasetest_httpphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_http.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_http.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_http.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -31,18 +31,18 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        function test_redirect_on_301() {        
</del><ins>+        function test_redirect_on_301() {
</ins><span class="cx">                 // 5 : 5 &amp; 301
</span><span class="cx">                 $res = wp_remote_request($this-&gt;redirection_script . '?code=301&amp;rt=' . 5, array('redirection' =&gt; 5) );
</span><span class="cx">                 $this-&gt;assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        function test_redirect_on_302() {        
</del><ins>+        function test_redirect_on_302() {
</ins><span class="cx">                 // 5 : 5 &amp; 302
</span><span class="cx">                 $res = wp_remote_request($this-&gt;redirection_script . '?code=302&amp;rt=' . 5, array('redirection' =&gt; 5) );
</span><span class="cx">                 $this-&gt;assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_redirect_on_301_no_redirect() {
</span><span class="cx">                 $this-&gt;knownWPBug(16855);
</span><span class="cx">                 // 5 &gt; 0 &amp; 301
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">                 $this-&gt;assertEquals(302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        function test_redirections_equal() {        
</del><ins>+        function test_redirections_equal() {
</ins><span class="cx">                 // 5 - 5
</span><span class="cx">                 $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 5, array('redirection' =&gt; 5) );
</span><span class="cx">                 $this-&gt;assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
</span><span class="lines">@@ -98,18 +98,18 @@
</span><span class="cx">                 $this-&gt;knownWPBug(16855);
</span><span class="cx">                 // 0 redirections asked for, Should return the document?
</span><span class="cx">                 $res = wp_remote_request($this-&gt;redirection_script . '?code=302&amp;rt=' . 5, array('redirection' =&gt; 0) );
</span><del>-                $this-&gt;assertEquals( 302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );                
</del><ins>+                $this-&gt;assertEquals( 302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_location_header_on_200() {
</span><span class="cx">                 //$this-&gt;knownWPBug(16889);
</span><span class="cx">                 // Is this valid? Streams, cURL and therefor, PHP Extension (ie. all PHP Internal) follow redirects on all status codes, currently all of WP_HTTP follows this template.
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Do not redirect on non 3xx status codes
</span><span class="cx">                 //$res = wp_remote_request( $this-&gt;redirection_script . '?200-location=true' ); // Prints PASS on initial load, FAIL if the client follows the specified redirection
</span><span class="cx">                 //$this-&gt;assertEquals( 'PASS', $res['body']);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_send_headers() {
</span><span class="cx">                 $this-&gt;knownWPBug(11888);
</span><span class="cx">                 // Test that the headers sent are recieved by the server
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">                 // Should it be that empty headers with empty values are NOT sent?
</span><span class="cx">                 //$this-&gt;assertTrue( isset($headers['test3']) &amp;&amp; '' === $headers['test3'] );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_file_stream() {
</span><span class="cx">                 $url = 'http://unit-tests.svn.wordpress.org/wp-testdata/images/2004-07-22-DSC_0007.jpg'; // we'll test against a file in the unit test data
</span><span class="cx">                 $size = 87348;
</span></span></pre></div>
<a id="wptestcasetest_imagephp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_image.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_image.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_image.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -79,13 +79,13 @@
</span><span class="cx">                 $this-&gt;assertEquals('', $out['title']);
</span><span class="cx"> 
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_exif_error() {
</span><span class="cx">                 if (!is_callable('wp_read_image_metadata'))
</span><span class="cx">                         $this-&gt;markTestSkipped();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 $this-&gt;knownWPBug(6571);
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 // http://trac.wordpress.org/ticket/6571
</span><span class="cx">                 // this triggers a warning mesage when reading the exif block
</span><span class="cx">                 $out = wp_read_image_metadata(DIR_TESTDATA.'/images/waffles.jpg');
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">         function test_exif_no_data() {
</span><span class="cx">                 if (!is_callable('wp_read_image_metadata'))
</span><span class="cx">                         $this-&gt;markTestSkipped();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 // no exif data in this image (from burningwell.org)
</span><span class="cx">                 $out = wp_read_image_metadata(DIR_TESTDATA.'/images/canola.jpg');
</span><span class="cx"> 
</span><span class="lines">@@ -120,29 +120,29 @@
</span><span class="cx">                 $this-&gt;assertEquals(0, $out['shutter_speed']);
</span><span class="cx">                 $this-&gt;assertEquals('', $out['title']);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class TestImageSizeFunctions extends WpTestCase {
</span><span class="cx">         function test_constrain_dims_zero() {
</span><span class="cx">                 if (!is_callable('wp_constrain_dimensions'))
</span><span class="cx">                         $this-&gt;markTestSkipped();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 // no constraint - should have no effect
</span><span class="cx">                 $out = wp_constrain_dimensions(640, 480, 0, 0);
</span><span class="cx">                 $this-&gt;assertEquals(array(640, 480), $out);
</span><span class="cx"> 
</span><span class="cx">                 $out = wp_constrain_dimensions(640, 480);
</span><span class="cx">                 $this-&gt;assertEquals(array(640, 480), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = wp_constrain_dimensions(0, 0, 0, 0);
</span><span class="cx">                 $this-&gt;assertEquals(array(0, 0), $out);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_constrain_dims_smaller() {
</span><span class="cx">                 if (!is_callable('wp_constrain_dimensions'))
</span><span class="cx">                         $this-&gt;markTestSkipped();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 // image size is smaller than the constraint - no effect
</span><span class="cx">                 $out = wp_constrain_dimensions(500, 600, 1024, 768);
</span><span class="cx">                 $this-&gt;assertEquals(array(500, 600), $out);
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">         function test_constrain_dims_equal() {
</span><span class="cx">                 if (!is_callable('wp_constrain_dimensions'))
</span><span class="cx">                         $this-&gt;markTestSkipped();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 // image size is equal to the constraint - no effect
</span><span class="cx">                 $out = wp_constrain_dimensions(1024, 768, 1024, 768);
</span><span class="cx">                 $this-&gt;assertequals(array(1024, 768), $out);
</span><span class="lines">@@ -168,11 +168,11 @@
</span><span class="cx">                 $out = wp_constrain_dimensions(1024, 768, 1024, 0);
</span><span class="cx">                 $this-&gt;assertequals(array(1024, 768), $out);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_constrain_dims_larger() {
</span><span class="cx">                 if (!is_callable('wp_constrain_dimensions'))
</span><span class="cx">                         $this-&gt;markTestSkipped();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 // image size is larger than the constraint - result should be constrained
</span><span class="cx">                 $out = wp_constrain_dimensions(1024, 768, 500, 600);
</span><span class="cx">                 $this-&gt;assertequals(array(500, 375), $out);
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx"> 
</span><span class="cx">                 $out = wp_constrain_dimensions(1024, 768, 500, 0);
</span><span class="cx">                 $this-&gt;assertequals(array(500, 375), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // also try a portrait oriented image
</span><span class="cx">                 $out = wp_constrain_dimensions(300, 800, 500, 600);
</span><span class="cx">                 $this-&gt;assertequals(array(225, 600), $out);
</span><span class="lines">@@ -197,22 +197,22 @@
</span><span class="cx">         function test_constrain_dims_boundary() {
</span><span class="cx">                 if (!is_callable('wp_constrain_dimensions'))
</span><span class="cx">                         $this-&gt;markTestSkipped();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 // one dimension is larger than the constraint, one smaller - result should be constrained
</span><span class="cx">                 $out = wp_constrain_dimensions(1024, 768, 500, 800);
</span><span class="cx">                 $this-&gt;assertequals(array(500, 375), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = wp_constrain_dimensions(1024, 768, 2000, 700);
</span><span class="cx">                 $this-&gt;assertequals(array(933, 700), $out);
</span><span class="cx"> 
</span><span class="cx">                 // portrait
</span><span class="cx">                 $out = wp_constrain_dimensions(768, 1024, 800, 500);
</span><span class="cx">                 $this-&gt;assertequals(array(375, 500), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = wp_constrain_dimensions(768, 1024, 2000, 700);
</span><span class="cx">                 $this-&gt;assertequals(array(525, 700), $out);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_shrink_dimensions_default() {
</span><span class="cx">                 $out = wp_shrink_dimensions(640, 480);
</span><span class="cx">                 $this-&gt;assertEquals(array(128, 96), $out);
</span><span class="lines">@@ -252,22 +252,22 @@
</span><span class="cx">                 // one dimension is larger than the constraint, one smaller - result should be constrained
</span><span class="cx">                 $out = wp_shrink_dimensions(1024, 768, 500, 800);
</span><span class="cx">                 $this-&gt;assertequals(array(500, 375), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = wp_shrink_dimensions(1024, 768, 2000, 700);
</span><span class="cx">                 $this-&gt;assertequals(array(933, 700), $out);
</span><span class="cx"> 
</span><span class="cx">                 // portrait
</span><span class="cx">                 $out = wp_shrink_dimensions(768, 1024, 800, 500);
</span><span class="cx">                 $this-&gt;assertequals(array(375, 500), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = wp_shrink_dimensions(768, 1024, 2000, 700);
</span><span class="cx">                 $this-&gt;assertequals(array(525, 700), $out);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_constrain_size_for_editor_thumb() {
</span><span class="cx">                 $out = image_constrain_size_for_editor(600, 400, 'thumb');
</span><span class="cx">                 $this-&gt;assertEquals(array(150, 100), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = image_constrain_size_for_editor(64, 64, 'thumb');
</span><span class="cx">                 $this-&gt;assertEquals(array(64, 64), $out);
</span><span class="cx">         }
</span><span class="lines">@@ -278,16 +278,16 @@
</span><span class="cx">                 $content_width = 0;
</span><span class="cx">                 update_option('medium_size_w', 500);
</span><span class="cx">                 update_option('medium_size_h', 0);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = image_constrain_size_for_editor(600, 400, 'medium');
</span><span class="cx">                 $this-&gt;assertEquals(array(500, 333), $out);
</span><span class="cx"> 
</span><span class="cx">                 $out = image_constrain_size_for_editor(400, 600, 'medium');
</span><span class="cx">                 $this-&gt;assertEquals(array(400, 600), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = image_constrain_size_for_editor(64, 64, 'medium');
</span><span class="cx">                 $this-&gt;assertEquals(array(64, 64), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // content_width should be ignored
</span><span class="cx">                 $content_width = 350;
</span><span class="cx">                 $out = image_constrain_size_for_editor(600, 400, 'medium');
</span><span class="lines">@@ -299,20 +299,24 @@
</span><span class="cx">                 $content_width = 400;
</span><span class="cx">                 $out = image_constrain_size_for_editor(600, 400, 'full');
</span><span class="cx">                 $this-&gt;assertEquals(array(600, 400), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = image_constrain_size_for_editor(64, 64, 'full');
</span><span class="cx">                 $this-&gt;assertEquals(array(64, 64), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // content_width default is 500
</span><span class="cx">                 $content_width = 0;
</span><span class="cx"> 
</span><span class="cx">                 $out = image_constrain_size_for_editor(600, 400, 'full');
</span><span class="cx">                 $this-&gt;assertEquals(array(600, 400), $out);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = image_constrain_size_for_editor(64, 64, 'full');
</span><span class="cx">                 $this-&gt;assertEquals(array(64, 64), $out);
</span><ins>+&lt;&lt;&lt;&lt;&lt;&lt;&lt; .mine
+
+=======
+&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r406
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class TestImageResizeDimensions extends WPTestCase {
</span><span class="lines">@@ -327,7 +331,7 @@
</span><span class="cx">                 // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
</span><span class="cx">                 $this-&gt;assertEquals( array(0, 0, 0, 0, 300, 400, 480, 640), $out );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_400x0_no_crop() {
</span><span class="cx">                 // landscape: resize 640x480 to fit 400w: 400x300
</span><span class="cx">                 $out = image_resize_dimensions(640, 480, 400, 0, false);
</span><span class="lines">@@ -401,7 +405,7 @@
</span><span class="cx">                 // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
</span><span class="cx">                 $this-&gt;assertEquals( array(0, 0, 0, 80, 400, 400, 480, 480), $out );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_400x0_crop() {
</span><span class="cx">                 // landscape: resize 640x480 to fit 400w: 400x300
</span><span class="cx">                 $out = image_resize_dimensions(640, 480, 400, 0, true);
</span><span class="lines">@@ -425,7 +429,7 @@
</span><span class="cx">                 // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
</span><span class="cx">                 $this-&gt;assertEquals( array(0, 0, 0, 0, 300, 400, 480, 640), $out );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_400x500_crop() {
</span><span class="cx">                 // landscape: crop 640x480 to fit 400x500: 400x400 taken from a 480x480 crop at (80. 0)
</span><span class="cx">                 $out = image_resize_dimensions(640, 480, 400, 500, true);
</span><span class="lines">@@ -437,7 +441,7 @@
</span><span class="cx">                 // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
</span><span class="cx">                 $this-&gt;assertEquals( array(0, 0, 0, 20, 400, 500, 480, 600), $out );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class TestImageResize extends WPTestCase {
</span><span class="lines">@@ -479,7 +483,7 @@
</span><span class="cx">                 $this-&gt;assertInstanceOf( 'WP_Error', $image );
</span><span class="cx">                 $this-&gt;assertEquals( 'error_getting_dimensions', $image-&gt;get_error_code() );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_resize_thumb_128x96() {
</span><span class="cx">                 $image = image_resize( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG', 128, 96 );
</span><span class="cx">                 $this-&gt;assertEquals( '2007-06-17DSC_4173-63x96.jpg', basename($image) );
</span><span class="lines">@@ -570,12 +574,12 @@
</span><span class="cx">                         'test-image-zip.tiff',
</span><span class="cx">                         'test-image.jpg',
</span><span class="cx">                         );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 foreach ($files as $file) {
</span><span class="cx">                         $this-&gt;assertTrue( file_is_valid_image( DIR_TESTDATA.'/images/'.$file ), &quot;file_is_valid_image($file) should return true&quot; );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_is_image_negative() {
</span><span class="cx">                 // these are actually image files but aren't recognized or usable by php
</span><span class="cx">                 $files = array(
</span><span class="lines">@@ -583,12 +587,12 @@
</span><span class="cx">                         'test-image.tga',
</span><span class="cx">                         'test-image.sgi',
</span><span class="cx">                         );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 foreach ($files as $file) {
</span><span class="cx">                         $this-&gt;assertFalse( file_is_valid_image( DIR_TESTDATA.'/images/'.$file ), &quot;file_is_valid_image($file) should return false&quot; );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_is_displayable_image_positive() {
</span><span class="cx">                 // these are all usable in typical web browsers
</span><span class="cx">                 $files = array(
</span><span class="lines">@@ -596,12 +600,12 @@
</span><span class="cx">                         'test-image.png',
</span><span class="cx">                         'test-image.jpg',
</span><span class="cx">                         );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 foreach ($files as $file) {
</span><span class="cx">                         $this-&gt;assertTrue( file_is_displayable_image( DIR_TESTDATA.'/images/'.$file ), &quot;file_is_valid_image($file) should return true&quot; );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_is_displayable_image_negative() {
</span><span class="cx">                 // these are image files but aren't suitable for web pages because of compatibility or size issues
</span><span class="cx">                 $files = array(
</span><span class="lines">@@ -622,9 +626,9 @@
</span><span class="cx">                         $this-&gt;assertFalse( file_is_displayable_image( DIR_TESTDATA.'/images/'.$file ), &quot;file_is_valid_image($file) should return false&quot; );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
-        
-        
</del><ins>+
+
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="wptestcasetest_import_wpphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_import_wp.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_import_wp.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_import_wp.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -5,16 +5,16 @@
</span><span class="cx"> // need to include the importer as an external, so path may need to change...
</span><span class="cx"> 
</span><span class="cx"> // _nuke_main_tables style function on tearDown? (Should this be part of _WPEmptyBlog tearDown?)
</span><del>-       
</del><ins>+
</ins><span class="cx"> class WXRParserTest extends WPTestCase {
</span><span class="cx">         function setUp() {
</span><span class="cx">                 parent::setUp();
</span><span class="cx"> 
</span><span class="cx">                 if ( ! defined( 'WP_IMPORTING' ) )
</span><span class="cx">                         define( 'WP_IMPORTING', true );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
</span><del>-                        define( 'WP_LOAD_IMPORTERS', true );                
</del><ins>+                        define( 'WP_LOAD_IMPORTERS', true );
</ins><span class="cx"> 
</span><span class="cx">                 require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
</span><span class="cx">         }
</span><span class="lines">@@ -22,44 +22,44 @@
</span><span class="cx">         function tearDown() {
</span><span class="cx">                 parent::tearDown();
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_malformed_wxr() {
</span><span class="cx">                 $file = DIR_TESTDATA . '/export/malformed.xml';
</span><del>-        
</del><ins>+
</ins><span class="cx">                 // regex based parser cannot detect malformed XML
</span><span class="cx">                 foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML' ) as $p ) {
</span><span class="cx">                         $parser = new $p;
</span><span class="cx">                         $result = $parser-&gt;parse($file);
</span><span class="cx">                         $this-&gt;assertTrue( is_wp_error( $result ) );
</span><del>-                        $this-&gt;assertEquals( 'There was an error when reading this WXR file', $result-&gt;get_error_message() );        
-                }        
-        }        
</del><ins>+                        $this-&gt;assertEquals( 'There was an error when reading this WXR file', $result-&gt;get_error_message() );
+                }
+        }
</ins><span class="cx"> 
</span><span class="cx">         function test_invalid_wxr() {
</span><span class="cx">                 $f1 = DIR_TESTDATA . '/export/missing-version-tag.xml';
</span><span class="cx">                 $f2 = DIR_TESTDATA . '/export/invalid-version-tag.xml';
</span><del>-        
</del><ins>+
</ins><span class="cx">                 foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
</span><span class="cx">                         foreach ( array( $f1, $f2 ) as $file ) {
</span><span class="cx">                                 $parser = new $p;
</span><del>-                                $result = $parser-&gt;parse( $file );                                
</del><ins>+                                $result = $parser-&gt;parse( $file );
</ins><span class="cx">                                 $this-&gt;assertTrue( is_wp_error( $result ) );
</span><del>-                                $this-&gt;assertEquals( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result-&gt;get_error_message() );        
</del><ins>+                                $this-&gt;assertEquals( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result-&gt;get_error_message() );
</ins><span class="cx">                         }
</span><del>-                }                        
</del><ins>+                }
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_wxr_version_1_1() {
</span><span class="cx">                 $file = DIR_TESTDATA . '/export/valid-wxr-1.1.xml';
</span><del>-                         
</del><ins>+
</ins><span class="cx">                 foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
</span><span class="cx">                         $message = $p . ' failed';
</span><span class="cx">                         $parser = new $p;
</span><del>-                        $result = $parser-&gt;parse( $file );        
-                        
-                        $this-&gt;assertTrue( is_array( $result ), $message );                        
</del><ins>+                        $result = $parser-&gt;parse( $file );
+
+                        $this-&gt;assertTrue( is_array( $result ), $message );
</ins><span class="cx">                         $this-&gt;assertEquals( 'http://localhost/', $result['base_url'], $message );
</span><del>-                        $this-&gt;assertEquals( array(  
</del><ins>+                        $this-&gt;assertEquals( array(
</ins><span class="cx">                                 'author_id' =&gt; 2,
</span><span class="cx">                                 'author_login' =&gt; 'john',
</span><span class="cx">                                 'author_email' =&gt; 'johndoe@example.org',
</span><span class="lines">@@ -72,22 +72,22 @@
</span><span class="cx">                                 'category_nicename' =&gt; 'alpha',
</span><span class="cx">                                 'category_parent' =&gt; '',
</span><span class="cx">                                 'cat_name' =&gt; 'alpha',
</span><del>-                                'category_description' =&gt; 'The alpha category'                        
</del><ins>+                                'category_description' =&gt; 'The alpha category'
</ins><span class="cx">                         ), $result['categories'][0], $message );
</span><span class="cx">                         $this-&gt;assertEquals( array(
</span><span class="cx">                                 'term_id' =&gt; 22,
</span><span class="cx">                                 'tag_slug' =&gt; 'clippable',
</span><span class="cx">                                 'tag_name' =&gt; 'Clippable',
</span><del>-                                'tag_description' =&gt; 'The Clippable post_tag'                
</del><ins>+                                'tag_description' =&gt; 'The Clippable post_tag'
</ins><span class="cx">                         ), $result['tags'][0], $message );
</span><span class="cx">                         $this-&gt;assertEquals( array(
</span><span class="cx">                                 'term_id' =&gt; 40,
</span><span class="cx">                                 'term_taxonomy' =&gt; 'post_tax',
</span><span class="cx">                                 'slug' =&gt; 'bieup',
</span><del>-                                'term_parent' =&gt; '',                                
</del><ins>+                                'term_parent' =&gt; '',
</ins><span class="cx">                                 'term_name' =&gt; 'bieup',
</span><del>-                                'term_description' =&gt; 'The bieup post_tax'                
-                        ), $result['terms'][0], $message );                                        
</del><ins>+                                'term_description' =&gt; 'The bieup post_tax'
+                        ), $result['terms'][0], $message );
</ins><span class="cx"> 
</span><span class="cx">                         $this-&gt;assertEquals( 2, count($result['posts']), $message );
</span><span class="cx">                         $this-&gt;assertEquals( 19, count($result['posts'][0]), $message );
</span><span class="lines">@@ -99,26 +99,26 @@
</span><span class="cx">                         ), $result['posts'][0]['terms'], $message );
</span><span class="cx">                         $this-&gt;assertEquals( array(
</span><span class="cx">                                 array( 'key' =&gt; '_wp_page_template', 'value' =&gt; 'default' )
</span><del>-                        ), $result['posts'][1]['postmeta'], $message );        
</del><ins>+                        ), $result['posts'][1]['postmeta'], $message );
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_wxr_version_1_0() {
</span><span class="cx">                 $file = DIR_TESTDATA . '/export/valid-wxr-1.0.xml';
</span><del>-                
</del><ins>+
</ins><span class="cx">                 foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
</span><span class="cx">                         $message = $p . ' failed';
</span><span class="cx">                         $parser = new $p;
</span><span class="cx">                         $result = $parser-&gt;parse( $file );
</span><del>-                        
-                        $this-&gt;assertTrue( is_array( $result ), $message );                        
</del><ins>+
+                        $this-&gt;assertTrue( is_array( $result ), $message );
</ins><span class="cx">                         $this-&gt;assertEquals( 'http://localhost/', $result['base_url'], $message );
</span><span class="cx">                         $this-&gt;assertEquals( $result['categories'][0]['category_nicename'], 'alpha', $message );
</span><span class="cx">                         $this-&gt;assertEquals( $result['categories'][0]['cat_name'], 'alpha', $message );
</span><span class="cx">                         $this-&gt;assertEquals( $result['categories'][0]['category_parent'], '', $message );
</span><span class="cx">                         $this-&gt;assertEquals( $result['categories'][0]['category_description'], 'The alpha category', $message );
</span><span class="cx">                         $this-&gt;assertEquals( $result['tags'][0]['tag_slug'], 'chicken', $message );
</span><del>-                        $this-&gt;assertEquals( $result['tags'][0]['tag_name'], 'chicken', $message );        
</del><ins>+                        $this-&gt;assertEquals( $result['tags'][0]['tag_name'], 'chicken', $message );
</ins><span class="cx"> 
</span><span class="cx">                         $this-&gt;assertEquals( 6, count($result['posts']), $message );
</span><span class="cx">                         $this-&gt;assertEquals( 19, count($result['posts'][0]), $message );
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx">                         ), $result['posts'][1]['postmeta'], $message );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // tags in CDATA #11574
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -153,10 +153,10 @@
</span><span class="cx"> 
</span><span class="cx">                 if ( ! defined( 'WP_IMPORTING' ) )
</span><span class="cx">                         define( 'WP_IMPORTING', true );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
</span><span class="cx">                         define( 'WP_LOAD_IMPORTERS', true );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
</span><span class="cx"> 
</span><span class="cx">                 global $wpdb;
</span><span class="lines">@@ -177,11 +177,11 @@
</span><span class="cx">                 if ( $user = get_user_by( 'login', 'author' ) )
</span><span class="cx">                         wp_delete_user( $user-&gt;ID );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_small_import() {
</span><span class="cx">                 global $wpdb;
</span><span class="cx"> 
</span><del>-                $authors = array( 'admin' =&gt; false, 'editor' =&gt; false, 'author' =&gt; false );        
</del><ins>+                $authors = array( 'admin' =&gt; false, 'editor' =&gt; false, 'author' =&gt; false );
</ins><span class="cx">                 $this-&gt;_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
</span><span class="cx"> 
</span><span class="cx">                 // ensure that authors were imported correctly
</span><span class="lines">@@ -334,7 +334,7 @@
</span><span class="cx">                 $cats = wp_get_post_categories( $post-&gt;ID );
</span><span class="cx">                 $this-&gt;assertEquals( 1, count($cats) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_double_import() {
</span><span class="cx">                 $authors = array( 'admin' =&gt; false, 'editor' =&gt; false, 'author' =&gt; false );
</span><span class="cx">                 $this-&gt;_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
</span><span class="lines">@@ -378,27 +378,27 @@
</span><span class="cx"> class TestImportWP_PostMeta extends _WPEmptyBlog {
</span><span class="cx">         function setUp() {
</span><span class="cx">                 parent::setUp();
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if ( ! defined( 'WP_IMPORTING' ) )
</span><span class="cx">                         define( 'WP_IMPORTING', true );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
</span><span class="cx">                         define( 'WP_LOAD_IMPORTERS', true );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function tearDown() {
</span><span class="cx">                 parent::tearDown();
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_serialized_postmeta_no_cdata() {
</span><del>-                $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-no-cdata.xml', array( 'johncoswell' =&gt; false ) );        
</del><ins>+                $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-no-cdata.xml', array( 'johncoswell' =&gt; false ) );
</ins><span class="cx">                 $expected['special_post_title'] = 'A special title';
</span><del>-                $expected['is_calendar'] = '';        
</del><ins>+                $expected['is_calendar'] = '';
</ins><span class="cx">                 $this-&gt;assertEquals( $expected, get_post_meta( 122, 'post-options', true ) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_utw_postmeta() {
</span><span class="cx">                 $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-utw-post-meta-import.xml', array( 'johncoswell' =&gt; false ) );
</span><span class="cx"> 
</span><span class="lines">@@ -413,10 +413,10 @@
</span><span class="cx">                 $expected[] = $classy;
</span><span class="cx">                 $classy = new StdClass();
</span><span class="cx">                 $classy-&gt;tag =  &quot;artwork&quot;;
</span><del>-                $expected[] = $classy;        
</del><ins>+                $expected[] = $classy;
</ins><span class="cx">                 $classy = new StdClass();
</span><span class="cx">                 $classy-&gt;tag =  &quot;dead-tracks&quot;;
</span><del>-                $expected[] = $classy;        
</del><ins>+                $expected[] = $classy;
</ins><span class="cx">                 $classy = new StdClass();
</span><span class="cx">                 $classy-&gt;tag =  &quot;ipod&quot;;
</span><span class="cx">                 $expected[] = $classy;
</span><span class="lines">@@ -428,20 +428,20 @@
</span><span class="cx">                 $expected[] = $classy;
</span><span class="cx">                 $classy = new StdClass();
</span><span class="cx">                 $classy-&gt;tag =  &quot;lyrics&quot;;
</span><del>-                $expected[] = $classy;        
</del><ins>+                $expected[] = $classy;
</ins><span class="cx">                 $classy = new StdClass();
</span><span class="cx">                 $classy-&gt;tag =  &quot;script&quot;;
</span><del>-                $expected[] = $classy;        
</del><ins>+                $expected[] = $classy;
</ins><span class="cx">                 $classy = new StdClass();
</span><span class="cx">                 $classy-&gt;tag =  &quot;tracks&quot;;
</span><del>-                $expected[] = $classy;        
</del><ins>+                $expected[] = $classy;
</ins><span class="cx">                 $classy = new StdClass();
</span><span class="cx">                 $classy-&gt;tag =  &quot;windows-scripting-host&quot;;
</span><del>-                $expected[] = $classy;        
</del><ins>+                $expected[] = $classy;
</ins><span class="cx">                 $classy = new StdClass();
</span><span class="cx">                 $classy-&gt;tag =  &quot;wscript&quot;;
</span><del>-                $expected[] = $classy;        
-                
</del><ins>+                $expected[] = $classy;
+
</ins><span class="cx">                 $this-&gt;assertEquals( $expected, get_post_meta( 150, 'test', true ) );
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -468,11 +468,11 @@
</span><span class="cx">                 $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' =&gt; false ) );
</span><span class="cx"> 
</span><span class="cx">                 //HTML in the CDATA should work with old WordPress version
</span><del>-                $this-&gt;assertEquals( '&lt;pre&gt;some html&lt;/pre&gt;', get_post_meta( 10, 'contains-html', true ) );                
</del><ins>+                $this-&gt;assertEquals( '&lt;pre&gt;some html&lt;/pre&gt;', get_post_meta( 10, 'contains-html', true ) );
</ins><span class="cx">                 //Serialised will only work with 3.0 onwards.
</span><span class="cx">                 $expected[&quot;special_post_title&quot;] = &quot;A special title&quot;;
</span><span class="cx">                 $expected[&quot;is_calendar&quot;] = &quot;&quot;;
</span><del>-                $this-&gt;assertEquals( $expected, get_post_meta( 10, 'post-options', true ) );                
</del><ins>+                $this-&gt;assertEquals( $expected, get_post_meta( 10, 'post-options', true ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // #11574
</span></span></pre></div>
<a id="wptestcasetest_includes_canonicalphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_includes_canonical.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_includes_canonical.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_includes_canonical.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx">                 $wp_rewrite-&gt;add_rule('ccr/(.+?)/sort/(asc|desc)', 'index.php?category_name=$matches[1]&amp;order=$matches[2]', 'top'); // ccr = Custom_Cat_Rule
</span><span class="cx"> 
</span><span class="cx">                 $wp_rewrite-&gt;flush_rules();
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function tearDown() {
</span><span class="lines">@@ -70,25 +70,25 @@
</span><span class="cx">                 // Just test the Path and Query if present
</span><span class="cx">                 if ( isset($expected['url']) )
</span><span class="cx">                         $this-&gt;assertEquals( $expected['url'], $parsed_can_url['path'] . (!empty($parsed_can_url['query']) ? '?' . $parsed_can_url['query'] : ''), $ticket_ref );
</span><del>-        
-                if ( isset($expected['qv']) ) {        
</del><span class="cx"> 
</span><ins>+                if ( isset($expected['qv']) ) {
+
</ins><span class="cx">                         // &quot;make&quot; that the request and check the query is correct
</span><span class="cx">                         $this-&gt;http( $can_url );
</span><span class="cx"> 
</span><span class="cx">                         // Are all query vars accounted for, And correct?
</span><span class="cx">                         global $wp;
</span><del>-        
</del><ins>+
</ins><span class="cx">                         $query_vars = array_diff($wp-&gt;query_vars, $wp-&gt;extra_query_vars);
</span><span class="cx">                         if ( !empty($parsed_can_url['query']) ) {
</span><span class="cx">                                 parse_str($parsed_can_url['query'], $_qv);
</span><del>-        
</del><ins>+
</ins><span class="cx">                                 // $_qv should not contain any elements which are set in $query_vars already (ie. $_GET vars should not be present in the Rewrite)
</span><span class="cx">                                 $this-&gt;assertEquals( array(), array_intersect( $query_vars, $_qv ), 'Query vars are duplicated from the Rewrite into $_GET; ' . $ticket_ref );
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 $query_vars = array_merge($query_vars, $_qv);
</span><span class="cx">                         }
</span><del>-        
</del><ins>+
</ins><span class="cx">                         $this-&gt;assertEquals( $expected['qv'], $query_vars );
</span><span class="cx">                 } //isset $expected['qv']
</span><span class="cx"> 
</span><span class="lines">@@ -108,11 +108,11 @@
</span><span class="cx">                                 array( '/category/uncategorized/page/2/', array( 'url' =&gt; '/category/uncategorized/page/2/', 'qv' =&gt; array( 'category_name' =&gt; 'uncategorized', 'paged' =&gt; 2) ) ),
</span><span class="cx">                                 array( '/category/uncategorized/?paged=2', array( 'url' =&gt; '/category/uncategorized/page/2/', 'qv' =&gt; array( 'category_name' =&gt; 'uncategorized', 'paged' =&gt; 2) ) ),
</span><span class="cx">                                 array( '/category/uncategorized/?paged=2&amp;category_name=uncategorized', array( 'url' =&gt; '/category/uncategorized/page/2/', 'qv' =&gt; array( 'category_name' =&gt; 'uncategorized', 'paged' =&gt; 2) ), 17174 ),
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 // Categories &amp; Intersections with other vars
</span><span class="cx">                                 array( '/category/uncategorized/?tag=post-formats', array( 'url' =&gt; '/category/uncategorized/?tag=post-formats', 'qv' =&gt; array('category_name' =&gt; 'uncategorized', 'tag' =&gt; 'post-formats') ) ),
</span><span class="cx">                                 array( '/?category_name=cat-a,cat-b', array( 'url' =&gt; '/?category_name=cat-a,cat-b', 'qv' =&gt; array('category_name' =&gt; 'cat-a,cat-b' ) ) ),
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 // Categories with Dates
</span><span class="cx">                                 array( '/category/uncategorized/?paged=2&amp;year=2008', array( 'url' =&gt; '/category/uncategorized/page/2/?year=2008', 'qv' =&gt; array( 'category_name' =&gt; 'uncategorized', 'paged' =&gt; 2, 'year' =&gt; 2008) ), 17661 ),
</span><span class="cx">                                 array( '/2008/04/?cat=1', array( 'url' =&gt; '/2008/04/?cat=1', 'qv' =&gt; array('cat' =&gt; '1', 'year' =&gt; '2008', 'monthnum' =&gt; '04' ) ), 17661 ),
</span><span class="lines">@@ -130,8 +130,8 @@
</span><span class="cx">                                 array( '/child-page-1/', '/parent-page/child-page-1/'),
</span><span class="cx">                                 array( '/?page_id=144', '/parent-page/child-page-1/'),
</span><span class="cx">                                 array( '/abo', '/about/' ),
</span><del>-                                
-                                
</del><ins>+
+
</ins><span class="cx">                                 // Posts
</span><span class="cx">                                 array( '?p=587', '/2008/06/02/post-format-test-audio/'),
</span><span class="cx">                                 array( '/?name=images-test', '/2008/09/03/images-test/'),
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx">                                 array( '/2008/post-format-test-au/', '/2008/06/02/post-format-test-audio/'),
</span><span class="cx">                                 array( '/2010/post-format-test-au/', '/2008/06/02/post-format-test-audio/'), // A Year the post is not in
</span><span class="cx">                                 array( '/post-format-test-au/', '/2008/06/02/post-format-test-audio/'),
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 array( '/2008/09/03/images-test/3/', array( 'url' =&gt; '/2008/09/03/images-test/3/', 'qv' =&gt; array( 'name' =&gt; 'images-test', 'year' =&gt; '2008', 'monthnum' =&gt; '09', 'day' =&gt; '03', 'page' =&gt; '/3' ) ) ), // page = /3 ?!
</span><span class="cx">                                 array( '/2008/09/03/images-test/8/', '/2008/09/03/images-test/4/' ), // post with 4 pages
</span><span class="cx">                                 array( '/2008/09/03/images-test/?page=3', '/2008/09/03/images-test/3/' ),
</span><span class="lines">@@ -152,24 +152,24 @@
</span><span class="cx">                                 array( '/?attachment_id=611', '/2008/06/10/post-format-test-gallery/canola2/' ),
</span><span class="cx">                                 array( '/2008/09/03/images-test/canola2/', '/2008/06/10/post-format-test-gallery/canola2/' ), // Image accessed via incorrect parent
</span><span class="cx">                                 array( '/2008/06/10/post-format-test-gallery/?attachment_id=611', '/2008/06/10/post-format-test-gallery/canola2/' ),
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 // Dates
</span><span class="cx">                                 array( '/?m=2008', '/2008/' ),
</span><span class="cx">                                 array( '/?m=200809', '/2008/09/'),
</span><span class="cx">                                 array( '/?m=20080905', '/2008/09/05/'),
</span><span class="cx">                                 array( '/?m=2008095', '/2008/09/'), // Invalid date, /09/ or /09/05/ perhaps?
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 array( '/2008/?day=05', '/2008/?day=05'), // no redirect
</span><span class="cx">                                 array( '/2008/09/?day=05', '/2008/09/05/'),
</span><span class="cx">                                 array( '/2008/?monthnum=9', '/2008/09/'),
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 array( '/?year=2008', '/2008/'),
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 // Authors
</span><span class="cx">                                 array( '/?author=3', '/author/chip-bennett/' ),
</span><span class="cx">                                 array( '/?author=3&amp;year=2008', '/2008/?author=3'),
</span><span class="cx">                                 array( '/author/chip-bennett/?year=2008', '/2008/?author=3'), //Either or, see previous testcase.
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 // Todo: Endpoints (feeds, trackbacks, etc), More fuzzed mixed query variables, comment paging, Home page (Static)
</span><span class="cx"> 
</span><span class="cx">                                 );
</span></span></pre></div>
<a id="wptestcasetest_includes_classwpdependenciesphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_includes_class-wp-dependencies.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_includes_class-wp-dependencies.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_includes_class-wp-dependencies.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">         function test_add() {
</span><span class="cx">                 // Create a new object
</span><span class="cx">                 $dep = new WP_Dependencies;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'one', '' ));
</span><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'two', '' ));
</span><span class="cx"> 
</span><span class="lines">@@ -17,21 +17,21 @@
</span><span class="cx">         function test_remove() {
</span><span class="cx">                 // Create a new object
</span><span class="cx">                 $dep = new WP_Dependencies;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'one', '' ));
</span><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'two', '' ));
</span><span class="cx"> 
</span><span class="cx">                 $dep-&gt;remove( 'one' );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertFalse($dep-&gt;query( 'one'));
</span><span class="cx">                 $this-&gt;assertInstanceOf('_WP_Dependency', $dep-&gt;query( 'two' ));
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_enqueue() {
</span><span class="cx">                 // Create a new object
</span><span class="cx">                 $dep = new WP_Dependencies;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'one', '' ));
</span><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'two', '' ));
</span><span class="cx"> 
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx">                 $dep-&gt;enqueue('one');
</span><span class="cx">                 $this-&gt;assertTrue($dep-&gt;query( 'one', 'queue' ));
</span><span class="cx">                 $this-&gt;assertFalse($dep-&gt;query( 'two', 'queue' ));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $dep-&gt;enqueue('two');
</span><span class="cx">                 $this-&gt;assertTrue($dep-&gt;query( 'one', 'queue' ));
</span><span class="cx">                 $this-&gt;assertTrue($dep-&gt;query( 'two', 'queue' ));
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">         function test_dequeue() {
</span><span class="cx">                 // Create a new object
</span><span class="cx">                 $dep = new WP_Dependencies;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'one', '' ));
</span><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'two', '' ));
</span><span class="cx"> 
</span><span class="lines">@@ -65,11 +65,11 @@
</span><span class="cx">                 $this-&gt;assertFalse($dep-&gt;query( 'one', 'queue' ));
</span><span class="cx">                 $this-&gt;assertFalse($dep-&gt;query( 'two', 'queue' ));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_enqueue_args() {
</span><span class="cx">                 // Create a new object
</span><span class="cx">                 $dep = new WP_Dependencies;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'one', '' ));
</span><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'two', '' ));
</span><span class="cx"> 
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">         function test_dequeue_args() {
</span><span class="cx">                 // Create a new object
</span><span class="cx">                 $dep = new WP_Dependencies;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'one', '' ));
</span><span class="cx">                 $this-&gt;assertTrue($dep-&gt;add( 'two', '' ));
</span><span class="cx"> 
</span><span class="lines">@@ -103,12 +103,12 @@
</span><span class="cx">                 $this-&gt;assertFalse($dep-&gt;query( 'one', 'queue' ));
</span><span class="cx">                 $this-&gt;assertTrue($dep-&gt;query( 'two', 'queue' ));
</span><span class="cx">                 $this-&gt;assertFalse(isset($dep-&gt;args['one']));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $dep-&gt;dequeue('two');
</span><span class="cx">                 $this-&gt;assertFalse($dep-&gt;query( 'one', 'queue' ));
</span><span class="cx">                 $this-&gt;assertFalse($dep-&gt;query( 'two', 'queue' ));
</span><span class="cx">                 $this-&gt;assertFalse(isset($dep-&gt;args['two']));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="wptestcasetest_includes_compatphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_includes_compat.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_includes_compat.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_includes_compat.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx">                 $this-&gt;assertEquals('140d1cb79fa12e2a31f32d35ad0a2723', _hash_hmac('md5', 'simple', 'key'));
</span><span class="cx">                 $this-&gt;assertEquals('993003b95758e0ac2eba451a4c5877eb1bb7b92a', _hash_hmac('sha1', 'simple', 'key'));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_key_padding() {
</span><span class="cx">                 $this-&gt;assertEquals('3c1399103807cf12ec38228614416a8c', _hash_hmac('md5', 'simple', '65 character key 65 character key 65 character key 65 character k'));
</span><span class="cx">                 $this-&gt;assertEquals('4428826d20003e309d6c2a6515891370daf184ea', _hash_hmac('sha1', 'simple', '65 character key 65 character key 65 character key 65 character k'));
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx">                 $this-&gt;assertEquals(array( 1 =&gt; '140d1cb79fa12e2a31f32d35ad0a2723'), unpack('H32', _hash_hmac('md5', 'simple', 'key', true)));
</span><span class="cx">                 $this-&gt;assertEquals(array( 1 =&gt; '993003b95758e0ac2eba451a4c5877eb1bb7b92a'), unpack('H40', _hash_hmac('sha1', 'simple', 'key', true)));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="wptestcasetest_includes_filephp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_includes_file.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_includes_file.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_includes_file.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -2,35 +2,35 @@
</span><span class="cx"> 
</span><span class="cx"> class TestIncludesFile extends WPTestCase {
</span><span class="cx"> 
</span><del>-// function wp_unique_filename( $dir, $name, $ext, $unique_filename_callback = NULL )        
</del><ins>+// function wp_unique_filename( $dir, $name, $ext, $unique_filename_callback = NULL )
</ins><span class="cx"> 
</span><span class="cx">         function setUp() {
</span><span class="cx">                 $this-&gt;dir = dirname(tempnam('/tmp', 'foo'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;badchars = '&quot;\'[]*&amp;?$';
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function is_unique_writable_file($path, $filename) {
</span><span class="cx">                 $fullpath = $path . DIRECTORY_SEPARATOR . $filename;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $fp = fopen( $fullpath, 'x' );
</span><span class="cx">                 // file already exists?
</span><span class="cx">                 if (!$fp)
</span><span class="cx">                         return false;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // write some random contents
</span><span class="cx">                 $c = rand_str();
</span><span class="cx">                 fwrite($fp, $c);
</span><span class="cx">                 fclose($fp);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if ( file_get_contents($fullpath) === $c )
</span><span class="cx">                         $result = true;
</span><span class="cx">                 else
</span><span class="cx">                         $result = false;
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 return $result;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_unique_filename_is_valid() {
</span><span class="cx">                 // make sure it produces a valid, writable, unique filename
</span><span class="cx">                 $filename = wp_unique_filename( $this-&gt;dir, rand_str() . '.txt' );
</span><span class="lines">@@ -51,18 +51,18 @@
</span><span class="cx"> 
</span><span class="cx">                 // the two should be different
</span><span class="cx">                 $this-&gt;assertNotEquals( $filename1, $filename2 );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 unlink($this-&gt;dir . DIRECTORY_SEPARATOR . $filename1);
</span><span class="cx">                 unlink($this-&gt;dir . DIRECTORY_SEPARATOR . $filename2);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_unique_filename_is_sanitized() {
</span><span class="cx">                 $name = rand_str();
</span><span class="cx">                 $filename = wp_unique_filename( $this-&gt;dir, $name . $this-&gt;badchars .  '.txt' );
</span><span class="cx"> 
</span><span class="cx">                 // make sure the bad characters were all stripped out
</span><span class="cx">                 $this-&gt;assertEquals( $name . '.txt', $filename );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue( $this-&gt;is_unique_writable_file($this-&gt;dir, $filename) );
</span><span class="cx"> 
</span><span class="cx">                 unlink($this-&gt;dir . DIRECTORY_SEPARATOR . $filename);
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // &quot;foo.php.txt&quot; becomes &quot;foo.php_.txt&quot;
</span><span class="cx">                 $this-&gt;assertEquals( $name . '.php_.txt', $filename );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue( $this-&gt;is_unique_writable_file($this-&gt;dir, $filename) );
</span><span class="cx"> 
</span><span class="cx">                 unlink($this-&gt;dir . DIRECTORY_SEPARATOR . $filename);
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">                 $filename = wp_unique_filename( $this-&gt;dir, $name );
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;assertEquals( $name, $filename );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue( $this-&gt;is_unique_writable_file($this-&gt;dir, $filename) );
</span><span class="cx"> 
</span><span class="cx">                 unlink($this-&gt;dir . DIRECTORY_SEPARATOR . $filename);
</span></span></pre></div>
<a id="wptestcasetest_includes_formattingphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_includes_formatting.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_includes_formatting.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_includes_formatting.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -664,7 +664,7 @@
</span><span class="cx">                         'text/plain',
</span><span class="cx">                         'video/mpeg',
</span><span class="cx">                 );
</span><del>-        
</del><ins>+
</ins><span class="cx">                 foreach ( $inputs as $input ) {
</span><span class="cx">                         $this-&gt;assertEquals($input, sanitize_mime_type($input));
</span><span class="cx">                 }
</span></span></pre></div>
<a id="wptestcasetest_includes_metaphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_includes_meta.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_includes_meta.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_includes_meta.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx">                 parent::tearDown();
</span><span class="cx">                 foreach ($this-&gt;post_ids as $id)
</span><span class="cx">                         wp_delete_post($id);
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 delete_metadata( 'user', $this-&gt;author-&gt;ID, 'meta_key', '', true );
</span><span class="cx">                 delete_metadata( 'user', $this-&gt;author-&gt;ID, 'delete_meta_key', '', true );
</span><span class="cx">         }
</span><span class="lines">@@ -33,57 +33,57 @@
</span><span class="cx">                 $meta = sanitize_meta( 'some_meta', 'unsanitized', 'post' );
</span><span class="cx">                 $this-&gt;assertEquals( 'sanitized', $meta );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_delete_metadata_by_mid() {
</span><span class="cx">                 if ( ! function_exists( 'delete_metadata_by_mid' ) || ! function_exists( 'get_metadata_by_mid' ) )
</span><span class="cx">                         return;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Let's try and delete a non-existing ID, non existing meta
</span><span class="cx">                 $this-&gt;assertFalse( delete_metadata_by_mid( 'user', 0 ) );
</span><span class="cx">                 $this-&gt;assertFalse( delete_metadata_by_mid( 'non_existing_meta', $this-&gt;delete_meta_id ) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Now let's delete the real meta data
</span><span class="cx">                 $this-&gt;assertTrue( delete_metadata_by_mid( 'user', $this-&gt;delete_meta_id ) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // And make sure it's been deleted
</span><span class="cx">                 $this-&gt;assertFalse( get_metadata_by_mid( 'user', $this-&gt;delete_meta_id ) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Make sure the caches are cleared
</span><span class="cx">                 $this-&gt;assertFalse( (bool) get_user_meta( $this-&gt;author-&gt;ID, 'delete_meta_key' ) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_update_metadata_by_mid() {
</span><span class="cx">                 if ( ! function_exists( 'update_metadata_by_mid' ) || ! function_exists( 'get_metadata_by_mid') )
</span><span class="cx">                         return;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Setup
</span><span class="cx">                 $meta = get_metadata_by_mid( 'user', $this-&gt;meta_id );
</span><span class="cx"> 
</span><span class="cx">                 // Update the meta value
</span><span class="cx">                 $this-&gt;assertTrue( update_metadata_by_mid( 'user', $this-&gt;meta_id, 'meta_new_value' ) );
</span><del>-                $meta = get_metadata_by_mid( 'user', $this-&gt;meta_id );                
</del><ins>+                $meta = get_metadata_by_mid( 'user', $this-&gt;meta_id );
</ins><span class="cx">                 $this-&gt;assertEquals( 'meta_new_value', $meta-&gt;meta_value );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Update the meta value
</span><span class="cx">                 $this-&gt;assertTrue( update_metadata_by_mid( 'user', $this-&gt;meta_id, 'meta_new_value', 'meta_new_key' ) );
</span><span class="cx">                 $meta = get_metadata_by_mid( 'user', $this-&gt;meta_id );
</span><span class="cx">                 $this-&gt;assertEquals( 'meta_new_key', $meta-&gt;meta_key );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Update the key and value
</span><span class="cx">                 $this-&gt;assertTrue( update_metadata_by_mid( 'user', $this-&gt;meta_id, 'meta_value', 'meta_key' ) );
</span><span class="cx">                 $meta = get_metadata_by_mid( 'user', $this-&gt;meta_id );
</span><span class="cx">                 $this-&gt;assertEquals( 'meta_key', $meta-&gt;meta_key );
</span><span class="cx">                 $this-&gt;assertEquals( 'meta_value', $meta-&gt;meta_value );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Update the value that has to be serialized
</span><span class="cx">                 $this-&gt;assertTrue( update_metadata_by_mid( 'user', $this-&gt;meta_id, array( 'first', 'second' ) ) );
</span><span class="cx">                 $meta = get_metadata_by_mid( 'user', $this-&gt;meta_id );
</span><span class="cx">                 $this-&gt;assertEquals( array( 'first', 'second' ), $meta-&gt;meta_value );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Let's try some invalid meta data
</span><span class="cx">                 $this-&gt;assertFalse( update_metadata_by_mid( 'user', 0, 'meta_value' ) );
</span><span class="cx">                 $this-&gt;assertFalse( update_metadata_by_mid( 'user', $this-&gt;meta_id, 'meta_value', array('invalid', 'key' ) ) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Let's see if caches get cleared after updates.
</span><span class="cx">                 $meta = get_metadata_by_mid( 'user', $this-&gt;meta_id );
</span><span class="cx">                 $first = get_user_meta( $meta-&gt;user_id, $meta-&gt;meta_key );
</span></span></pre></div>
<a id="wptestcasetest_includes_pluggablephp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_includes_pluggable.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_includes_pluggable.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_includes_pluggable.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx"> 
</span><span class="cx">         function test_wp_mail_rfc2822_addresses() {
</span><span class="cx">                 $this-&gt;knownWPBug(17305);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $to = &quot;Name &lt;address@tld.com&gt;&quot;;
</span><span class="cx">                 $from = &quot;Another Name &lt;another_address@different-tld.com&gt;&quot;;
</span><span class="cx">                 $cc = &quot;The Carbon Guy &lt;cc@cc.com&gt;&quot;;
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx"> 
</span><span class="cx">         function test_wp_mail_multiple_rfc2822_to_addresses() {
</span><span class="cx">                 $this-&gt;knownWPBug(17305);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $to = &quot;Name &lt;address@tld.com&gt;, Another Name &lt;another_address@different-tld.com&gt;&quot;;
</span><span class="cx">                 $subject = &quot;RFC2822 Testing&quot;;
</span><span class="cx">                 $message = &quot;My RFC822 Test Message&quot;;
</span></span></pre></div>
<a id="wptestcasetest_includes_postphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_includes_post.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_includes_post.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_includes_post.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -44,8 +44,8 @@
</span><span class="cx">                 $this-&gt;assertEquals($post['post_status'], $out-&gt;post_status);
</span><span class="cx">                 $this-&gt;assertEquals($post['post_author'], $out-&gt;post_author);
</span><span class="cx">         }
</span><del>-        
-        
</del><ins>+
+
</ins><span class="cx">         function test_vb_insert_future() {
</span><span class="cx">                 // insert a post with a future date, and make sure the status and cron schedule are correct
</span><span class="cx"> 
</span><span class="lines">@@ -77,15 +77,15 @@
</span><span class="cx">                 // there should be a publish_future_post hook scheduled on the future date
</span><span class="cx">                 $this-&gt;assertEquals($future_date, $this-&gt;_next_schedule_for_post('publish_future_post', $id));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_vb_insert_future_over_dst() {
</span><span class="cx">                 // insert a post with a future date, and make sure the status and cron schedule are correct
</span><del>-                
-                // Some magic days - one dst one not 
</del><ins>+
+                // Some magic days - one dst one not
</ins><span class="cx">                 $future_date_1 = strtotime('June 21st +1 year');
</span><span class="cx">                 $future_date_2 = strtotime('Jan 11th +1 year');
</span><del>-                                
</del><span class="cx"> 
</span><ins>+
</ins><span class="cx">                 $post = array(
</span><span class="cx">                         'post_author' =&gt; $this-&gt;author-&gt;ID,
</span><span class="cx">                         'post_status' =&gt; 'publish',
</span><span class="lines">@@ -118,8 +118,8 @@
</span><span class="cx">                 $this-&gt;assertEquals($post['post_date'], $out-&gt;post_date);
</span><span class="cx"> 
</span><span class="cx">                 // and the correct date on the cron job
</span><del>-                $this-&gt;assertEquals($future_date_2, $this-&gt;_next_schedule_for_post('publish_future_post', $id));                
-        }        
</del><ins>+                $this-&gt;assertEquals($future_date_2, $this-&gt;_next_schedule_for_post('publish_future_post', $id));
+        }
</ins><span class="cx"> 
</span><span class="cx"> function test_vb_insert_future_edit_bug() {
</span><span class="cx">                 // future post bug: posts get published at the wrong time if you edit the timestamp
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // there should be a publish_future_post hook scheduled on the future date
</span><span class="cx">                 $this-&gt;assertEquals(false, $this-&gt;_next_schedule_for_post('publish_future_post', $id));
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function test_vb_insert_future_change_to_draft() {
</span><span class="lines">@@ -239,7 +239,7 @@
</span><span class="cx">                 $future_date_1 = strtotime('+1 day');
</span><span class="cx"> 
</span><span class="cx">                 $statuses = array('draft', 'static', 'object', 'attachment', 'inherit', 'pending');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 foreach ($statuses as $status) {
</span><span class="cx">                         $post = array(
</span><span class="cx">                                 'post_author' =&gt; $this-&gt;author-&gt;ID,
</span><span class="lines">@@ -345,13 +345,13 @@
</span><span class="cx">                 // and the correct date on the cron job
</span><span class="cx">                 $this-&gt;assertEquals(false, $this-&gt;_next_schedule_for_post('publish_future_post', $id));
</span><span class="cx">         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">         function test_delete_future_post_cron() {
</span><span class="cx">                 // http://trac.wordpress.org/ticket/5364
</span><span class="cx">                 // &quot;When I delete a future post using wp_delete_post($post-&gt;ID) it does not update the cron correctly.&quot;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 #$this-&gt;knownWPBug(5364);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $future_date = strtotime('+1 day');
</span><span class="cx"> 
</span><span class="cx">                 $post = array(
</span><span class="lines">@@ -363,21 +363,21 @@
</span><span class="cx">                 );
</span><span class="cx"> 
</span><span class="cx">                 // insert a post and make sure the ID is ok
</span><del>-                $id = $this-&gt;post_ids[] = wp_insert_post($post);                
</del><ins>+                $id = $this-&gt;post_ids[] = wp_insert_post($post);
</ins><span class="cx"> 
</span><span class="cx">                 // check that there's a publish_future_post job scheduled at the right time
</span><span class="cx">                 $this-&gt;assertEquals($future_date, $this-&gt;_next_schedule_for_post('publish_future_post', $id));
</span><span class="cx"> 
</span><span class="cx">                 // now delete the post and make sure the cron entry is removed
</span><span class="cx">                 wp_delete_post($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertFalse($this-&gt;_next_schedule_for_post('publish_future_post', $id));
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function test_permlink_without_title() {
</span><span class="cx">                 // bug: permalink doesn't work if post title is empty
</span><span class="cx">                 // wpcom #663, also http://trac.wordpress.org/ticket/5305
</span><del>-                
</del><ins>+
</ins><span class="cx">                 global $wp_rewrite;
</span><span class="cx">                 $wp_rewrite-&gt;set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
</span><span class="cx"> 
</span><span class="lines">@@ -399,13 +399,13 @@
</span><span class="cx"> 
</span><span class="cx">                 $wp_rewrite-&gt;set_permalink_structure('');
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_attachment_url() {
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class WPTestAttachments extends _WPEmptyBlog {
</span><del>-        
</del><ins>+
</ins><span class="cx">         function tearDown() {
</span><span class="cx">                 parent::tearDown();
</span><span class="cx">                 // restore system defaults
</span><span class="lines">@@ -414,9 +414,9 @@
</span><span class="cx">                 update_option('thumbnail_size_w', 150);
</span><span class="cx">                 update_option('thumbnail_size_h', 150);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function _make_attachment($upload, $parent_post_id=-1) {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $type = '';
</span><span class="cx">                 if ( !empty($upload['type']) )
</span><span class="cx">                         $type = $upload['type'];
</span><span class="lines">@@ -425,7 +425,7 @@
</span><span class="cx">                         if ($mime)
</span><span class="cx">                                 $type = $mime['type'];
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $attachment = array(
</span><span class="cx">                         'post_title' =&gt; basename( $upload['file'] ),
</span><span class="cx">                         'post_content' =&gt; '',
</span><span class="lines">@@ -438,27 +438,27 @@
</span><span class="cx">                 // Save the data
</span><span class="cx">                 $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $parent_post_id );
</span><span class="cx">                 wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 return $this-&gt;ids[] = $id;
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_insert_bogus_image() {
</span><span class="cx">                 $filename = rand_str().'.jpg';
</span><span class="cx">                 $contents = rand_str();
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $upload = wp_upload_bits($filename, 'image/jpeg', $contents);
</span><span class="cx">                 $this-&gt;assertTrue( empty($upload['error']) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $id = $this-&gt;_make_attachment($upload);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_insert_image_no_thumb() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // this image is smaller than the thumbnail size so it won't have one
</span><span class="cx">                 $filename = ( DIR_TESTDATA.'/images/test-image.jpg' );
</span><span class="cx">                 $contents = file_get_contents($filename);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $upload = wp_upload_bits($filename, 'image/jpeg', $contents);
</span><span class="cx">                 $this-&gt;assertTrue( empty($upload['error']) );
</span><span class="cx"> 
</span><span class="lines">@@ -470,7 +470,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // the thumb url should point to the thumbnail intermediate
</span><span class="cx">                 $this-&gt;assertEquals( $thumb['url'], wp_get_attachment_thumb_url($id) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // image_downsize() should return the correct images and sizes
</span><span class="cx">                 $this-&gt;assertFalse( image_downsize($id, 'thumbnail') );
</span><span class="cx"> 
</span><span class="lines">@@ -488,11 +488,11 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function test_insert_image_default_thumb() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // this image is smaller than the thumbnail size so it won't have one
</span><span class="cx">                 $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' );
</span><span class="cx">                 $contents = file_get_contents($filename);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $upload = wp_upload_bits($filename, 'image/jpeg', $contents);
</span><span class="cx">                 $this-&gt;assertTrue( empty($upload['error']) );
</span><span class="cx"> 
</span><span class="lines">@@ -502,12 +502,12 @@
</span><span class="cx">                 $thumb = image_get_intermediate_size($id, 'thumbnail');
</span><span class="cx">                 $this-&gt;assertEquals( 'a2-small-150x150.jpg', $thumb['file'] );
</span><span class="cx">                 $this-&gt;assertTrue( is_file($thumb['path']) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertFalse( image_get_intermediate_size($id, 'medium') );
</span><span class="cx"> 
</span><span class="cx">                 // the thumb url should point to the thumbnail intermediate
</span><span class="cx">                 $this-&gt;assertEquals( $thumb['url'], wp_get_attachment_thumb_url($id) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // image_downsize() should return the correct images and sizes
</span><span class="cx">                 $downsize = image_downsize($id, 'thumbnail');
</span><span class="cx">                 $this-&gt;assertEquals( 'a2-small-150x150.jpg', basename($downsize[0]) );
</span><span class="lines">@@ -531,16 +531,16 @@
</span><span class="cx"> 
</span><span class="cx">                 update_option('medium_size_w', '400');
</span><span class="cx">                 update_option('medium_size_h', '');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // this image is smaller than the thumbnail size so it won't have one
</span><span class="cx">                 $filename = ( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG' );
</span><span class="cx">                 $contents = file_get_contents($filename);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $upload = wp_upload_bits($filename, 'image/jpeg', $contents);
</span><span class="cx">                 $this-&gt;assertTrue( empty($upload['error']) );
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_make_attachment($upload);
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 // intermediate copies should exist: thumbnail and medium
</span><span class="cx">                 $thumb = image_get_intermediate_size($id, 'thumbnail');
</span><span class="cx">                 $this-&gt;assertEquals( '2007-06-17dsc_4173-150x150.jpg', $thumb['file'] );
</span><span class="lines">@@ -549,21 +549,21 @@
</span><span class="cx">                 $medium = image_get_intermediate_size($id, 'medium');
</span><span class="cx">                 $this-&gt;assertEquals( '2007-06-17dsc_4173-400x602.jpg', $medium['file'] );
</span><span class="cx">                 $this-&gt;assertTrue( is_file($medium['path']) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // the thumb url should point to the thumbnail intermediate
</span><span class="cx">                 $this-&gt;assertEquals( $thumb['url'], wp_get_attachment_thumb_url($id) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // image_downsize() should return the correct images and sizes
</span><span class="cx">                 $downsize = image_downsize($id, 'thumbnail');
</span><span class="cx">                 $this-&gt;assertEquals( '2007-06-17dsc_4173-150x150.jpg', basename($downsize[0]) );
</span><span class="cx">                 $this-&gt;assertEquals( 150, $downsize[1] );
</span><span class="cx">                 $this-&gt;assertEquals( 150, $downsize[2] );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $downsize = image_downsize($id, 'medium');
</span><span class="cx">                 $this-&gt;assertEquals( '2007-06-17dsc_4173-400x602.jpg', basename($downsize[0]) );
</span><span class="cx">                 $this-&gt;assertEquals( 400, $downsize[1] );
</span><span class="cx">                 $this-&gt;assertEquals( 602, $downsize[2] );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $downsize = image_downsize($id, 'full');
</span><span class="cx">                 $this-&gt;assertEquals( '2007-06-17dsc_4173.jpg', basename($downsize[0]) );
</span><span class="cx">                 $this-&gt;assertEquals( 500, $downsize[1] );
</span><span class="lines">@@ -575,16 +575,16 @@
</span><span class="cx"> 
</span><span class="cx">                 update_option('medium_size_w', '400');
</span><span class="cx">                 update_option('medium_size_h', '');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // this image is smaller than the thumbnail size so it won't have one
</span><span class="cx">                 $filename = ( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG' );
</span><span class="cx">                 $contents = file_get_contents($filename);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $upload = wp_upload_bits($filename, 'image/jpeg', $contents);
</span><span class="cx">                 $this-&gt;assertTrue( empty($upload['error']) );
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_make_attachment($upload);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // check that the file and intermediates exist
</span><span class="cx">                 $thumb = image_get_intermediate_size($id, 'thumbnail');
</span><span class="cx">                 $this-&gt;assertEquals( '2007-06-17dsc_4173-150x150.jpg', $thumb['file'] );
</span><span class="lines">@@ -597,7 +597,7 @@
</span><span class="cx">                 $meta = wp_get_attachment_metadata($id);
</span><span class="cx">                 $original = $meta['file'];
</span><span class="cx">                 $this-&gt;assertTrue( is_file($original) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // now delete the attachment and make sure all files are gone
</span><span class="cx">                 wp_delete_attachment($id);
</span><span class="cx"> 
</span><span class="lines">@@ -611,9 +611,9 @@
</span><span class="cx"> class WPTestPostMeta extends WPTestCase {
</span><span class="cx">         function setUp() {
</span><span class="cx">                 parent::setUp();
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;author = get_userdatabylogin(WP_USER_NAME);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $post = array(
</span><span class="cx">                         'post_author' =&gt; $this-&gt;author-&gt;ID,
</span><span class="cx">                         'post_status' =&gt; 'publish',
</span><span class="lines">@@ -624,7 +624,7 @@
</span><span class="cx">                 // insert a post
</span><span class="cx">                 $this-&gt;post_id = wp_insert_post($post);
</span><span class="cx"> 
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $post = array(
</span><span class="cx">                         'post_author' =&gt; $this-&gt;author-&gt;ID,
</span><span class="cx">                         'post_status' =&gt; 'publish',
</span><span class="lines">@@ -645,56 +645,56 @@
</span><span class="cx">         function test_unique_postmeta() {
</span><span class="cx">                 // Add a unique post meta item
</span><span class="cx">                 $this-&gt;assertInternalType( 'integer', add_post_meta($this-&gt;post_id, 'unique', 'value', true) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Check unique is enforced
</span><span class="cx">                 $this-&gt;assertFalse(add_post_meta($this-&gt;post_id, 'unique', 'another value', true));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 //Check it exists
</span><span class="cx">                 $this-&gt;assertEquals('value', get_post_meta($this-&gt;post_id, 'unique', true));
</span><span class="cx">                 $this-&gt;assertEquals(array('value'), get_post_meta($this-&gt;post_id, 'unique', false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 //Fail to delete the wrong value
</span><span class="cx">                 $this-&gt;assertFalse(delete_post_meta($this-&gt;post_id, 'unique', 'wrong value'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 //Delete it
</span><span class="cx">                 $this-&gt;assertTrue(delete_post_meta($this-&gt;post_id, 'unique', 'value'));
</span><span class="cx"> 
</span><span class="cx">                 //Check it is deleted
</span><span class="cx">                 $this-&gt;assertEquals('', get_post_meta($this-&gt;post_id, 'unique', true));
</span><span class="cx">                 $this-&gt;assertEquals(array(), get_post_meta($this-&gt;post_id, 'unique', false));
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_nonunique_postmeta() {
</span><span class="cx">                 // Add two non unique post meta item
</span><span class="cx">                 $this-&gt;assertInternalType( 'integer', add_post_meta($this-&gt;post_id, 'nonunique', 'value') );
</span><span class="cx">                 $this-&gt;assertInternalType( 'integer', add_post_meta($this-&gt;post_id, 'nonunique', 'another value'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 //Check they exists
</span><span class="cx">                 $this-&gt;assertEquals('value', get_post_meta($this-&gt;post_id, 'nonunique', true));
</span><span class="cx">                 $this-&gt;assertEquals(array('value', 'another value'), get_post_meta($this-&gt;post_id, 'nonunique', false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 //Fail to delete the wrong value
</span><span class="cx">                 $this-&gt;assertFalse(delete_post_meta($this-&gt;post_id, 'nonunique', 'wrong value'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 //Delete the first one
</span><span class="cx">                 $this-&gt;assertTrue(delete_post_meta($this-&gt;post_id, 'nonunique', 'value'));
</span><span class="cx"> 
</span><span class="cx">                 //Check the remainder exists
</span><span class="cx">                 $this-&gt;assertEquals('another value', get_post_meta($this-&gt;post_id, 'nonunique', true));
</span><span class="cx">                 $this-&gt;assertEquals(array('another value'), get_post_meta($this-&gt;post_id, 'nonunique', false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 //Add a third one
</span><span class="cx">                 $this-&gt;assertInternalType( 'integer', add_post_meta($this-&gt;post_id, 'nonunique', 'someother value') );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 //Check they exists
</span><span class="cx">                 $this-&gt;assertEquals('someother value', get_post_meta($this-&gt;post_id, 'nonunique', true));
</span><span class="cx">                 $this-&gt;assertEquals(array('someother value', 'another value'), get_post_meta($this-&gt;post_id, 'nonunique', false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 //Delete the lot
</span><span class="cx">                 $this-&gt;assertTrue(delete_post_meta_by_key('nonunique'));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_update_post_meta() {
</span><span class="cx">                 // Add a unique post meta item
</span><span class="cx">                 $this-&gt;assertInternalType( 'integer', add_post_meta($this-&gt;post_id, 'unique_update', 'value', true) );
</span><span class="lines">@@ -708,7 +708,7 @@
</span><span class="cx">                 $this-&gt;assertEquals(array('value'), get_post_meta($this-&gt;post_id, 'unique_update', false));
</span><span class="cx">                 $this-&gt;assertEquals('value', get_post_meta($this-&gt;post_id, 'nonunique_update', true));
</span><span class="cx">                 $this-&gt;assertEquals(array('value', 'another value'), get_post_meta($this-&gt;post_id, 'nonunique_update', false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Update them
</span><span class="cx">                 $this-&gt;assertTrue(update_post_meta($this-&gt;post_id, 'unique_update', 'new', 'value'));
</span><span class="cx">                 $this-&gt;assertTrue(update_post_meta($this-&gt;post_id, 'nonunique_update', 'new', 'value'));
</span><span class="lines">@@ -719,9 +719,9 @@
</span><span class="cx">                 $this-&gt;assertEquals(array('new'), get_post_meta($this-&gt;post_id, 'unique_update', false));
</span><span class="cx">                 $this-&gt;assertEquals('new', get_post_meta($this-&gt;post_id, 'nonunique_update', true));
</span><span class="cx">                 $this-&gt;assertEquals(array('new', 'another new'), get_post_meta($this-&gt;post_id, 'nonunique_update', false));
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_delete_post_meta() {
</span><span class="cx">                 // Add a unique post meta item
</span><span class="cx">                 $this-&gt;assertInternalType( 'integer', add_post_meta($this-&gt;post_id, 'unique_delete', 'value', true) );
</span><span class="lines">@@ -730,14 +730,14 @@
</span><span class="cx">                 //Check they exists
</span><span class="cx">                 $this-&gt;assertEquals('value', get_post_meta($this-&gt;post_id, 'unique_delete', true));
</span><span class="cx">                 $this-&gt;assertEquals('value', get_post_meta($this-&gt;post_id_2, 'unique_delete', true));
</span><del>-        
</del><ins>+
</ins><span class="cx">                 //Delete one of them
</span><span class="cx">                 $this-&gt;assertTrue(delete_post_meta($this-&gt;post_id, 'unique_delete', 'value'));
</span><span class="cx"> 
</span><span class="cx">                 //Check the other still exitsts
</span><span class="cx">                 $this-&gt;assertEquals('value', get_post_meta($this-&gt;post_id_2, 'unique_delete', true));
</span><span class="cx"> 
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function test_delete_post_meta_by_key() {
</span><span class="lines">@@ -748,7 +748,7 @@
</span><span class="cx">                 //Check they exist
</span><span class="cx">                 $this-&gt;assertEquals('value', get_post_meta($this-&gt;post_id, 'unique_delete_by_key', true));
</span><span class="cx">                 $this-&gt;assertEquals('value', get_post_meta($this-&gt;post_id_2, 'unique_delete_by_key', true));
</span><del>-        
</del><ins>+
</ins><span class="cx">                 //Delete one of them
</span><span class="cx">                 $this-&gt;assertTrue(delete_post_meta_by_key('unique_delete_by_key'));
</span><span class="cx"> 
</span><span class="lines">@@ -800,7 +800,7 @@
</span><span class="cx">                 $this-&gt;assertEquals(array('value'), get_post_meta($this-&gt;post_id, 'unique_update', false));
</span><span class="cx">                 $this-&gt;assertEquals('value', get_post_meta($this-&gt;post_id, 'nonunique_update', true));
</span><span class="cx">                 $this-&gt;assertEquals(array('value', 'another value'), get_post_meta($this-&gt;post_id, 'nonunique_update', false));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Update them
</span><span class="cx">                 $this-&gt;assertTrue( update_meta( $mid1, 'unique_update', 'new' ) );
</span><span class="cx">                 $this-&gt;assertTrue( update_meta( $mid2, 'nonunique_update', 'new' ) );
</span><span class="lines">@@ -821,23 +821,23 @@
</span><span class="cx"> 
</span><span class="cx">         function test_funky_post_meta() {
</span><span class="cx">                 $this-&gt;knownWPBug(12860);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $classy = new StdClass();
</span><span class="cx">                 $classy-&gt;ID = 1;
</span><span class="cx">                 $classy-&gt;stringy = &quot;I love slashes\\\\&quot;;
</span><span class="cx">                 $funky_meta[] = $classy;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $classy = new StdClass();
</span><span class="cx">                 $classy-&gt;ID = 2;
</span><span class="cx">                 $classy-&gt;stringy = &quot;I love slashes\\\\ more&quot;;
</span><span class="cx">                 $funky_meta[] = $classy;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Add a post meta item
</span><span class="cx">                 $this-&gt;assertInternalType( 'integer', add_post_meta($this-&gt;post_id, 'test_funky_post_meta', $funky_meta, true) );
</span><span class="cx"> 
</span><span class="cx">                 //Check they exists
</span><span class="cx">                 $this-&gt;assertEquals($funky_meta, get_post_meta($this-&gt;post_id, 'test_funky_post_meta', true));
</span><del>-        
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="wptestcasetest_includes_taxonomyphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_includes_taxonomy.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_includes_taxonomy.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_includes_taxonomy.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -5,11 +5,11 @@
</span><span class="cx">         function test_get_post_taxonomies() {
</span><span class="cx">                 $this-&gt;assertEquals(array('category', 'post_tag', 'post_format'), get_object_taxonomies('post'));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_get_link_taxonomies() {
</span><span class="cx">                 $this-&gt;assertEquals(array('link_category'), get_object_taxonomies('link'));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_get_unknown_taxonomies() {
</span><span class="cx">                 // taxonomies for an unknown object type
</span><span class="cx">                 $this-&gt;knownWPBug(5417);
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx">                 $this-&gt;assertEquals( array(), get_object_taxonomies(0) );
</span><span class="cx">                 $this-&gt;assertEquals( array(), get_object_taxonomies(NULL) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_get_post_taxonomy() {
</span><span class="cx">                 foreach ( get_object_taxonomies('post') as $taxonomy ) {
</span><span class="cx">                         $tax = get_taxonomy($taxonomy);
</span><span class="lines">@@ -44,51 +44,51 @@
</span><span class="cx">                 $this-&gt;assertTrue( is_taxonomy('post_tag') );
</span><span class="cx">                 $this-&gt;assertTrue( is_taxonomy('link_category') );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_is_taxonomy_unknown() {
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy(rand_str()) );
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy('') );
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy(0) );
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy(NULL) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_is_taxonomy_hierarchical() {
</span><span class="cx">                 $this-&gt;assertTrue( is_taxonomy_hierarchical('category') );
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy_hierarchical('post_tag') );
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy_hierarchical('link_category') );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_is_taxonomy_hierarchical_unknown() {
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy_hierarchical(rand_str()) );
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy_hierarchical('') );
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy_hierarchical(0) );
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy_hierarchical(NULL) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_register_taxonomy() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make up a new taxonomy name, and ensure it's unused
</span><span class="cx">                 $tax = rand_str();
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy($tax) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 register_taxonomy( $tax, 'post' );
</span><span class="cx">                 $this-&gt;assertTrue( is_taxonomy($tax) );
</span><del>-                $this-&gt;assertFalse( is_taxonomy_hierarchical($tax) );                
-                
</del><ins>+                $this-&gt;assertFalse( is_taxonomy_hierarchical($tax) );
+
</ins><span class="cx">                 // clean up
</span><span class="cx">                 unset($GLOBALS['wp_taxonomies'][$tax]);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_register_hierarchical_taxonomy() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make up a new taxonomy name, and ensure it's unused
</span><span class="cx">                 $tax = rand_str();
</span><span class="cx">                 $this-&gt;assertFalse( is_taxonomy($tax) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 register_taxonomy( $tax, 'post', array('hierarchical'=&gt;true) );
</span><span class="cx">                 $this-&gt;assertTrue( is_taxonomy($tax) );
</span><del>-                $this-&gt;assertTrue( is_taxonomy_hierarchical($tax) );                
-                
</del><ins>+                $this-&gt;assertTrue( is_taxonomy_hierarchical($tax) );
+
</ins><span class="cx">                 // clean up
</span><span class="cx">                 unset($GLOBALS['wp_taxonomies'][$tax]);
</span><span class="cx">         }
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> 
</span><span class="cx"> class TestTermAPI extends _WPEmptyBlog {
</span><span class="cx">         var $taxonomy = 'category';
</span><del>-        
</del><ins>+
</ins><span class="cx">         function setUp() {
</span><span class="cx">                 parent::setUp();
</span><span class="cx">                 // insert one term into every post taxonomy
</span><span class="lines">@@ -105,51 +105,51 @@
</span><span class="cx">                 foreach(get_object_taxonomies('post') as $tax)
</span><span class="cx">                         wp_insert_term( $term, $tax );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_wp_insert_delete_term() {
</span><span class="cx">                 // a new unused term
</span><span class="cx">                 $term = rand_str();
</span><span class="cx">                 $this-&gt;assertNull( is_term($term) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $initial_count = wp_count_terms( $this-&gt;taxonomy );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $t = wp_insert_term( $term, $this-&gt;taxonomy );
</span><span class="cx">                 $this-&gt;assertTrue( is_array($t) );
</span><span class="cx">                 $this-&gt;assertFalse( is_wp_error($t) );
</span><span class="cx">                 $this-&gt;assertTrue( $t['term_id'] &gt; 0 );
</span><span class="cx">                 $this-&gt;assertTrue( $t['term_taxonomy_id'] &gt; 0 );
</span><span class="cx">                 $this-&gt;assertEquals( $initial_count + 1, wp_count_terms($this-&gt;taxonomy) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make sure the term exists
</span><span class="cx">                 $this-&gt;assertTrue( is_term($term) &gt; 0 );
</span><span class="cx">                 $this-&gt;assertTrue( is_term($t['term_id']) &gt; 0 );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // now delete it
</span><span class="cx">                 $this-&gt;assertTrue( wp_delete_term($t['term_id'], $this-&gt;taxonomy) );
</span><span class="cx">                 $this-&gt;assertNull( is_term($term) );
</span><span class="cx">                 $this-&gt;assertNull( is_term($t['term_id']) );
</span><span class="cx">                 $this-&gt;assertEquals( $initial_count, wp_count_terms($this-&gt;taxonomy) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_is_term_known() {
</span><span class="cx">                 // insert a term
</span><span class="cx">                 $term = rand_str();
</span><span class="cx">                 $t = wp_insert_term( $term, $this-&gt;taxonomy );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals( $t['term_id'], is_term($t['term_id']) );
</span><span class="cx">                 $this-&gt;assertEquals( $t['term_id'], is_term($term) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // clean up
</span><span class="cx">                 $this-&gt;assertTrue( wp_delete_term($t['term_id'], $this-&gt;taxonomy) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_is_term_unknown() {
</span><span class="cx">                 $this-&gt;assertNull( is_term(rand_str()) );
</span><span class="cx">                 $this-&gt;assertEquals( 0, is_term(0) );
</span><span class="cx">                 $this-&gt;assertEquals( 0, is_term('') );
</span><span class="cx">                 $this-&gt;assertEquals( 0, is_term(NULL) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_is_term_type() {
</span><span class="cx">                 // insert a term
</span><span class="cx">                 $this-&gt;knownWPBug(5381);
</span><span class="lines">@@ -162,17 +162,17 @@
</span><span class="cx">                 // clean up
</span><span class="cx">                 $this-&gt;assertTrue( wp_delete_term($t['term_id'], $this-&gt;taxonomy) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_set_object_terms_by_id() {
</span><span class="cx">                 $this-&gt;_insert_quick_posts(5);
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 $terms = array();
</span><span class="cx">                 for ($i=0; $i&lt;3; $i++ ) {
</span><span class="cx">                         $term = rand_str();
</span><span class="cx">                         $result = wp_insert_term( $term, $this-&gt;taxonomy );
</span><span class="cx">                         $term_id[$term] = $result['term_id'];
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 foreach ($this-&gt;post_ids as $id) {
</span><span class="cx">                                 $tt = wp_set_object_terms( $id, array_values($term_id), $this-&gt;taxonomy );
</span><span class="cx">                                 // should return three term taxonomy ids
</span><span class="lines">@@ -184,22 +184,22 @@
</span><span class="cx">                         $actual = get_objects_in_term($id, $this-&gt;taxonomy);
</span><span class="cx">                         $this-&gt;assertEquals( $this-&gt;post_ids, array_map('intval', $actual) );
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // each term should have a count of 5
</span><span class="cx">                 foreach (array_keys($term_id) as $term) {
</span><span class="cx">                         $t = get_term_by('name', $term, $this-&gt;taxonomy);
</span><span class="cx">                         $this-&gt;assertEquals( 5, $t-&gt;count );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_set_object_terms_by_name() {
</span><span class="cx">                 $this-&gt;_insert_quick_posts(5);
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 $terms = array(
</span><span class="cx">                                 rand_str(),
</span><span class="cx">                                 rand_str(),
</span><span class="cx">                                 rand_str());
</span><del>-                                
</del><ins>+
</ins><span class="cx">                 foreach ($this-&gt;post_ids as $id) {
</span><span class="cx">                                 $tt = wp_set_object_terms( $id, $terms, $this-&gt;taxonomy );
</span><span class="cx">                                 // should return three term taxonomy ids
</span><span class="lines">@@ -216,23 +216,23 @@
</span><span class="cx">                         $actual = get_objects_in_term($id, $this-&gt;taxonomy);
</span><span class="cx">                         $this-&gt;assertEquals( $this-&gt;post_ids, array_map('intval', $actual) );
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // each term should have a count of 5
</span><span class="cx">                 foreach ($terms as $term) {
</span><span class="cx">                         $t = get_term_by('name', $term, $this-&gt;taxonomy);
</span><span class="cx">                         $this-&gt;assertEquals( 5, $t-&gt;count );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_change_object_terms_by_name() {
</span><span class="cx">                 // set some terms on an object; then change them while leaving one intact
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;_insert_quick_posts(1);
</span><span class="cx">                 $post_id = end($this-&gt;post_ids);
</span><span class="cx"> 
</span><span class="cx">                 $terms_1 = array('foo', 'bar', 'baz');
</span><span class="cx">                 $terms_2 = array('bar', 'bing');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // set the initial terms
</span><span class="cx">                 $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this-&gt;taxonomy );
</span><span class="cx">                 $this-&gt;assertEquals( 3, count($tt_1) );
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx">                 // make sure they're correct
</span><span class="cx">                 $terms = wp_get_object_terms($post_id, $this-&gt;taxonomy, array('fields' =&gt; 'names', 'orderby' =&gt; 't.term_id'));
</span><span class="cx">                 $this-&gt;assertEquals( $terms_1, $terms );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // change the terms
</span><span class="cx">                 $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this-&gt;taxonomy );
</span><span class="cx">                 $this-&gt;assertEquals( 2, count($tt_2) );
</span><span class="lines">@@ -248,15 +248,15 @@
</span><span class="cx">                 // make sure they're correct
</span><span class="cx">                 $terms = wp_get_object_terms($post_id, $this-&gt;taxonomy, array('fields' =&gt; 'names', 'orderby' =&gt; 't.term_id'));
</span><span class="cx">                 $this-&gt;assertEquals( $terms_2, $terms );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make sure the tt id for 'bar' matches
</span><span class="cx">                 $this-&gt;assertEquals( $tt_1[1], $tt_2[0] );
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function test_change_object_terms_by_id() {
</span><span class="cx">                 // set some terms on an object; then change them while leaving one intact
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;_insert_quick_posts(1);
</span><span class="cx">                 $post_id = end($this-&gt;post_ids);
</span><span class="cx"> 
</span><span class="lines">@@ -271,12 +271,12 @@
</span><span class="cx">                 // second set: one of the original terms, plus one new term
</span><span class="cx">                 $terms_2 = array();
</span><span class="cx">                 $terms_2[0] = $terms_1[1];
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $term = rand_str();
</span><span class="cx">                 $result = wp_insert_term( $term, $this-&gt;taxonomy );
</span><span class="cx">                 $terms_2[1] = $result['term_id'];
</span><span class="cx"> 
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // set the initial terms
</span><span class="cx">                 $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this-&gt;taxonomy );
</span><span class="cx">                 $this-&gt;assertEquals( 3, count($tt_1) );
</span><span class="lines">@@ -284,7 +284,7 @@
</span><span class="cx">                 // make sure they're correct
</span><span class="cx">                 $terms = wp_get_object_terms($post_id, $this-&gt;taxonomy, array('fields' =&gt; 'ids', 'orderby' =&gt; 't.term_id'));
</span><span class="cx">                 $this-&gt;assertEquals( $terms_1, $terms );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // change the terms
</span><span class="cx">                 $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this-&gt;taxonomy );
</span><span class="cx">                 $this-&gt;assertEquals( 2, count($tt_2) );
</span><span class="lines">@@ -292,12 +292,12 @@
</span><span class="cx">                 // make sure they're correct
</span><span class="cx">                 $terms = wp_get_object_terms($post_id, $this-&gt;taxonomy, array('fields' =&gt; 'ids', 'orderby' =&gt; 't.term_id'));
</span><span class="cx">                 $this-&gt;assertEquals( $terms_2, $terms );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make sure the tt id for 'bar' matches
</span><span class="cx">                 $this-&gt;assertEquals( $tt_1[1], $tt_2[0] );
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_set_object_terms_invalid() {
</span><span class="cx">                 $this-&gt;_insert_quick_posts(1);
</span><span class="cx">                 $post_id = end($this-&gt;post_ids);
</span><span class="lines">@@ -306,7 +306,7 @@
</span><span class="cx">                 $result = wp_set_object_terms( $post_id, array(rand_str()), rand_str() );
</span><span class="cx">                 $this-&gt;assertTrue( is_wp_error($result) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="wptestcasetest_includes_wpscriptsphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_includes_wp-scripts.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_includes_wp-scripts.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_includes_wp-scripts.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -1,22 +1,22 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> class TestWP_Scripts extends WPTestCase {
</span><span class="cx">         var $old_wp_scripts;
</span><del>-        
</del><ins>+
</ins><span class="cx">         function setUp() {
</span><span class="cx">                 parent::setUp();
</span><span class="cx">                 $this-&gt;old_wp_scripts = $GLOBALS['wp_scripts'];
</span><span class="cx">                 remove_action( 'wp_default_scripts', 'wp_default_scripts' );
</span><span class="cx">                 $GLOBALS['wp_scripts'] = new WP_Scripts();
</span><span class="cx">                 $GLOBALS['wp_scripts']-&gt;default_version = get_bloginfo( 'version' );
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function tearDown() {
</span><span class="cx">                 $GLOBALS['wp_scripts'] = $this-&gt;old_wp_scripts;
</span><span class="cx">                 add_action( 'wp_default_scripts', 'wp_default_scripts' );
</span><span class="cx">                 parent::tearDown();
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // Test versioning
</span><span class="cx">         function test_wp_enqueue_script() {
</span><span class="cx">                 $this-&gt;knownWPBug(11315);
</span></span></pre></div>
<a id="wptestcasetest_metaphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_meta.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_meta.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_meta.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> // just make sure the test framework is working
</span><span class="cx"> class WPTestMeta extends WPTestCase {
</span><span class="cx">         var $val;
</span><del>-        
</del><ins>+
</ins><span class="cx">         function setUp() {
</span><span class="cx">                 parent::setUp();
</span><span class="cx">                 $this-&gt;val = true;
</span><span class="lines">@@ -22,23 +22,23 @@
</span><span class="cx">         function test_globals() {
</span><span class="cx">                 global $test_foo;
</span><span class="cx">                 $test_foo = array('foo', 'bar', 'baz');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 function test_globals_foo() {
</span><span class="cx">                         unset($GLOBALS['test_foo'][1]);
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 test_globals_foo();
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals($test_foo, array(0=&gt;'foo', 2=&gt;'baz'));
</span><span class="cx">                 $this-&gt;assertEquals($test_foo, $GLOBALS['test_foo']);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_globals_bar() {
</span><span class="cx">                 global $test_bar;
</span><span class="cx">                 $test_bar = array('a', 'b', 'c');
</span><span class="cx">                 $this-&gt;assertEquals($test_bar, $GLOBALS['test_bar']);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // test helper utility functions
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">                 $this-&gt;assertEquals('', strip_ws(''));
</span><span class="cx">                 $this-&gt;assertEquals('foo', strip_ws('foo'));
</span><span class="cx">                 $this-&gt;assertEquals('', strip_ws(&quot;\r\n\t  \n\r\t&quot;));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $in = &lt;&lt;&lt;EOF
</span><span class="cx"> asdf
</span><span class="cx"> asdf asdf
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">                 $this-&gt;assertEquals($expected, strip_ws($in));
</span><span class="cx"> 
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_mask_input_value() {
</span><span class="cx">                 $in = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;h2&gt;Assign Authors&lt;/h2&gt;
</span></span></pre></div>
<a id="wptestcasetest_post_filteringphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_post_filtering.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_post_filtering.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_post_filtering.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -9,14 +9,14 @@
</span><span class="cx">                 parent::setUp();
</span><span class="cx">                 update_option('use_balanceTags', 1);
</span><span class="cx">                 kses_init_filters();
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function tearDown() {
</span><span class="cx">                 parent::tearDown();
</span><span class="cx">                 kses_remove_filters();
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function _insert_quick_post($title, $content, $more=array()) {
</span><span class="cx">                 return $this-&gt;post_ids[] = wp_insert_post(array_merge(array(
</span><span class="cx">                         'post_author' =&gt; $this-&gt;author-&gt;ID,
</span><span class="lines">@@ -25,10 +25,10 @@
</span><span class="cx">                         'post_content' =&gt; $content,
</span><span class="cx">                         ), $more));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // a simple test to make sure unclosed tags are fixed
</span><span class="cx">         function test_post_content_unknown_tag() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $content = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;foobar&gt;no such tag&lt;/foobar&gt;
</span><span class="cx"> EOF;
</span><span class="lines">@@ -39,13 +39,13 @@
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_insert_quick_post(__FUNCTION__, $content);
</span><span class="cx">                 $post = get_post($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals( $expected, $post-&gt;post_content );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // a simple test to make sure unbalanced tags are fixed
</span><span class="cx">         function test_post_content_unbalanced_tag() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $content = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;i&gt;italics
</span><span class="cx"> EOF;
</span><span class="lines">@@ -56,13 +56,13 @@
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_insert_quick_post(__FUNCTION__, $content);
</span><span class="cx">                 $post = get_post($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals( $expected, $post-&gt;post_content );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // test kses filtering of disallowed attribute
</span><span class="cx">         function test_post_content_disallowed_attr() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $content = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;img src='foo' width='500' href='shlorp' /&gt;
</span><span class="cx"> EOF;
</span><span class="lines">@@ -73,14 +73,14 @@
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_insert_quick_post(__FUNCTION__, $content);
</span><span class="cx">                 $post = get_post($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals( $expected, $post-&gt;post_content );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // test kses bug. xhtml does not require space before closing
</span><span class="cx">         // empty element
</span><span class="cx">         function test_post_content_xhtml_empty_elem() {
</span><del>-                $this-&gt;knownWPBug( 12394 );                
</del><ins>+                $this-&gt;knownWPBug( 12394 );
</ins><span class="cx">                 $content = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;img src='foo' width='500' height='300'/&gt;
</span><span class="cx"> EOF;
</span><span class="lines">@@ -91,13 +91,13 @@
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_insert_quick_post(__FUNCTION__, $content);
</span><span class="cx">                 $post = get_post($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals( $expected, $post-&gt;post_content );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // make sure unbalanced tags are fixed when they span a --more-- tag
</span><span class="cx">         function test_post_content_unbalanced_more() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $content = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;em&gt;some text&lt;!--more--&gt;
</span><span class="cx"> that's continued after the jump&lt;/em&gt;
</span><span class="lines">@@ -110,13 +110,13 @@
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_insert_quick_post(__FUNCTION__, $content);
</span><span class="cx">                 $post = get_post($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals( $expected, $post-&gt;post_content );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // make sure unbalanced tags are fixed when they span a --nextpage-- tag
</span><span class="cx">         function test_post_content_unbalanced_nextpage() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $content = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;em&gt;some text&lt;!--nextpage--&gt;
</span><span class="cx"> that's continued after the jump&lt;/em&gt;
</span><span class="lines">@@ -129,13 +129,13 @@
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_insert_quick_post(__FUNCTION__, $content);
</span><span class="cx">                 $post = get_post($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals( $expected, $post-&gt;post_content );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // make sure unbalanced tags are fixed when they span both --more-- and --nextpage-- tags (in that order)
</span><span class="cx">         function test_post_content_unbalanced_more_nextpage() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $content = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;em&gt;some text&lt;!--more--&gt;
</span><span class="cx"> that's continued after the jump&lt;/em&gt;
</span><span class="lines">@@ -156,13 +156,13 @@
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_insert_quick_post(__FUNCTION__, $content);
</span><span class="cx">                 $post = get_post($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals( $expected, $post-&gt;post_content );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // make sure unbalanced tags are fixed when they span both --nextpage-- and --more-- tags (in that order)
</span><span class="cx">         function test_post_content_unbalanced_nextpage_more() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $content = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;em&gt;some text&lt;!--nextpage--&gt;
</span><span class="cx"> that's continued after the jump&lt;/em&gt;
</span><span class="lines">@@ -183,15 +183,15 @@
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_insert_quick_post(__FUNCTION__, $content);
</span><span class="cx">                 $post = get_post($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals( $expected, $post-&gt;post_content );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // make sure unbalanced tags are untouched when the balance option is off
</span><span class="cx">         function test_post_content_nobalance_nextpage_more() {
</span><span class="cx"> 
</span><span class="cx">                 update_option('use_balanceTags', 0);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $content = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;em&gt;some text&lt;!--nextpage--&gt;
</span><span class="cx"> that's continued after the jump&lt;/em&gt;
</span><span class="lines">@@ -203,9 +203,9 @@
</span><span class="cx"> 
</span><span class="cx">                 $id = $this-&gt;_insert_quick_post(__FUNCTION__, $content);
</span><span class="cx">                 $post = get_post($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals( $content, $post-&gt;post_content );
</span><del>-        }                
</del><ins>+        }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="wptestcasetest_post_outputphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_post_output.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_post_output.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_post_output.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> 
</span><span class="cx"> [paragraph]my graf[/paragraph]
</span><span class="cx"> 
</span><del>-  [paragraph foo=&quot;bar&quot;]another graf with whitespace[/paragraph]  
</del><ins>+  [paragraph foo=&quot;bar&quot;]another graf with whitespace[/paragraph]
</ins><span class="cx"> 
</span><span class="cx"> An [paragraph]inline graf[/paragraph], this doesn't make much sense.
</span><span class="cx"> 
</span><span class="lines">@@ -136,14 +136,14 @@
</span><span class="cx">                 $wp_rewrite-&gt;set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
</span><span class="cx">                 $wp_rewrite-&gt;flush_rules();
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_the_content() {
</span><span class="cx">                 // permalink page
</span><span class="cx">                 $this-&gt;http('/2008/04/01/simple-gallery-test/');
</span><span class="cx">                 the_post();
</span><span class="cx">                 // filtered output
</span><span class="cx">                 $out = get_echo('the_content');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $expected = &lt;&lt;&lt;EOF
</span><span class="cx"> &lt;p&gt;There are ten images attached to this post.  Here&amp;#8217;s a gallery:&lt;/p&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -206,12 +206,12 @@
</span><span class="cx"> 
</span><span class="cx">         function test_gallery_attributes() {
</span><span class="cx">                 // make sure the gallery shortcode attributes are parsed correctly
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $id = 575;
</span><span class="cx">                 $post = get_post($id);
</span><span class="cx">                 $post-&gt;post_content = '[gallery columns=&quot;1&quot; size=&quot;medium&quot;]';
</span><span class="cx">                 wp_update_post($post);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // permalink page
</span><span class="cx">                 $this-&gt;http('/2008/04/01/simple-gallery-test/');
</span><span class="cx">                 the_post();
</span></span></pre></div>
<a id="wptestcasetest_queryphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_query.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_query.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_query.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> 
</span><span class="cx">                 $passed = true;
</span><span class="cx">                 $not_false = $not_true = array(); // properties that were not set to expected values
</span><del>-                
</del><ins>+
</ins><span class="cx">                 foreach ( $all as $query_thing ) {
</span><span class="cx">                         $result = is_callable( $query_thing ) ? call_user_func( $query_thing ) : $wp_query-&gt;$query_thing;
</span><span class="cx"> 
</span><span class="lines">@@ -425,7 +425,7 @@
</span><span class="cx">                 $this-&gt;http('/2007/09/04/');
</span><span class="cx">                 $this-&gt;assertQueryTrue('is_archive', 'is_day', 'is_date');
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // '([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;feed=$matches[3]',
</span><span class="cx">         // '([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;feed=$matches[3]',
</span><span class="cx">         function test_ym_feed() {
</span><span class="lines">@@ -501,7 +501,7 @@
</span><span class="cx">         function test_post_comment_feed() {
</span><span class="cx">                 foreach ($this-&gt;_all_post_ids() as $id) {
</span><span class="cx">                         $permalink = get_permalink($id);
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
</span><span class="cx">                         foreach ($types as $type) {
</span><span class="cx">                                         $this-&gt;http(&quot;{$permalink}feed/{$type}&quot;);
</span><span class="lines">@@ -534,9 +534,9 @@
</span><span class="cx">                 $this-&gt;http('/2007/09/04/a-post-with-multiple-pages/2/');
</span><span class="cx">                 // should is_paged be true also?
</span><span class="cx">                 $this-&gt;assertQueryTrue('is_single', 'is_singular');
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/?$' =&gt; 'index.php?attachment=$matches[1]',
</span><span class="cx">         function test_post_attachment() {
</span><span class="cx">                 $this-&gt;markTestSkipped(); // @todo ID 8 is a page in Data Set 1
</span></span></pre></div>
<a id="wptestcasetest_uploadsphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_uploads.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_uploads.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_uploads.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -3,18 +3,18 @@
</span><span class="cx"> // test various functions used by the uploader
</span><span class="cx"> 
</span><span class="cx"> class TestUploadFunctions extends WPTestCase {
</span><del>-        
</del><ins>+
</ins><span class="cx">         var $siteurl = 'http://example.com/foo';
</span><del>-        
</del><ins>+
</ins><span class="cx">         function setUp() {
</span><span class="cx">                 update_option( 'siteurl', $this-&gt;siteurl );
</span><span class="cx">                 // system defaults
</span><span class="cx">                 update_option( 'upload_path', 'wp-content/uploads' );
</span><span class="cx">                 update_option( 'upload_url_path', '' );
</span><span class="cx">                 update_option( 'uploads_use_yearmonth_folders', 1 );
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_upload_dir_default() {
</span><span class="cx">                 // wp_upload_dir() with default parameters
</span><span class="cx">                 $info = wp_upload_dir();
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx">                 $this-&gt;assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
</span><span class="cx">                 $this-&gt;assertEquals( '', $info['error'] );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_upload_dir_relative() {
</span><span class="cx">                 // wp_upload_dir() with a relative upload path
</span><span class="cx">                 update_option( 'upload_path', 'foo/bar' );
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx">                 $this-&gt;assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
</span><span class="cx">                 $this-&gt;assertEquals( '', $info['error'] );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_upload_dir_absolute() {
</span><span class="cx">                 $this-&gt;knownWPBug(5953);
</span><span class="cx">                 // wp_upload_dir() with an absolute upload path
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">                 $this-&gt;assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
</span><span class="cx">                 $this-&gt;assertEquals( '', $info['error'] );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_upload_dir_no_yearnum() {
</span><span class="cx">                 update_option( 'uploads_use_yearmonth_folders', 0 );
</span><span class="cx">                 $info = wp_upload_dir();
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">                 $this-&gt;assertEquals( '', $info['subdir'] );
</span><span class="cx">                 $this-&gt;assertEquals( '', $info['error'] );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_upload_path_absolute() {
</span><span class="cx">                 update_option( 'upload_url_path', 'http://example.org/asdf' );
</span><span class="cx">                 $info = wp_upload_dir();
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">                 $this-&gt;assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
</span><span class="cx">                 $this-&gt;assertEquals( '', $info['error'] );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_upload_dir_empty() {
</span><span class="cx">                 // upload path setting is empty - it should default to 'wp-content/uploads'
</span><span class="cx">                 update_option('upload_path', '');
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">                 $this-&gt;assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
</span><span class="cx">                 $this-&gt;assertEquals( '', $info['error'] );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="wptestcasetest_userphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_user.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_user.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_user.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -112,10 +112,10 @@
</span><span class="cx"> 
</span><span class="cx">                 // there is already some stuff in the array
</span><span class="cx">                 $this-&gt;assertTrue(is_array(get_usermeta($user_id)));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 foreach ($vals as $k=&gt;$v)
</span><span class="cx">                         update_usermeta( $user_id, $k, $v );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // get the complete usermeta array
</span><span class="cx">                 $out = get_usermeta($user_id);
</span><span class="cx"> 
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx">                 // so we'll just check to make sure our values are included somewhere.
</span><span class="cx">                 foreach ($vals as $v)
</span><span class="cx">                         $this-&gt;assertTrue(in_array($v, $out));
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 // delete one key and check again
</span><span class="cx">                 $key_to_delete = array_pop(array_keys($vals));
</span><span class="cx">                 delete_usermeta($user_id, $key_to_delete);
</span></span></pre></div>
<a id="wptestcasetest_user_capabilitiesphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_user_capabilities.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_user_capabilities.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testcase/test_user_capabilities.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx">                 // delete any users that were created during tests
</span><span class="cx">                 foreach ($this-&gt;user_ids as $id)
</span><span class="cx">                         wp_delete_user($id);
</span><del>-                        
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function _flush_roles() {
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('manage_categories'));
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('level_3'));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_user_contributor() {
</span><span class="cx">                 $id = $this-&gt;_make_user('contributor');
</span><span class="cx">                 $user = new WP_User($id);
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">                 $id = $this-&gt;_make_user('subscriber');
</span><span class="cx">                 $user = new WP_User($id);
</span><span class="cx">                 $user-&gt;add_role('contributor');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // nuke and re-fetch the object to make sure it was stored
</span><span class="cx">                 $user = NULL;
</span><span class="cx">                 $user = new WP_User($id);
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('edit_published_posts'));
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('level_2'));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_add_empty_role() {
</span><span class="cx">                 // add_role($role, $display_name, $capabilities = '')
</span><span class="cx">                 // randomly named role with no capabilities
</span><span class="lines">@@ -176,13 +176,13 @@
</span><span class="cx">                 add_role($role_name, 'Janitor', array());
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="cx">                 $this-&gt;assertTrue($wp_roles-&gt;is_role($role_name));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $id = $this-&gt;_make_user($role_name);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $user = new WP_User($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(array($role_name), $user-&gt;roles);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // user shouldn't have any capabilities; test a quick sample
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('upload_files'));
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('edit_published_posts'));
</span><span class="lines">@@ -194,8 +194,8 @@
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="cx">                 $this-&gt;assertFalse($wp_roles-&gt;is_role($role_name));
</span><span class="cx">         }
</span><del>-        
-        
</del><ins>+
+
</ins><span class="cx">         function test_add_role() {
</span><span class="cx">                 // add_role($role, $display_name, $capabilities = '')
</span><span class="cx">                 // randomly named role with a few capabilities
</span><span class="lines">@@ -204,13 +204,13 @@
</span><span class="cx">                 add_role($role_name, 'Janitor', array('edit_posts'=&gt;true, 'edit_pages'=&gt;true, 'level_0'=&gt;true, 'level_1'=&gt;true, 'level_2'=&gt;true));
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="cx">                 $this-&gt;assertTrue($wp_roles-&gt;is_role($role_name));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $id = $this-&gt;_make_user($role_name);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $user = new WP_User($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertEquals(array($role_name), $user-&gt;roles);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // the user should have all the above caps
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap($role_name));
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('edit_posts'));
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('level_0'));
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('level_1'));
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('level_2'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // shouldn't have any other caps
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('upload_files'));
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('edit_published_posts'));
</span><span class="lines">@@ -230,19 +230,19 @@
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="cx">                 $this-&gt;assertFalse($wp_roles-&gt;is_role($role_name));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_role_add_cap() {
</span><span class="cx">                 // change the capabilites associated with a role and make sure the change is reflected in has_cap()
</span><del>-                
</del><ins>+
</ins><span class="cx">                 global $wp_roles;
</span><span class="cx">                 $role_name = rand_str();
</span><span class="cx">                 add_role( $role_name, 'Janitor', array('level_1'=&gt;true) );
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="cx">                 $this-&gt;assertTrue( $wp_roles-&gt;is_role($role_name) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // assign a user to that role
</span><span class="cx">                 $id = $this-&gt;_make_user($role_name);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // now add a cap to the role
</span><span class="cx">                 $wp_roles-&gt;add_cap($role_name, 'sweep_floor');
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="lines">@@ -254,7 +254,7 @@
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap($role_name));
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('level_1'));
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('sweep_floor'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // shouldn't have any other caps
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('upload_files'));
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('edit_published_posts'));
</span><span class="lines">@@ -265,21 +265,21 @@
</span><span class="cx">                 remove_role($role_name);
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="cx">                 $this-&gt;assertFalse($wp_roles-&gt;is_role($role_name));
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_role_remove_cap() {
</span><span class="cx">                 // change the capabilites associated with a role and make sure the change is reflected in has_cap()
</span><del>-                
</del><ins>+
</ins><span class="cx">                 global $wp_roles;
</span><span class="cx">                 $role_name = rand_str();
</span><span class="cx">                 add_role( $role_name, 'Janitor', array('level_1'=&gt;true, 'sweep_floor'=&gt;true, 'polish_doorknobs'=&gt;true) );
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="cx">                 $this-&gt;assertTrue( $wp_roles-&gt;is_role($role_name) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // assign a user to that role
</span><span class="cx">                 $id = $this-&gt;_make_user($role_name);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // now remove a cap from the role
</span><span class="cx">                 $wp_roles-&gt;remove_cap($role_name, 'polish_doorknobs');
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="lines">@@ -291,7 +291,7 @@
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap($role_name));
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('level_1'));
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('sweep_floor'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // shouldn't have the removed cap
</span><span class="cx">                 $this-&gt;assertFalse($user-&gt;has_cap('polish_doorknobs'));
</span><span class="cx"> 
</span><span class="lines">@@ -299,20 +299,20 @@
</span><span class="cx">                 remove_role($role_name);
</span><span class="cx">                 $this-&gt;_flush_roles();
</span><span class="cx">                 $this-&gt;assertFalse($wp_roles-&gt;is_role($role_name));
</span><del>-                
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function test_user_add_cap() {
</span><span class="cx">                 // add an extra capability to a user
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // there are two contributors
</span><span class="cx">                 $id_1 = $this-&gt;_make_user('contributor');
</span><span class="cx">                 $id_2 = $this-&gt;_make_user('contributor');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // user 1 has an extra capability
</span><span class="cx">                 $user_1 = new WP_User($id_1);
</span><span class="cx">                 $user_1-&gt;add_cap('publish_posts');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // re-fetch both users from the db
</span><span class="cx">                 $user_1 = new WP_User($id_1);
</span><span class="cx">                 $user_2 = new WP_User($id_2);
</span><span class="lines">@@ -324,7 +324,7 @@
</span><span class="cx">                 // check the extra cap on both users
</span><span class="cx">                 $this-&gt;assertTrue($user_1-&gt;has_cap('publish_posts'));
</span><span class="cx">                 $this-&gt;assertFalse($user_2-&gt;has_cap('publish_posts'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make sure the other caps didn't get messed up
</span><span class="cx">                 $this-&gt;assertTrue($user_1-&gt;has_cap('edit_posts'));
</span><span class="cx">                 $this-&gt;assertTrue($user_1-&gt;has_cap('read'));
</span><span class="lines">@@ -338,15 +338,15 @@
</span><span class="cx"> 
</span><span class="cx">         function test_user_remove_cap() {
</span><span class="cx">                 // add an extra capability to a user then remove it
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // there are two contributors
</span><span class="cx">                 $id_1 = $this-&gt;_make_user('contributor');
</span><span class="cx">                 $id_2 = $this-&gt;_make_user('contributor');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // user 1 has an extra capability
</span><span class="cx">                 $user_1 = new WP_User($id_1);
</span><span class="cx">                 $user_1-&gt;add_cap('publish_posts');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // now remove the extra cap
</span><span class="cx">                 $user_1-&gt;remove_cap('publish_posts');
</span><span class="cx"> 
</span><span class="lines">@@ -360,52 +360,52 @@
</span><span class="cx"> 
</span><span class="cx">                 // check the removed cap on both users
</span><span class="cx">                 $this-&gt;assertFalse($user_1-&gt;has_cap('publish_posts'));
</span><del>-                $this-&gt;assertFalse($user_2-&gt;has_cap('publish_posts'));                
</del><ins>+                $this-&gt;assertFalse($user_2-&gt;has_cap('publish_posts'));
</ins><span class="cx"> 
</span><span class="cx">         }
</span><del>-                
</del><ins>+
</ins><span class="cx">         function test_user_level_update() {
</span><span class="cx">                 // make sure the user_level is correctly set and changed with the user's role
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // user starts as an author
</span><span class="cx">                 $id = $this-&gt;_make_user('author');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // author = user level 2
</span><span class="cx">                 $this-&gt;assertEquals( 2, $user-&gt;user_level );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // they get promoted to editor - level should get bumped to 7
</span><span class="cx">                 $user-&gt;set_role('editor');
</span><span class="cx">                 $this-&gt;assertEquals( 7, $user-&gt;user_level );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // demoted to contributor - level is reduced to 1
</span><span class="cx">                 $user-&gt;set_role('contributor');
</span><span class="cx">                 $this-&gt;assertEquals( 1, $user-&gt;user_level );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // if they have two roles, user_level should be the max of the two
</span><span class="cx">                 $user-&gt;add_role('editor');
</span><span class="cx">                 $this-&gt;assertEquals(array('contributor', 'editor'), $user-&gt;roles);
</span><span class="cx">                 $this-&gt;assertEquals( 7, $user-&gt;user_level );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_user_remove_all_caps() {
</span><span class="cx">                 // user starts as an author
</span><span class="cx">                 $id = $this-&gt;_make_user('author');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // add some extra capabilities
</span><span class="cx">                 $user-&gt;add_cap('make_coffee');
</span><span class="cx">                 $user-&gt;add_cap('drink_coffee');
</span><span class="cx"> 
</span><span class="cx">                 // re-fetch
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('make_coffee'));
</span><span class="cx">                 $this-&gt;assertTrue($user-&gt;has_cap('drink_coffee'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // all caps are removed
</span><span class="cx">                 $user-&gt;remove_all_caps();
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // re-fetch
</span><span class="cx">                 $user = new WP_User($id);
</span><span class="cx"> 
</span><span class="lines">@@ -421,13 +421,13 @@
</span><span class="cx"> 
</span><span class="cx">                 // user level should be empty
</span><span class="cx">                 $this-&gt;assertNull( $user-&gt;user_level );
</span><del>-                
-                
</del><ins>+
+
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function test_post_meta_caps() {
</span><span class="cx">                 // simple tests for some common meta capabilities
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make a [pst
</span><span class="cx">                 $this-&gt;_insert_quick_posts(1);
</span><span class="cx">                 $post = end($this-&gt;post_ids);
</span><span class="lines">@@ -435,13 +435,13 @@
</span><span class="cx">                 // the author of the post
</span><span class="cx">                 $author = new WP_User($this-&gt;author-&gt;ID);
</span><span class="cx">                 $author-&gt;set_role('author');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // add some other users
</span><span class="cx">                 $admin = new WP_User($this-&gt;_make_user('administrator'));
</span><span class="cx">                 $author_2 = new WP_User($this-&gt;_make_user('author'));
</span><span class="cx">                 $editor = new WP_User($this-&gt;_make_user('editor'));
</span><span class="cx">                 $contributor = new WP_User($this-&gt;_make_user('contributor'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // administrators, editors and the post owner can edit it
</span><span class="cx">                 $this-&gt;assertTrue($admin-&gt;has_cap('edit_post', $post));
</span><span class="cx">                 $this-&gt;assertTrue($author-&gt;has_cap('edit_post', $post));
</span><span class="lines">@@ -449,7 +449,7 @@
</span><span class="cx">                 // other authors and contributors can't
</span><span class="cx">                 $this-&gt;assertFalse($author_2-&gt;has_cap('edit_post', $post));
</span><span class="cx">                 $this-&gt;assertFalse($contributor-&gt;has_cap('edit_post', $post));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // administrators, editors and the post owner can delete it
</span><span class="cx">                 $this-&gt;assertTrue($admin-&gt;has_cap('delete_post', $post));
</span><span class="cx">                 $this-&gt;assertTrue($author-&gt;has_cap('delete_post', $post));
</span><span class="lines">@@ -486,7 +486,7 @@
</span><span class="cx"> 
</span><span class="cx">         function test_page_meta_caps() {
</span><span class="cx">                 // simple tests for some common meta capabilities
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make a page
</span><span class="cx">                 $this-&gt;_insert_quick_pages(1);
</span><span class="cx">                 $page = end($this-&gt;post_ids);
</span><span class="lines">@@ -494,13 +494,13 @@
</span><span class="cx">                 // the author of the page
</span><span class="cx">                 $author = new WP_User($this-&gt;author-&gt;ID);
</span><span class="cx">                 $author-&gt;set_role('author');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // add some other users
</span><span class="cx">                 $admin = new WP_User($this-&gt;_make_user('administrator'));
</span><span class="cx">                 $author_2 = new WP_User($this-&gt;_make_user('author'));
</span><span class="cx">                 $editor = new WP_User($this-&gt;_make_user('editor'));
</span><span class="cx">                 $contributor = new WP_User($this-&gt;_make_user('contributor'));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // administrators, editors and the post owner can edit it
</span><span class="cx">                 $this-&gt;assertTrue($admin-&gt;has_cap('edit_page', $page));
</span><span class="cx">                 $this-&gt;assertTrue($editor-&gt;has_cap('edit_page', $page));
</span><span class="lines">@@ -508,7 +508,7 @@
</span><span class="cx">                 $this-&gt;assertFalse($author-&gt;has_cap('edit_page', $page));
</span><span class="cx">                 $this-&gt;assertFalse($author_2-&gt;has_cap('edit_page', $page));
</span><span class="cx">                 $this-&gt;assertFalse($contributor-&gt;has_cap('edit_page', $page));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // administrators, editors and the post owner can delete it
</span><span class="cx">                 $this-&gt;assertTrue($admin-&gt;has_cap('delete_page', $page));
</span><span class="cx">                 $this-&gt;assertTrue($editor-&gt;has_cap('delete_page', $page));
</span><span class="lines">@@ -517,20 +517,20 @@
</span><span class="cx">                 $this-&gt;assertFalse($author_2-&gt;has_cap('delete_page', $page));
</span><span class="cx">                 $this-&gt;assertFalse($contributor-&gt;has_cap('delete_page', $page));
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function test_usermeta_caps() {
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;knownWPBug(5541);
</span><span class="cx"> 
</span><span class="cx">                 // make sure an old style usermeta capabilities entry is still recognized by the new code
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $id = $this-&gt;_make_user('author');
</span><span class="cx">                 $user = new WP_User($id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 global $wpdb;
</span><span class="cx">                 if (!empty($wpdb-&gt;user_role))
</span><span class="cx">                         $wpdb-&gt;query(&quot;DELETE FROM {$wpdb-&gt;user_role} WHERE user_id = {$id}&quot;);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 update_usermeta($id, $user-&gt;cap_key, array('editor' =&gt; true));
</span><span class="cx"> 
</span><span class="cx">                 $user = new WP_User($id);
</span><span class="lines">@@ -549,15 +549,15 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function test_upgrade() {
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // only relevant with this patch
</span><span class="cx">                 $this-&gt;knownWPBug(5540);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if ( !is_callable('upgrade_user_roles') )
</span><span class="cx">                         $this-&gt;markTestSkipped('depends on patch #5540');
</span><del>-                
</del><ins>+
</ins><span class="cx">                 global $wpdb, $blog_id;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make some users with old style usermeta roles and caps
</span><span class="cx">                 $id = array();
</span><span class="cx">                 for ($i=0; $i&lt;5; $i++) {
</span><span class="lines">@@ -574,9 +574,9 @@
</span><span class="cx">                 update_usermeta($id[3], $user-&gt;cap_key, array('contributor' =&gt; true, 'author' =&gt; true));
</span><span class="cx">                 // a user with per-user capabilities
</span><span class="cx">                 update_usermeta($id[4], $user-&gt;cap_key, array('subscriber' =&gt; true, 'edit_posts' =&gt; true, 'upload_files' =&gt; true));
</span><del>-                
</del><ins>+
</ins><span class="cx">                 upgrade_user_roles($wpdb-&gt;prefix, $blog_id);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // make sure the upgrade did insert user_role rows
</span><span class="cx">                 foreach ( $id as $user_id ) {
</span><span class="cx">                         $this-&gt;assertTrue( $wpdb-&gt;get_row(&quot;SELECT user_role_id FROM {$wpdb-&gt;user_role} WHERE user_id = {$user_id}&quot;) &gt; 0 );
</span><span class="lines">@@ -603,7 +603,7 @@
</span><span class="cx">                 $this-&gt;assertFalse($user_1-&gt;has_cap('level_8'));
</span><span class="cx">                 $old_caps = get_usermeta($id[1], $user_1-&gt;cap_key);
</span><span class="cx">                 $this-&gt;assertEquals( array(), $old_caps );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $user_2 = new WP_User($id[2]);
</span><span class="cx">                 $this-&gt;assertEquals(array('subscriber'), $user_2-&gt;roles);
</span><span class="cx">                 $this-&gt;assertTrue($user_2-&gt;has_cap('read'));
</span><span class="lines">@@ -613,7 +613,7 @@
</span><span class="cx">                 $this-&gt;assertFalse($user_2-&gt;has_cap('level_1'));
</span><span class="cx">                 $old_caps = get_usermeta($id[2], $user_2-&gt;cap_key);
</span><span class="cx">                 $this-&gt;assertEquals( array(), $old_caps );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // user 3 has two roles
</span><span class="cx">                 $user_3 = new WP_User($id[3]);
</span><span class="cx">                 $this-&gt;assertEquals(array('contributor', 'author'), $user_3-&gt;roles);
</span><span class="lines">@@ -626,7 +626,7 @@
</span><span class="cx">                 $this-&gt;assertFalse($user_3-&gt;has_cap('level_3'));
</span><span class="cx">                 $old_caps = get_usermeta($id[3], $user_3-&gt;cap_key);
</span><span class="cx">                 $this-&gt;assertEquals( array(), $old_caps );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // user 4 is a subscriber with some extra per-user caps
</span><span class="cx">                 $user_4 = new WP_User($id[4]);
</span><span class="cx">                 $this-&gt;assertEquals(array('subscriber'), $user_4-&gt;roles);
</span><span class="lines">@@ -640,13 +640,13 @@
</span><span class="cx">                 // the extra caps should still be stored in usermeta
</span><span class="cx">                 $old_caps = get_usermeta($id[4], $user_4-&gt;cap_key);
</span><span class="cx">                 $this-&gt;assertEquals( array('edit_posts' =&gt; true, 'upload_files' =&gt; true), $old_caps );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // quick test for get_users_of_blog
</span><span class="cx">                 $users = get_users_of_blog();
</span><span class="cx">                 #dmp('orig users', $this-&gt;orig_users);
</span><span class="cx">                 #dmp('now users', $users);
</span><span class="cx">                 $this-&gt;assertEquals( 5, count($users) - count($this-&gt;orig_users) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 #dmp('get_roles_with_cap edit_posts', get_roles_with_cap('edit_posts'));
</span><span class="cx">                 #dmp('get_users_of_blog', get_users_of_blog());
</span><span class="cx">                 #dmp('get_users_with_cap edit_posts', get_users_with_cap('edit_posts'));
</span><span class="lines">@@ -656,7 +656,7 @@
</span><span class="cx">                 global $wp_roles;
</span><span class="cx">                 foreach (array_keys($wp_roles-&gt;roles) as $role) {
</span><span class="cx">                         $obj = $wp_roles-&gt;role_objects[$role];
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         echo &quot;\nadd_role('{$role}', '{$obj-&gt;name}', &quot;.var_export($obj-&gt;capabilities, true).&quot;\n&quot;;
</span><span class="cx">                         echo &quot;)\n&quot;;
</span><span class="cx">                 }
</span></span></pre></div>
<a id="wptestlibbasephp"></a>
<div class="modfile"><h4>Modified: wp-testlib/base.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testlib/base.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testlib/base.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 _enable_wp_die();
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">          * Treat any error, which wasn't handled by PHPUnit as a failure
</span><span class="cx">          */
</span><span class="lines">@@ -263,7 +263,7 @@
</span><span class="cx">         // with a separate test function for each post.
</span><span class="cx">         function _generate_post_content_test(&amp;$posts, $separate_funcs = true) {
</span><span class="cx">                 global $wpdb;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $out = '';
</span><span class="cx">                 if (!$separate_funcs)
</span><span class="cx">                         $out .= &quot;\n\tfunction test_all_posts() {\n&quot;;
</span><span class="lines">@@ -312,15 +312,15 @@
</span><span class="cx">                                         $out .= &quot;\t\t&quot;.'$this-&gt;assertEquals(\''.addslashes($tag-&gt;slug).'\', $tags['.$j.']-&gt;slug);'.&quot;\n&quot;;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $meta = $wpdb-&gt;get_results(&quot;SELECT DISTINCT meta_key FROM {$wpdb-&gt;postmeta} WHERE post_id = $post-&gt;ID&quot;);
</span><span class="cx">                         #$out .= &quot;\t\t&quot;.'$this-&gt;assertEquals('.count($postmeta).', count($meta));'.&quot;\n&quot;;
</span><span class="cx">                         foreach ($meta as $m) {
</span><span class="cx">                                 #$out .= &quot;\t\t&quot;.'$meta = get_post_meta($post-&gt;ID, \''.addslashes($m-&gt;meta_key).'\', true);'.&quot;\n&quot;;
</span><span class="cx">                                 $out .= &quot;\t\t&quot;.'$this-&gt;assertEquals('.var_export(get_post_meta($post-&gt;ID, $m-&gt;meta_key, false), true).', get_post_meta($post-&gt;ID, \''.addslashes($m-&gt;meta_key).'\', false));'.&quot;\n&quot;;
</span><span class="cx">                         }
</span><del>-                        
-                                                
</del><ins>+
+
</ins><span class="cx">                         $comments = $wpdb-&gt;get_results($wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;comments WHERE comment_post_ID = %d ORDER BY comment_date DESC&quot;, $post-&gt;ID));
</span><span class="cx"> 
</span><span class="cx">                         $out .= &quot;\t\t&quot;.'$comments = $wpdb-&gt;get_results($wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;comments WHERE comment_post_ID = %d ORDER BY comment_date DESC&quot;, $post-&gt;ID));'.&quot;\n&quot;;
</span><span class="lines">@@ -356,10 +356,10 @@
</span><span class="cx">                 $table_list = join(' ', $args);
</span><span class="cx">                 system('mysqldump -u '.DB_USER.' --password='.DB_PASSWORD.' -cqnt '.DB_NAME.' '.$table_list);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function _load_sql_dump($file) {
</span><span class="cx">                 $lines = file($file);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 global $wpdb;
</span><span class="cx">                 foreach ($lines as $line) {
</span><span class="cx">                         if ( !trim($line) or preg_match('/^-- /', $line) )
</span><span class="lines">@@ -393,7 +393,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /**
</span><del>-         * Checks if track ticket #$ticket_id is resolved 
</del><ins>+         * Checks if track ticket #$ticket_id is resolved
</ins><span class="cx">          *
</span><span class="cx">          * @return bool|null true if the ticket is resolved, false if not resolved, null on error
</span><span class="cx">          */
</span><span class="lines">@@ -451,22 +451,22 @@
</span><span class="cx">                         $this-&gt;markTestSkipped();
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
-        
</del><ins>+
+
</ins><span class="cx">         // convenience function: return the # of posts associated with a tag
</span><span class="cx">         function _tag_count($name) {
</span><span class="cx">                 $t = get_term_by('name', $name, 'post_tag');
</span><span class="cx">                 if ($t)
</span><span class="cx">                         return $t-&gt;count;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // convenience function: return the # of posts associated with a category
</span><span class="cx">         function _category_count($name) {
</span><span class="cx">                 $t = get_term_by('name', $name, 'category');
</span><span class="cx">                 if ($t)
</span><span class="cx">                         return $t-&gt;count;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // simple functions for loading and running tests
</span><span class="lines">@@ -518,7 +518,7 @@
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * Simple function to list out all the test cases for command line interfaces
</span><del>- * 
</del><ins>+ *
</ins><span class="cx">  * @param $test_classes The test casses array as returned by wptest_get_all_test_cases()
</span><span class="cx">  * @return none
</span><span class="cx">  */
</span><span class="lines">@@ -526,7 +526,7 @@
</span><span class="cx">         echo &quot;\nWordPress Tests available TestCases:\n\n&quot;;
</span><span class="cx">         natcasesort( $test_classes );
</span><span class="cx">         echo array_reduce($test_classes, '_wptest_listall_testcases_helper');
</span><del>-        echo &quot;\nUse -t TestCaseName to run individual test cases\n&quot;;        
</del><ins>+        echo &quot;\nUse -t TestCaseName to run individual test cases\n&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function _wptest_listall_testcases_helper( $current, $item ) {
</span></span></pre></div>
<a id="wptestlibgetoptphp"></a>
<div class="modfile"><h4>Modified: wp-testlib/getopt.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testlib/getopt.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testlib/getopt.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -1,93 +1,93 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> /**
</span><span class="cx">  * getopt relacement / extenstion
</span><del>- * 
</del><ins>+ *
</ins><span class="cx">  *  prior to PHP 5.3 getopt is not supported on the windows plattform
</span><span class="cx">  *  and it does not support long options on other plattforms as well.
</span><del>- *  
- *  this file offers a _getopt() function as a replacement. via the  
</del><ins>+ *
+ *  this file offers a _getopt() function as a replacement. via the
</ins><span class="cx">  *  php.net manual page for getop().
</span><del>- *  
</del><ins>+ *
</ins><span class="cx">  *  original author is 可愛柚爸 / uberlinuxguy at tulg dot org
</span><del>- *  
</del><ins>+ *
</ins><span class="cx">  *  the function has been taken from that website, and refactored
</span><span class="cx">  *  into a helper class to increase the protability
</span><span class="cx">  *
</span><span class="cx">  * @version 1.0 hakre-1
</span><span class="cx">  *
</span><span class="cx">  *  CHANGELOG:
</span><del>- *  
</del><ins>+ *
</ins><span class="cx">  *   - refactored the functions into a class (better portability)
</span><span class="cx">  *   - reformatted the code (copy &amp; paste issues)
</span><del>- *   - removed eval calls (commented)   
</del><ins>+ *   - removed eval calls (commented)
</ins><span class="cx">  *   - smarter quoting
</span><span class="cx">  *   - indentation on tab and cleanup of whitespaces
</span><span class="cx">  *   - deprecated string access ({}) fixed with [].
</span><del>- *  
</del><ins>+ *
</ins><span class="cx">  *  TODO:
</span><del>- *   (empty) 
- *  
- *  
</del><ins>+ *   (empty)
+ *
+ *
</ins><span class="cx">  *  @link http://www.ntu.beautifulworldco.com/weblog/?p=526
</span><span class="cx">  *  @link http://www.php.net/getopt
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * getoptParser
</span><del>- * 
</del><ins>+ *
</ins><span class="cx">  * getopt() compatible argv parsing.
</span><del>- * 
</del><ins>+ *
</ins><span class="cx">  * @see getoptParser::getopt()
</span><span class="cx">  * @see getoptParser::split_para()
</span><span class="cx">  */
</span><span class="cx"> class getoptParser {
</span><span class="cx">         /**
</span><del>-         * getopt()          
-         * 
</del><ins>+         * getopt()
+         *
</ins><span class="cx">          * Usage: _getopt ( [$flag,] $short_option [, $long_option] );
</span><del>-         * 
-         * Note that another function split_para() is required, which can be 
</del><ins>+         *
+         * Note that another function split_para() is required, which can be
</ins><span class="cx">          * found in the same page.
</span><del>-         * 
-         * _getopt() fully simulates getopt() which is described at 
-         * (@see http://us.php.net/manual/en/function.getopt.php} , including long 
-         * options for PHP version under 5.3.0. (Prior to 5.3.0, long options was 
</del><ins>+         *
+         * _getopt() fully simulates getopt() which is described at
+         * (@see http://us.php.net/manual/en/function.getopt.php} , including long
+         * options for PHP version under 5.3.0. (Prior to 5.3.0, long options was
</ins><span class="cx">          * only available on few systems)
</span><del>-         * 
-         * Besides legacy usage of getopt(), I also added a new option to manipulate 
-         * your own argument lists instead of those from command lines. This new 
</del><ins>+         *
+         * Besides legacy usage of getopt(), I also added a new option to manipulate
+         * your own argument lists instead of those from command lines. This new
</ins><span class="cx">          * option can be a string or an array such as
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          *  $flag = &quot;-f value_f -ab --required 9 --optional=PK --option -v test -k&quot;;
</span><del>-         *  
</del><ins>+         *
</ins><span class="cx">          *  or
</span><del>-         *  
</del><ins>+         *
</ins><span class="cx">          *  $flag = array ( &quot;-f&quot;, &quot;value_f&quot;, &quot;-ab&quot;, &quot;--required&quot;, &quot;9&quot;, &quot;--optional=PK&quot;, &quot;--option&quot; );
</span><del>-         *  
</del><ins>+         *
</ins><span class="cx">          *  So there are four ways to work with _getopt(),
</span><del>-         *  
</del><ins>+         *
</ins><span class="cx">          *  1. _getopt ( $short_option );
</span><span class="cx">          *        it's a legacy usage, same as getopt ( $short_option ).
</span><del>-         *        
</del><ins>+         *
</ins><span class="cx">          *  2. _getopt ( $short_option, $long_option );
</span><span class="cx">          *        it's a legacy usage, same as getopt ( $short_option, $long_option ).
</span><del>-         *        
</del><ins>+         *
</ins><span class="cx">          *  3. _getopt ( $flag, $short_option );
</span><span class="cx">          *        use your own argument lists instead of command line arguments.
</span><del>-         *        
</del><ins>+         *
</ins><span class="cx">          *  4. _getopt ( $flag, $short_option, $long_option );
</span><del>-         *        use your own argument lists instead of command line arguments. 
-         * 
</del><ins>+         *        use your own argument lists instead of command line arguments.
+         *
</ins><span class="cx">          * @version 1.3
</span><span class="cx">          * @date 2009/05/30 (taken from the website 2010-01-11)
</span><span class="cx">          * @author 可愛柚爸 / uberlinuxguy at tulg dot org
</span><span class="cx">          * @see http://www.ntu.beautifulworldco.com/weblog/?p=526
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * @params mixed
</span><span class="cx">          * @return array
</span><span class="cx">          */
</span><span class="cx">         static function getopt() {
</span><del>-        
</del><ins>+
</ins><span class="cx">                 if ( func_num_args() == 1 ) {
</span><span class="cx">                         $flag =  $flag_array = $GLOBALS['argv'];
</span><span class="cx">                         $short_option = func_get_arg ( 0 );
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">                 } else {
</span><span class="cx">                         exit ( &quot;wrong options\n&quot; );
</span><span class="cx">                 }
</span><del>-        
</del><ins>+
</ins><span class="cx">                 $short_option         = trim($short_option);
</span><span class="cx">                 $short_no_value       = array();
</span><span class="cx">                 $short_required_value = array();
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">                 $long_required_value  = array();
</span><span class="cx">                 $long_optional_value  = array();
</span><span class="cx">                 $options              = array();
</span><del>-        
</del><ins>+
</ins><span class="cx">                 for ( $i = 0; $i &lt; strlen ( $short_option ); ) {
</span><span class="cx">                         if ( $short_option[$i] != ':' ) {
</span><span class="cx">                                 if ( $i == strlen ( $short_option ) - 1 ) {
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx">                                 continue;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-        
</del><ins>+
</ins><span class="cx">                 foreach ( $long_option as $a ) {
</span><span class="cx">                         if ( substr( $a, -2 ) == '::' ) {
</span><span class="cx">                                 $long_optional_value[] = substr($a, 0, -2);
</span><span class="lines">@@ -151,16 +151,16 @@
</span><span class="cx">                                 $long_no_value[] = $a;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-        
</del><ins>+
</ins><span class="cx">                 if ( is_array ( $flag ) ) {
</span><span class="cx">                         $flag_array = $flag;
</span><span class="cx">                 } else {
</span><span class="cx">                         $flag = &quot;- $flag&quot;;
</span><span class="cx">                         $flag_array = self::_split_para($flag);
</span><span class="cx">                 }
</span><del>-        
</del><ins>+
</ins><span class="cx">                 for ( $i = 0; $i &lt; count($flag_array); ) {
</span><del>-        
</del><ins>+
</ins><span class="cx">                         if ( !$flag_array[$i] || ( '-' == $flag_array[$i] ) ) {
</span><span class="cx">                                 $i++;
</span><span class="cx">                                 continue;
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx">                                 $i++;
</span><span class="cx">                                 continue;
</span><span class="cx">                         }
</span><del>-        
</del><ins>+
</ins><span class="cx">                         if ( substr($flag_array[$i], 0, 2) == '--' ) {
</span><span class="cx">                                 if (strpos($flag_array[$i], '=') != false) {
</span><span class="cx">                                         list($key, $value) = explode('=', substr($flag_array[$i], 2), 2);
</span><span class="lines">@@ -186,13 +186,13 @@
</span><span class="cx">                                                         $options[$key][] = $flag_array[$i+1];
</span><span class="cx">                                                         $i++;
</span><span class="cx">                                                 } else {
</span><del>-                                                        $options[$key][] = FALSE;                                                
</del><ins>+                                                        $options[$key][] = FALSE;
</ins><span class="cx">                                                 }
</span><span class="cx">                                         } elseif ( in_array(substr( $flag_array[$i], 2 ), $long_no_value ) ) {
</span><span class="cx">                                                 $options[$key][] = FALSE;
</span><span class="cx">                                         }
</span><span class="cx">                                         $i++;
</span><del>-                                        continue;                                
</del><ins>+                                        continue;
</ins><span class="cx">                                 }
</span><span class="cx">                         } elseif ( $flag_array[$i][0] == '-' &amp;&amp; $flag_array[$i][1] != '-' ) {
</span><span class="cx">                                 for ( $j=1; $j &lt; strlen($flag_array[$i]); $j++ ) {
</span><span class="lines">@@ -206,13 +206,13 @@
</span><span class="cx">                                                                 $options[$flag_array[$i][$j]][] = $flag_array[$i+1];
</span><span class="cx">                                                                 $i++;
</span><span class="cx">                                                         } else {
</span><del>-                                                                $options[$flag_array[$i][$j]][] = FALSE;                                                                
-                                                        }                                                        
</del><ins>+                                                                $options[$flag_array[$i][$j]][] = FALSE;
+                                                        }
</ins><span class="cx">                                                 } else {
</span><span class="cx">                                                         $options[$flag_array[$i][$j]][] = substr ( $flag_array[$i], $j + 1 );
</span><span class="cx">                                                 }
</span><span class="cx">                                                 $plus_i = 0;
</span><del>-                                                $i++;                                                        
</del><ins>+                                                $i++;
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         } elseif ( in_array($flag_array[$i][$j], $short_no_value ) ) {
</span><span class="cx">                                                 $options[$flag_array[$i][$j]][] = FALSE;
</span><span class="lines">@@ -228,49 +228,49 @@
</span><span class="cx">                         } // if
</span><span class="cx">                         $i++;
</span><span class="cx">                 } // for
</span><del>-        
</del><ins>+
</ins><span class="cx">                 // reduce options array depth if possible
</span><span class="cx">                 foreach ( $options as $key =&gt; $value ) {
</span><span class="cx">                         if ( count($value) == 1 )
</span><span class="cx">                                 $options[$key] = $value[0];
</span><span class="cx">                 }
</span><del>-        
</del><ins>+
</ins><span class="cx">                 return $options;
</span><del>-        
</del><ins>+
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * split parameters
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * static helper function
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * @version 1.0
</span><span class="cx">          * @date    2008/08/19
</span><span class="cx">          * @see     http://www.ntu.beautifulworldco.com/weblog/?p=526
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * This function is to parse parameters and split them into smaller pieces.
</span><span class="cx">          * preg_split() does similar thing but in our function, besides &quot;space&quot;, we
</span><span class="cx">          * also take the three symbols &quot; (double quote), '(single quote),
</span><span class="cx">          * and \ (backslash) into consideration because things in a pair of &quot; or '
</span><span class="cx">          * should be grouped together.
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * As an example, this parameter list
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * -f &quot;test 2&quot; -ab --required &quot;t\&quot;est 1&quot; --optional=&quot;te'st 3&quot; --option -v 'test 4'
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * will be splited into
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * -f; test 2; -ab; --required; t&quot;est 1; --optional=te'st 3; --option; -v; test 4
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * see the code below:
</span><del>-         * 
-         * &lt;code&gt; 
-         *        $pattern = &quot;-f \&quot;test 2\&quot; -ab --required \&quot;t\\\&quot;est 1\&quot; --optional=\&quot;te'st 3\&quot; --option -v 'test 4'&quot;; 
</del><ins>+         *
+         * &lt;code&gt;
+         *        $pattern = &quot;-f \&quot;test 2\&quot; -ab --required \&quot;t\\\&quot;est 1\&quot; --optional=\&quot;te'st 3\&quot; --option -v 'test 4'&quot;;
</ins><span class="cx">          *        $result = getoptParser::split_para($pattern);
</span><span class="cx">          *        echo &quot;ORIGINAL PATTERN: $pattern\n\n&quot;;
</span><span class="cx">          *        var_dump($result);
</span><span class="cx">          * &lt;/code&gt;
</span><del>-         * 
</del><ins>+         *
</ins><span class="cx">          * @param string $pattern
</span><span class="cx">          * @return array
</span><span class="cx">          */
</span><span class="lines">@@ -369,6 +369,6 @@
</span><span class="cx">                         $result[] = $cand1;
</span><span class="cx"> 
</span><span class="cx">                 return $result;
</span><del>-        }        
</del><ins>+        }
</ins><span class="cx"> }
</span><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="wptestlibwpprofilerphp"></a>
<div class="modfile"><h4>Modified: wp-testlib/wp-profiler.php (406 => 407)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testlib/wp-profiler.php        2011-08-04 20:34:08 UTC (rev 406)
+++ wp-testlib/wp-profiler.php        2011-08-04 20:38:26 UTC (rev 407)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">                         $this-&gt;stack[count($this-&gt;stack)-1]['queries'] = $wpdb-&gt;queries;
</span><span class="cx">                 }
</span><span class="cx">                 $wpdb-&gt;queries = array();
</span><del>-                
</del><ins>+
</ins><span class="cx">                 global $wp_object_cache;
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;stack[] = array(
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">                 global $wpdb;
</span><span class="cx">                 $item['queries'] = $wpdb-&gt;queries;
</span><span class="cx">                 global $wp_object_cache;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $cache_dirty_count = $this-&gt;_dirty_objects_count($wp_object_cache-&gt;dirty_objects);
</span><span class="cx">                 $cache_dirty_delta = $this-&gt;array_sub($cache_dirty_count, $item['cache_dirty_objects']);
</span><span class="cx"> 
</span><span class="lines">@@ -158,14 +158,14 @@
</span><span class="cx">                 }
</span><span class="cx">                 return $out;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function _dirty_objects_count($dirty_objects) {
</span><span class="cx">                 $out = array();
</span><span class="cx">                 foreach (array_keys($dirty_objects) as $group)
</span><span class="cx">                         $out[$group] = count($dirty_objects[$group]);
</span><span class="cx">                 return $out;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function array_add($a, $b) {
</span><span class="cx">                 $out = $a;
</span><span class="cx">                 foreach (array_keys($b) as $key)
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx">                                 $out[$key] = $b[$key];
</span><span class="cx">                 return $out;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function array_sub($a, $b) {
</span><span class="cx">                 $out = $a;
</span><span class="cx">                 foreach (array_keys($b) as $key)
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx"> 
</span><span class="cx">         function print_summary() {
</span><span class="cx">                 $results = $this-&gt;results();
</span><del>-                
</del><ins>+
</ins><span class="cx">                 printf(&quot;\nname                      calls   time action filter   warm   cold misses  dirty\n&quot;);
</span><span class="cx">                 foreach ($results as $name=&gt;$stats) {
</span><span class="cx">                         printf(&quot;%24.24s %6d %6.4f %6d %6d %6d %6d %6d %6d\n&quot;, $name, $stats['calls'], $stats['time'], array_sum($stats['actions']), array_sum($stats['filters']), $stats['cache_warm_hits'], $stats['cache_cold_hits'], $stats['cache_misses'], array_sum($stats['cache_dirty_objects']));
</span></span></pre>
</div>
</div>

</body>
</html>