<!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>[366] wp-testcase: Set svn:eol-style native on all but one of the testcases.</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>366</dd>
<dt>Author</dt> <dd>westi</dd>
<dt>Date</dt> <dd>2011-06-05 07:25:21 +0000 (Sun, 05 Jun 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Set svn:eol-style native on all but one of the testcases.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#wptestcasejacobTestFormattingphp">wp-testcase/jacob/TestFormatting.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_import_wpphp">wp-testcase/test_import_wp.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_userphp">wp-testcase/test_user.php</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#wptestcasejacobTestFormattingphp">wp-testcase/jacob/TestFormatting.php</a></li>
<li><a href="#wptestcasetest_admin_includes_pluginphp">wp-testcase/test_admin_includes_plugin.php</a></li>
<li><a href="#wptestcasetest_admin_includes_templatephp">wp-testcase/test_admin_includes_template.php</a></li>
<li><a href="#wptestcasetest_admin_includes_themephp">wp-testcase/test_admin_includes_theme.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_cachephp">wp-testcase/test_includes_cache.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_feed_rss2php">wp-testcase/test_includes_feed_rss2.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_functionsphp">wp-testcase/test_includes_functions.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_themephp">wp-testcase/test_includes_theme.php</a></li>
<li><a href="#wptestcasetest_includes_wpscriptsphp">wp-testcase/test_includes_wp-scripts.php</a></li>
<li><a href="#wptestcasetest_includes_wpstylesphp">wp-testcase/test_includes_wp-styles.php</a></li>
<li><a href="#wptestcasetest_link_functionsphp">wp-testcase/test_link_functions.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_query_resultsphp">wp-testcase/test_query_results.php</a></li>
<li><a href="#wptestcasetest_shortcodephp">wp-testcase/test_shortcode.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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="wptestcasejacobTestFormattingphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/jacob/TestFormatting.php (365 => 366)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/jacob/TestFormatting.php        2011-06-03 05:17:22 UTC (rev 365)
+++ wp-testcase/jacob/TestFormatting.php        2011-06-05 07:25:21 UTC (rev 366)
</span><span class="lines">@@ -1,447 +1,447 @@
</span><del>-&lt;?php
-
-/*
-From http://wordpress.svn.dragonu.net/unittest/wp-unittest/UnitTests/
-*/
-class _WPFormattingTest extends WPTestCase {
-    function file_test($name, $callback) {
-        $input = $this-&gt;get_testdata($name . &quot;.input.txt&quot;);
-        $output = $this-&gt;get_testdata($name . &quot;.output.txt&quot;);
-        for ($i=0; $i&lt;count($input); ++$i) {
-            $in = call_user_func($callback, $input[$i]);
-            $this-&gt;assertEquals($output[$i], $in);
-        }
-    }
-
-        /*
-        Get test data from files, one test per line.
-        Comments start with &quot;###&quot;.
-        */
-        function get_testdata($name) {
-                $data = file( DIR_TESTDATA.'/jacob/'.$name );
-                $odata = array();
-                foreach ($data as $datum) {
-                    // comment
-                    $commentpos = strpos($datum, &quot;###&quot;);
-                    if ($commentpos !== false) {
-                        $datum = trim(substr($datum, 0, $commentpos));
-                        if (!$datum)
-                            continue;
-                    }
-                    $odata[] = $datum;
-                }
-                return $odata;
-        }
-}
-
-
-/* The `clean_pre` function removes pararaph and line break
-   tags within `&lt;pre&gt;` elements as part of the nightmare that
-   is `wpautop`. */
-class Test_Clean_Pre extends _WPFormattingTest {
-    function test_removes_self_closing_br_with_space() {
-        $source = 'a b c\n&lt;br /&gt;sldfj&lt;br /&gt;';
-        $res = 'a b c\nsldfj';
-        
-        $this-&gt;assertEquals($res, clean_pre($source));
-    }
-    function test_removes_self_closing_br_without_space() {
-        $source = 'a b c\n&lt;br/&gt;sldfj&lt;br/&gt;';
-        $res = 'a b c\nsldfj';
-        $this-&gt;assertEquals($res, clean_pre($source));
-    }
-    // I don't think this can ever happen in production;
-    // &lt;br&gt; is changed to &lt;br /&gt; elsewhere. Left in because
-    // that replacement shouldn't happen (what if you want
-    // HTML 4 output?).
-    function test_removes_html_br() {
-        $source = 'a b c\n&lt;br&gt;sldfj&lt;br&gt;';
-        $res = 'a b c\nsldfj';
-        $this-&gt;assertEquals($res, clean_pre($source));
-    }
-    function test_removes_p() {
-        $source = &quot;&lt;p&gt;isn't this exciting!&lt;/p&gt;&lt;p&gt;oh indeed!&lt;/p&gt;&quot;;
-        $res = &quot;\nisn't this exciting!\noh indeed!&quot;;
-        $this-&gt;assertEquals($res, clean_pre($source));
-    }
-}
-
-/*
-`seems_utf8` returns true for utf-8 strings, false otherwise.
-*/
-class Test_Seems_UTF8 extends _WPFormattingTest {
-    function test_returns_true_for_utf8_strings() {
-        // from http://www.i18nguy.com/unicode-example.html
-        $utf8 = $this-&gt;get_testdata('utf-8.txt');
-        $this-&gt;assertTrue(count($utf8) &gt; 3);
-        foreach ($utf8 as $string) {
-            $this-&gt;assertTrue(seems_utf8($string));
-        }
-    }
-    function test_returns_false_for_non_utf8_strings() {
-        $big5 = $this-&gt;get_testdata('test_big5.txt');
-        $big5 = $big5[0];
-        $strings = array(
-            &quot;abc&quot;,
-            &quot;123&quot;,
-            $big5
-        );
-    }
-}
-
-/*
-Escapes HTML special characters (&amp;, &lt;, &gt;); does not encode
-ampersands if they are already part of entities.
-*/
-class Test_WP_Specialchars extends _WPFormattingTest {
-    function test_escapes_ampersands() {
-        $source = &quot;penn &amp; teller &amp; at&amp;t&quot;;
-        $res = &quot;penn &amp;amp; teller &amp;amp; at&amp;amp;t&quot;;
-        $this-&gt;assertEquals( $res, esc_html($source) );
-    }
-    function test_escapes_greater_and_less_than() {
-        $source = &quot;this &gt; that &lt; that &lt;randomhtml /&gt;&quot;;
-        $res = &quot;this &amp;gt; that &amp;lt; that &amp;lt;randomhtml /&amp;gt;&quot;;
-        $this-&gt;assertEquals( $res, esc_html($source) );
-    }
-    function test_optionally_escapes_quotes() {
-        $source = &quot;\&quot;'hello!'\&quot;&quot;;
-        $this-&gt;assertEquals( '&quot;&amp;#039;hello!&amp;#039;&quot;', _wp_specialchars($source, 'single') );
-        $this-&gt;assertEquals( &quot;&amp;quot;'hello!'&amp;quot;&quot;, _wp_specialchars($source, 'double') );
-        $this-&gt;assertEquals( '&amp;quot;&amp;#039;hello!&amp;#039;&amp;quot;', _wp_specialchars($source, true) );
-        $this-&gt;assertEquals( $source, _wp_specialchars($source) );
-    }
-    function test_ignores_existing_entities() {
-        $source = '&amp;#038; &amp;#x00A3; &amp;#x22; &amp;amp;';
-        $res = '&amp;amp; &amp;#xA3; &amp;quot; &amp;amp;';
-        $this-&gt;assertEquals( $res, esc_html($source) );
-    }
-}
-
-class Test_UTF8_URI_Encode extends _WPFormattingTest {
-    /*
-    Non-ASCII UTF-8 characters should be percent encoded. Spaces etc.
-    are dealt with elsewhere.
-    */
-    function test_percent_encodes_non_reserved_characters() {
-        $utf8urls = $this-&gt;get_testdata('utf-8.txt');
-        $urlencoded = $this-&gt;get_testdata('utf-8-urlencoded.txt');
-        for ($i=0; $i&lt;count($utf8urls); ++$i) {
-            $this-&gt;assertEquals($urlencoded[$i], utf8_uri_encode($utf8urls[$i]));
-        }
-    }
-    function test_output_is_not_longer_than_optional_length_argument() {
-        $utf8urls = $this-&gt;get_testdata('utf-8.txt');
-        foreach ($utf8urls as $url) {
-            $maxlen = rand(5, 200);
-            $this-&gt;assertTrue(strlen(utf8_uri_encode($url, $maxlen)) &lt;= $maxlen);
-        }
-        
-    }
-    
-}
-
-/*
-Removes accents from characters and decomposes ligatures.
-*/
-class Test_Remove_Accents extends _WPFormattingTest {
-    
-    /*
-    http://www.alanwood.net/unicode/latin_1_supplement.html
-
-    unicode-latin-1-supplement is identical to iso-8859-1, so these
-    tests on their own will never take the unicode codepath
-    */    
-    function test_removes_accents_from_decomposable_latin1_supplement() {
-        $this-&gt;file_test(&quot;removes_accents_from_decomposable_latin1_supplement&quot;,
-            &quot;remove_accents&quot;);
-    }
-    
-    /*
-    Several characters, such as eth and thorn, do not have a unicode
-    decomposition, but should be replaced. The eth, for example, should become
-    &quot;d&quot; or &quot;dh&quot;, and the thorn &quot;th&quot;. They require special rules.
-    */
-    function test_removes_accents_from_undecomposable_latin1_supplement() {
-        $this-&gt;file_test(&quot;removes_accents_from_undecomposable_latin1_supplement&quot;,
-            &quot;remove_accents&quot;);
-    }   
-    function test_removes_accents_from_latin1_supplement() {
-        $this-&gt;file_test(&quot;removes_accents_from_latin1_supplement&quot;,
-            &quot;remove_accents&quot;);
-    }
-
-    function test_removes_accents_from_decomposable_latin_extended_a() {
-        $this-&gt;file_test(&quot;removes_accents_from_decomposable_latin_extended_a&quot;,
-            &quot;remove_accents&quot;);
-    }    
-    function test_removes_accents_from_undecomposable_latin_extended_a() {
-        $this-&gt;file_test(&quot;removes_accents_from_undecomposable_latin_extended_a&quot;,
-            &quot;remove_accents&quot;);
-    }   
-    function test_removes_accents_from_latin_extended_a() {
-        $this-&gt;file_test(&quot;removes_accents_from_latin_extended_a&quot;,
-            &quot;remove_accents&quot;);
-    }
-
-    // Currently this test fails because the unicode codepath (seems_utf8 == true)
-    // can't handle non-decomposable characters (eth and friends).
-    function test_removes_accents_from_latin1_supplement_and_latin_extended_a() {
-        $this-&gt;file_test(&quot;removes_accents_from_latin1_supplement_and_latin_extended_a&quot;,
-            &quot;remove_accents&quot;);
-    }
-}
-
-/*
-Sanitizes filenames.
-*/
-class Test_Sanitize_File_Name extends _WPFormattingTest {
-    function test_makes_lowercase() {
-        $this-&gt;assertEquals(&quot;att&quot;, sanitize_file_name(&quot;ATT&quot;));
-    }
-    function test_removes_entities() {
-        $this-&gt;assertEquals(&quot;att&quot;, sanitize_file_name(&quot;at&amp;amp;t&quot;));
-    }
-    function test_replaces_underscores_with_hyphens() {
-        $this-&gt;assertEquals(&quot;a-t-t&quot;, sanitize_file_name(&quot;a_t_t&quot;));
-    }
-    function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
-        $this-&gt;assertEquals(&quot;a-t&quot;, sanitize_file_name(&quot;a          t&quot;));
-        $this-&gt;assertEquals(&quot;a-t&quot;, sanitize_file_name(&quot;a    \n\n\nt&quot;));
-    }
-    function test_replaces_any_number_of_hyphens_with_one_hyphen() {
-        $this-&gt;assertEquals(&quot;a-t-t&quot;, sanitize_file_name(&quot;a----t----t&quot;));
-    }
-    function test_trims_trailing_hyphens() {
-        $this-&gt;assertEquals(&quot;a-t-t&quot;, sanitize_file_name(&quot;a----t----t----&quot;));
-    }
-    function test_strips_anything_but_alphanums_periods_and_hyphens() {
-        $this-&gt;assertEquals(&quot;saint-sans&quot;, sanitize_file_name(&quot;S%ain%t-S%a\xEBns&quot;));
-    }
-    function test_handles_non_entity_ampersands() {
-        $this-&gt;assertEquals(&quot;penn-teller-bull&quot;, sanitize_file_name(&quot;penn &amp; teller; bull&quot;));
-    }
-}
-
-/*
-Mathilda: Do you &quot;clean&quot; anyone?
-L\xE9on: No women, no kids, that's the rules.
-*/
-class Test_Sanitize_User extends _WPFormattingTest {
-    function test_strips_html() {
-        $input = &quot;Captain &lt;strong&gt;Awesome&lt;/strong&gt;&quot;;
-        $expected = &quot;Captain Awesome&quot;;
-        $this-&gt;assertEquals($expected, sanitize_user($input));
-    }
-    function test_strips_entities() {
-        $this-&gt;assertEquals(&quot;ATT&quot;, sanitize_user(&quot;AT&amp;amp;T&quot;));
-    }
-    function test_strips_percent_encoded_octets() {
-        $this-&gt;assertEquals(&quot;Franois&quot;, sanitize_user(&quot;Fran%c3%a7ois&quot;));
-    }
-    function test_optional_strict_mode_reduces_to_safe_ascii_subset() {
-        $this-&gt;assertEquals(&quot;aboco&quot;, sanitize_user(&quot;()~ab~\xF6c\xF6!&quot;, true));
-    }
-}
-
-class Test_Sanitize_Title extends _WPFormattingTest {
-    function test_strips_html() {
-        $input = &quot;Captain &lt;strong&gt;Awesome&lt;/strong&gt;&quot;;
-        $expected = &quot;captain-awesome&quot;;
-        $this-&gt;assertEquals($expected, sanitize_title($input));
-    }
-    
-    function test_titles_sanitized_to_nothing_are_replaced_with_optional_fallback() {
-        $input = &quot;&lt;strong&gt;&lt;/strong&gt;&quot;;
-        $fallback = &quot;Captain Awesome&quot;;
-        $this-&gt;assertEquals($fallback, sanitize_title($input, $fallback));
-    }
-}
-
-class Test_Sanitize_Title_With_Dashes extends _WPFormattingTest {
-    function test_strips_html() {
-        $input = &quot;Captain &lt;strong&gt;Awesome&lt;/strong&gt;&quot;;
-        $expected = &quot;captain-awesome&quot;;
-        $this-&gt;assertEquals($expected, sanitize_title($input));
-    }
-    function test_strips_unencoded_percent_signs() {
-        $this-&gt;assertEquals(&quot;fran%c3%a7ois&quot;, sanitize_title_with_dashes(&quot;fran%c3%a7%ois&quot;));
-    }
-    function test_makes_title_lowercase() {
-        $this-&gt;assertEquals(&quot;abc&quot;, sanitize_title_with_dashes(&quot;ABC&quot;));
-    }
-    function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
-        $this-&gt;assertEquals(&quot;a-t&quot;, sanitize_title_with_dashes(&quot;a          t&quot;));
-        $this-&gt;assertEquals(&quot;a-t&quot;, sanitize_title_with_dashes(&quot;a    \n\n\nt&quot;));
-    }
-    function test_replaces_any_number_of_hyphens_with_one_hyphen() {
-        $this-&gt;assertEquals(&quot;a-t-t&quot;, sanitize_title_with_dashes(&quot;a----t----t&quot;));
-    }
-    function test_trims_trailing_hyphens() {
-        $this-&gt;assertEquals(&quot;a-t-t&quot;, sanitize_title_with_dashes(&quot;a----t----t----&quot;));
-    }
-    function test_handles_non_entity_ampersands() {
-        $this-&gt;assertEquals(&quot;penn-teller-bull&quot;, sanitize_title_with_dashes(&quot;penn &amp; teller bull&quot;));
-    }
-}
-
-/*
-`convert_chars` is a poorly named function that does
-four unrelated tasks. ;)
-*/
-class Test_Convert_Chars extends _WPFormattingTest {
-    function test_replaces_windows1252_entities_with_unicode_ones() {
-        $input = &quot;&amp;#130;&amp;#131;&amp;#132;&amp;#133;&amp;#134;&amp;#135;&amp;#136;&amp;#137;&amp;#138;&amp;#139;&amp;#140;&amp;#145;&amp;#146;&amp;#147;&amp;#148;&amp;#149;&amp;#150;&amp;#151;&amp;#152;&amp;#153;&amp;#154;&amp;#155;&amp;#156;&amp;#159;&quot;;
-        $output = &quot;&amp;#8218;&amp;#402;&amp;#8222;&amp;#8230;&amp;#8224;&amp;#8225;&amp;#710;&amp;#8240;&amp;#352;&amp;#8249;&amp;#338;&amp;#8216;&amp;#8217;&amp;#8220;&amp;#8221;&amp;#8226;&amp;#8211;&amp;#8212;&amp;#732;&amp;#8482;&amp;#353;&amp;#8250;&amp;#339;&amp;#376;&quot;;
-        $this-&gt;assertEquals($output, convert_chars($input));
-    }
-    function test_converts_html_br_and_hr_to_the_xhtml_self_closing_variety() {
-        $inputs = array(
-            &quot;abc &lt;br&gt; lol &lt;br /&gt;&quot; =&gt; &quot;abc &lt;br /&gt; lol &lt;br /&gt;&quot;,
-            &quot;&lt;BR&gt; HO HO &lt;HR&gt;&quot;     =&gt; &quot;&lt;br /&gt; ho ho &lt;hr /&gt;&quot;,
-            &quot;&lt;hr&gt;&lt;br&gt;&quot;            =&gt; &quot;&lt;hr /&gt;&lt;br /&gt;&quot;
-            );
-        foreach ($inputs as $input =&gt; $expected) {
-            $this-&gt;assertEquals($expected, convert_chars($input));
-        }
-    }
-    function test_escapes_lone_ampersands() {
-        $this-&gt;assertEquals(&quot;at&amp;#038;t&quot;, convert_chars(&quot;at&amp;t&quot;));
-    }
-    // what the hell are these? O_o
-    function test_removes_category_and_title_metadata_tags() {
-        $this-&gt;assertEquals(&quot;&quot;, convert_chars(&quot;&lt;title&gt;&lt;div class='lol'&gt;abc&lt;/div&gt;&lt;/title&gt;&lt;category&gt;a&lt;/category&gt;&quot;));
-    }
-}
-
-class Test_Funky_JavaScript_Fix extends _WPFormattingTest {
-    function test_does_nothing_if_not_mac_or_win_ie() {
-        global $is_macIE, $is_winIE;
-        $prev = array($is_macIE, $is_winIE);
-        $is_macIE = $is_winIE = false;
-        $data = $this-&gt;get_testdata(&quot;utf-8-u-urlencoded.txt&quot;);
-        foreach ($data as $datum) {
-            $this-&gt;assertEquals($datum, funky_javascript_fix($datum));
-        }
-        $is_macIE = $prev[0];
-        $is_winIE = $prev[1];
-    }
-    function test_converts_u_percent_encoded_values_if_mac_ie() {
-        global $is_macIE;
-        $prev = $is_macIE;
-        $is_macIE = true;
-        $this-&gt;_run();
-        $is_macIE = $prev;
-    }
-    function test_converts_u_percent_encoded_values_if_win_ie() {
-        global $is_winIE;
-        $prev = $is_winIE;
-        $is_winIE = true;
-        $this-&gt;_run();
-        $is_winIE = $prev;
-    }
-    function _run() {
-        $input = $this-&gt;get_testdata(&quot;utf-8-u-urlencoded.txt&quot;);
-        $output = $this-&gt;get_testdata(&quot;utf-8-entitized.txt&quot;);
-        for ($i=0; $i&lt;count($input); ++$i) {
-            $this-&gt;assertEquals($output[$i], funky_javascript_fix($input[$i]));
-        }
-    }
-}
-
-
-class Test_BalanceTags extends _WPFormattingTest {
-    function test_adds_missing_end_tags() {
-        $this-&gt;assertEquals(&quot;&lt;b&gt;&lt;i&gt;abc&lt;/i&gt;&lt;/b&gt;&quot;, balanceTags(&quot;&lt;b&gt;&lt;i&gt;abc&lt;/b&gt;&quot;, true));
-    }
-    function test_fixes_simple_bad_nesting() {
-        $this-&gt;assertEquals(&quot;&lt;b&gt;&lt;i&gt;abc&lt;/i&gt;&lt;/b&gt;&quot;, balanceTags(&quot;&lt;b&gt;&lt;i&gt;abc&lt;/b&gt;&lt;/i&gt;&quot;, true));
-    }
-}
-
-class Test_Zeroise extends _WPFormattingTest {
-    function test_pads_with_leading_zeroes() {
-        $this-&gt;assertEquals(&quot;00005&quot;, zeroise(5, 5));
-    }
-    function test_does_nothing_if_input_is_already_longer() {
-        $this-&gt;assertEquals(&quot;5000000&quot;, zeroise(5000000, 2));
-    }
-}
-
-class Test_Backslashit extends _WPFormattingTest {
-    function test_backslashes_alphas() {
-        $this-&gt;assertEquals(&quot;\\a943\\b\\c&quot;, backslashit(&quot;a943bc&quot;));
-    }
-    function test_double_backslashes_leading_numbers() {
-        $this-&gt;assertEquals(&quot;\\\\95&quot;, backslashit(&quot;95&quot;));
-    }
-}
-
-class Test_Untrailingslashit extends _WPFormattingTest {
-    function test_removes_trailing_slashes() {
-        $this-&gt;assertEquals(&quot;a&quot;, untrailingslashit(&quot;a/&quot;));
-        $this-&gt;assertEquals(&quot;a&quot;, untrailingslashit(&quot;a////&quot;));
-    }
-}
-
-class Test_Trailingslashit extends _WPFormattingTest {
-    function test_adds_trailing_slash() {
-        $this-&gt;assertEquals(&quot;a/&quot;, trailingslashit(&quot;a&quot;));
-    }
-    function test_does_not_add_trailing_slash_if_one_exists() {
-        $this-&gt;assertEquals(&quot;a/&quot;, trailingslashit(&quot;a/&quot;));
-    }
-}
-
-class Test_Is_Email extends _WPFormattingTest {
-    function test_returns_true_if_given_a_valid_email_address() {
-        $data = array(
-            &quot;bob@example.com&quot;,
-            '&quot;Bob Johnson&quot; &lt;bob@example.com&gt;',
-            &quot;phil@example.info&quot;,
-            &quot;ace@204.32.222.14&quot;,
-            &quot;kevin@many.subdomains.make.a.happy.man.edu&quot;
-            );
-        foreach ( $data as $datum ) {
-            $this-&gt;assertEquals( $datum, is_email($datum), $datum );
-        }
-    }
-    // TODO: make up some more useful test data :)
-    function test_returns_false_if_given_an_invalid_email_address() {
-        $data = array(
-            &quot;khaaaaaaaaaaaaaaan!&quot;,
-            'http://bob.example.com/',
-            &quot;sif i'd give u it, spamer!1&quot;,
-            &quot;com.exampleNOSPAMbob&quot;,
-            &quot;bob@your mom&quot;
-            );
-        foreach ($data as $datum) {
-            $this-&gt;assertFalse(is_email($datum), $datum);
-        }
-    }
-}
-
-/*
-Decodes text in RFC2047 &quot;Q&quot;-encoding, e.g.
-
-    =?iso-8859-1?q?this=20is=20some=20text?=
-*/
-class Test_WP_ISO_Descrambler extends _WPFormattingTest {
-    function test_decodes_iso_8859_1_rfc2047_q_encoding() {
-        $this-&gt;assertEquals(&quot;this is some text&quot;, wp_iso_descrambler(&quot;=?iso-8859-1?q?this=20is=20some=20text?=&quot;));
-    }
-}
-
-class Test_Ent2NCR extends _WPFormattingTest {
-    function test_converts_named_entities_to_numeric_character_references() {
-        $data = $this-&gt;get_testdata(&quot;entities.txt&quot;);
-        foreach ($data as $datum) {
-            $parts = explode(&quot;|&quot;, $datum);
-            $name = &quot;&amp;&quot; . trim($parts[0]) . &quot;;&quot;;
-            $ncr = trim($parts[1]);
-            $this-&gt;assertEquals(&quot;&amp;#&quot;.$ncr.&quot;;&quot;, ent2ncr($name), $name);
-        }
-    }
-}
-
-?&gt;
</del><ins>+&lt;?php
+
+/*
+From http://wordpress.svn.dragonu.net/unittest/wp-unittest/UnitTests/
+*/
+class _WPFormattingTest extends WPTestCase {
+    function file_test($name, $callback) {
+        $input = $this-&gt;get_testdata($name . &quot;.input.txt&quot;);
+        $output = $this-&gt;get_testdata($name . &quot;.output.txt&quot;);
+        for ($i=0; $i&lt;count($input); ++$i) {
+            $in = call_user_func($callback, $input[$i]);
+            $this-&gt;assertEquals($output[$i], $in);
+        }
+    }
+
+        /*
+        Get test data from files, one test per line.
+        Comments start with &quot;###&quot;.
+        */
+        function get_testdata($name) {
+                $data = file( DIR_TESTDATA.'/jacob/'.$name );
+                $odata = array();
+                foreach ($data as $datum) {
+                    // comment
+                    $commentpos = strpos($datum, &quot;###&quot;);
+                    if ($commentpos !== false) {
+                        $datum = trim(substr($datum, 0, $commentpos));
+                        if (!$datum)
+                            continue;
+                    }
+                    $odata[] = $datum;
+                }
+                return $odata;
+        }
+}
+
+
+/* The `clean_pre` function removes pararaph and line break
+   tags within `&lt;pre&gt;` elements as part of the nightmare that
+   is `wpautop`. */
+class Test_Clean_Pre extends _WPFormattingTest {
+    function test_removes_self_closing_br_with_space() {
+        $source = 'a b c\n&lt;br /&gt;sldfj&lt;br /&gt;';
+        $res = 'a b c\nsldfj';
+        
+        $this-&gt;assertEquals($res, clean_pre($source));
+    }
+    function test_removes_self_closing_br_without_space() {
+        $source = 'a b c\n&lt;br/&gt;sldfj&lt;br/&gt;';
+        $res = 'a b c\nsldfj';
+        $this-&gt;assertEquals($res, clean_pre($source));
+    }
+    // I don't think this can ever happen in production;
+    // &lt;br&gt; is changed to &lt;br /&gt; elsewhere. Left in because
+    // that replacement shouldn't happen (what if you want
+    // HTML 4 output?).
+    function test_removes_html_br() {
+        $source = 'a b c\n&lt;br&gt;sldfj&lt;br&gt;';
+        $res = 'a b c\nsldfj';
+        $this-&gt;assertEquals($res, clean_pre($source));
+    }
+    function test_removes_p() {
+        $source = &quot;&lt;p&gt;isn't this exciting!&lt;/p&gt;&lt;p&gt;oh indeed!&lt;/p&gt;&quot;;
+        $res = &quot;\nisn't this exciting!\noh indeed!&quot;;
+        $this-&gt;assertEquals($res, clean_pre($source));
+    }
+}
+
+/*
+`seems_utf8` returns true for utf-8 strings, false otherwise.
+*/
+class Test_Seems_UTF8 extends _WPFormattingTest {
+    function test_returns_true_for_utf8_strings() {
+        // from http://www.i18nguy.com/unicode-example.html
+        $utf8 = $this-&gt;get_testdata('utf-8.txt');
+        $this-&gt;assertTrue(count($utf8) &gt; 3);
+        foreach ($utf8 as $string) {
+            $this-&gt;assertTrue(seems_utf8($string));
+        }
+    }
+    function test_returns_false_for_non_utf8_strings() {
+        $big5 = $this-&gt;get_testdata('test_big5.txt');
+        $big5 = $big5[0];
+        $strings = array(
+            &quot;abc&quot;,
+            &quot;123&quot;,
+            $big5
+        );
+    }
+}
+
+/*
+Escapes HTML special characters (&amp;, &lt;, &gt;); does not encode
+ampersands if they are already part of entities.
+*/
+class Test_WP_Specialchars extends _WPFormattingTest {
+    function test_escapes_ampersands() {
+        $source = &quot;penn &amp; teller &amp; at&amp;t&quot;;
+        $res = &quot;penn &amp;amp; teller &amp;amp; at&amp;amp;t&quot;;
+        $this-&gt;assertEquals( $res, esc_html($source) );
+    }
+    function test_escapes_greater_and_less_than() {
+        $source = &quot;this &gt; that &lt; that &lt;randomhtml /&gt;&quot;;
+        $res = &quot;this &amp;gt; that &amp;lt; that &amp;lt;randomhtml /&amp;gt;&quot;;
+        $this-&gt;assertEquals( $res, esc_html($source) );
+    }
+    function test_optionally_escapes_quotes() {
+        $source = &quot;\&quot;'hello!'\&quot;&quot;;
+        $this-&gt;assertEquals( '&quot;&amp;#039;hello!&amp;#039;&quot;', _wp_specialchars($source, 'single') );
+        $this-&gt;assertEquals( &quot;&amp;quot;'hello!'&amp;quot;&quot;, _wp_specialchars($source, 'double') );
+        $this-&gt;assertEquals( '&amp;quot;&amp;#039;hello!&amp;#039;&amp;quot;', _wp_specialchars($source, true) );
+        $this-&gt;assertEquals( $source, _wp_specialchars($source) );
+    }
+    function test_ignores_existing_entities() {
+        $source = '&amp;#038; &amp;#x00A3; &amp;#x22; &amp;amp;';
+        $res = '&amp;amp; &amp;#xA3; &amp;quot; &amp;amp;';
+        $this-&gt;assertEquals( $res, esc_html($source) );
+    }
+}
+
+class Test_UTF8_URI_Encode extends _WPFormattingTest {
+    /*
+    Non-ASCII UTF-8 characters should be percent encoded. Spaces etc.
+    are dealt with elsewhere.
+    */
+    function test_percent_encodes_non_reserved_characters() {
+        $utf8urls = $this-&gt;get_testdata('utf-8.txt');
+        $urlencoded = $this-&gt;get_testdata('utf-8-urlencoded.txt');
+        for ($i=0; $i&lt;count($utf8urls); ++$i) {
+            $this-&gt;assertEquals($urlencoded[$i], utf8_uri_encode($utf8urls[$i]));
+        }
+    }
+    function test_output_is_not_longer_than_optional_length_argument() {
+        $utf8urls = $this-&gt;get_testdata('utf-8.txt');
+        foreach ($utf8urls as $url) {
+            $maxlen = rand(5, 200);
+            $this-&gt;assertTrue(strlen(utf8_uri_encode($url, $maxlen)) &lt;= $maxlen);
+        }
+        
+    }
+    
+}
+
+/*
+Removes accents from characters and decomposes ligatures.
+*/
+class Test_Remove_Accents extends _WPFormattingTest {
+    
+    /*
+    http://www.alanwood.net/unicode/latin_1_supplement.html
+
+    unicode-latin-1-supplement is identical to iso-8859-1, so these
+    tests on their own will never take the unicode codepath
+    */    
+    function test_removes_accents_from_decomposable_latin1_supplement() {
+        $this-&gt;file_test(&quot;removes_accents_from_decomposable_latin1_supplement&quot;,
+            &quot;remove_accents&quot;);
+    }
+    
+    /*
+    Several characters, such as eth and thorn, do not have a unicode
+    decomposition, but should be replaced. The eth, for example, should become
+    &quot;d&quot; or &quot;dh&quot;, and the thorn &quot;th&quot;. They require special rules.
+    */
+    function test_removes_accents_from_undecomposable_latin1_supplement() {
+        $this-&gt;file_test(&quot;removes_accents_from_undecomposable_latin1_supplement&quot;,
+            &quot;remove_accents&quot;);
+    }   
+    function test_removes_accents_from_latin1_supplement() {
+        $this-&gt;file_test(&quot;removes_accents_from_latin1_supplement&quot;,
+            &quot;remove_accents&quot;);
+    }
+
+    function test_removes_accents_from_decomposable_latin_extended_a() {
+        $this-&gt;file_test(&quot;removes_accents_from_decomposable_latin_extended_a&quot;,
+            &quot;remove_accents&quot;);
+    }    
+    function test_removes_accents_from_undecomposable_latin_extended_a() {
+        $this-&gt;file_test(&quot;removes_accents_from_undecomposable_latin_extended_a&quot;,
+            &quot;remove_accents&quot;);
+    }   
+    function test_removes_accents_from_latin_extended_a() {
+        $this-&gt;file_test(&quot;removes_accents_from_latin_extended_a&quot;,
+            &quot;remove_accents&quot;);
+    }
+
+    // Currently this test fails because the unicode codepath (seems_utf8 == true)
+    // can't handle non-decomposable characters (eth and friends).
+    function test_removes_accents_from_latin1_supplement_and_latin_extended_a() {
+        $this-&gt;file_test(&quot;removes_accents_from_latin1_supplement_and_latin_extended_a&quot;,
+            &quot;remove_accents&quot;);
+    }
+}
+
+/*
+Sanitizes filenames.
+*/
+class Test_Sanitize_File_Name extends _WPFormattingTest {
+    function test_makes_lowercase() {
+        $this-&gt;assertEquals(&quot;att&quot;, sanitize_file_name(&quot;ATT&quot;));
+    }
+    function test_removes_entities() {
+        $this-&gt;assertEquals(&quot;att&quot;, sanitize_file_name(&quot;at&amp;amp;t&quot;));
+    }
+    function test_replaces_underscores_with_hyphens() {
+        $this-&gt;assertEquals(&quot;a-t-t&quot;, sanitize_file_name(&quot;a_t_t&quot;));
+    }
+    function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
+        $this-&gt;assertEquals(&quot;a-t&quot;, sanitize_file_name(&quot;a          t&quot;));
+        $this-&gt;assertEquals(&quot;a-t&quot;, sanitize_file_name(&quot;a    \n\n\nt&quot;));
+    }
+    function test_replaces_any_number_of_hyphens_with_one_hyphen() {
+        $this-&gt;assertEquals(&quot;a-t-t&quot;, sanitize_file_name(&quot;a----t----t&quot;));
+    }
+    function test_trims_trailing_hyphens() {
+        $this-&gt;assertEquals(&quot;a-t-t&quot;, sanitize_file_name(&quot;a----t----t----&quot;));
+    }
+    function test_strips_anything_but_alphanums_periods_and_hyphens() {
+        $this-&gt;assertEquals(&quot;saint-sans&quot;, sanitize_file_name(&quot;S%ain%t-S%a\xEBns&quot;));
+    }
+    function test_handles_non_entity_ampersands() {
+        $this-&gt;assertEquals(&quot;penn-teller-bull&quot;, sanitize_file_name(&quot;penn &amp; teller; bull&quot;));
+    }
+}
+
+/*
+Mathilda: Do you &quot;clean&quot; anyone?
+L\xE9on: No women, no kids, that's the rules.
+*/
+class Test_Sanitize_User extends _WPFormattingTest {
+    function test_strips_html() {
+        $input = &quot;Captain &lt;strong&gt;Awesome&lt;/strong&gt;&quot;;
+        $expected = &quot;Captain Awesome&quot;;
+        $this-&gt;assertEquals($expected, sanitize_user($input));
+    }
+    function test_strips_entities() {
+        $this-&gt;assertEquals(&quot;ATT&quot;, sanitize_user(&quot;AT&amp;amp;T&quot;));
+    }
+    function test_strips_percent_encoded_octets() {
+        $this-&gt;assertEquals(&quot;Franois&quot;, sanitize_user(&quot;Fran%c3%a7ois&quot;));
+    }
+    function test_optional_strict_mode_reduces_to_safe_ascii_subset() {
+        $this-&gt;assertEquals(&quot;aboco&quot;, sanitize_user(&quot;()~ab~\xF6c\xF6!&quot;, true));
+    }
+}
+
+class Test_Sanitize_Title extends _WPFormattingTest {
+    function test_strips_html() {
+        $input = &quot;Captain &lt;strong&gt;Awesome&lt;/strong&gt;&quot;;
+        $expected = &quot;captain-awesome&quot;;
+        $this-&gt;assertEquals($expected, sanitize_title($input));
+    }
+    
+    function test_titles_sanitized_to_nothing_are_replaced_with_optional_fallback() {
+        $input = &quot;&lt;strong&gt;&lt;/strong&gt;&quot;;
+        $fallback = &quot;Captain Awesome&quot;;
+        $this-&gt;assertEquals($fallback, sanitize_title($input, $fallback));
+    }
+}
+
+class Test_Sanitize_Title_With_Dashes extends _WPFormattingTest {
+    function test_strips_html() {
+        $input = &quot;Captain &lt;strong&gt;Awesome&lt;/strong&gt;&quot;;
+        $expected = &quot;captain-awesome&quot;;
+        $this-&gt;assertEquals($expected, sanitize_title($input));
+    }
+    function test_strips_unencoded_percent_signs() {
+        $this-&gt;assertEquals(&quot;fran%c3%a7ois&quot;, sanitize_title_with_dashes(&quot;fran%c3%a7%ois&quot;));
+    }
+    function test_makes_title_lowercase() {
+        $this-&gt;assertEquals(&quot;abc&quot;, sanitize_title_with_dashes(&quot;ABC&quot;));
+    }
+    function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
+        $this-&gt;assertEquals(&quot;a-t&quot;, sanitize_title_with_dashes(&quot;a          t&quot;));
+        $this-&gt;assertEquals(&quot;a-t&quot;, sanitize_title_with_dashes(&quot;a    \n\n\nt&quot;));
+    }
+    function test_replaces_any_number_of_hyphens_with_one_hyphen() {
+        $this-&gt;assertEquals(&quot;a-t-t&quot;, sanitize_title_with_dashes(&quot;a----t----t&quot;));
+    }
+    function test_trims_trailing_hyphens() {
+        $this-&gt;assertEquals(&quot;a-t-t&quot;, sanitize_title_with_dashes(&quot;a----t----t----&quot;));
+    }
+    function test_handles_non_entity_ampersands() {
+        $this-&gt;assertEquals(&quot;penn-teller-bull&quot;, sanitize_title_with_dashes(&quot;penn &amp; teller bull&quot;));
+    }
+}
+
+/*
+`convert_chars` is a poorly named function that does
+four unrelated tasks. ;)
+*/
+class Test_Convert_Chars extends _WPFormattingTest {
+    function test_replaces_windows1252_entities_with_unicode_ones() {
+        $input = &quot;&amp;#130;&amp;#131;&amp;#132;&amp;#133;&amp;#134;&amp;#135;&amp;#136;&amp;#137;&amp;#138;&amp;#139;&amp;#140;&amp;#145;&amp;#146;&amp;#147;&amp;#148;&amp;#149;&amp;#150;&amp;#151;&amp;#152;&amp;#153;&amp;#154;&amp;#155;&amp;#156;&amp;#159;&quot;;
+        $output = &quot;&amp;#8218;&amp;#402;&amp;#8222;&amp;#8230;&amp;#8224;&amp;#8225;&amp;#710;&amp;#8240;&amp;#352;&amp;#8249;&amp;#338;&amp;#8216;&amp;#8217;&amp;#8220;&amp;#8221;&amp;#8226;&amp;#8211;&amp;#8212;&amp;#732;&amp;#8482;&amp;#353;&amp;#8250;&amp;#339;&amp;#376;&quot;;
+        $this-&gt;assertEquals($output, convert_chars($input));
+    }
+    function test_converts_html_br_and_hr_to_the_xhtml_self_closing_variety() {
+        $inputs = array(
+            &quot;abc &lt;br&gt; lol &lt;br /&gt;&quot; =&gt; &quot;abc &lt;br /&gt; lol &lt;br /&gt;&quot;,
+            &quot;&lt;BR&gt; HO HO &lt;HR&gt;&quot;     =&gt; &quot;&lt;br /&gt; ho ho &lt;hr /&gt;&quot;,
+            &quot;&lt;hr&gt;&lt;br&gt;&quot;            =&gt; &quot;&lt;hr /&gt;&lt;br /&gt;&quot;
+            );
+        foreach ($inputs as $input =&gt; $expected) {
+            $this-&gt;assertEquals($expected, convert_chars($input));
+        }
+    }
+    function test_escapes_lone_ampersands() {
+        $this-&gt;assertEquals(&quot;at&amp;#038;t&quot;, convert_chars(&quot;at&amp;t&quot;));
+    }
+    // what the hell are these? O_o
+    function test_removes_category_and_title_metadata_tags() {
+        $this-&gt;assertEquals(&quot;&quot;, convert_chars(&quot;&lt;title&gt;&lt;div class='lol'&gt;abc&lt;/div&gt;&lt;/title&gt;&lt;category&gt;a&lt;/category&gt;&quot;));
+    }
+}
+
+class Test_Funky_JavaScript_Fix extends _WPFormattingTest {
+    function test_does_nothing_if_not_mac_or_win_ie() {
+        global $is_macIE, $is_winIE;
+        $prev = array($is_macIE, $is_winIE);
+        $is_macIE = $is_winIE = false;
+        $data = $this-&gt;get_testdata(&quot;utf-8-u-urlencoded.txt&quot;);
+        foreach ($data as $datum) {
+            $this-&gt;assertEquals($datum, funky_javascript_fix($datum));
+        }
+        $is_macIE = $prev[0];
+        $is_winIE = $prev[1];
+    }
+    function test_converts_u_percent_encoded_values_if_mac_ie() {
+        global $is_macIE;
+        $prev = $is_macIE;
+        $is_macIE = true;
+        $this-&gt;_run();
+        $is_macIE = $prev;
+    }
+    function test_converts_u_percent_encoded_values_if_win_ie() {
+        global $is_winIE;
+        $prev = $is_winIE;
+        $is_winIE = true;
+        $this-&gt;_run();
+        $is_winIE = $prev;
+    }
+    function _run() {
+        $input = $this-&gt;get_testdata(&quot;utf-8-u-urlencoded.txt&quot;);
+        $output = $this-&gt;get_testdata(&quot;utf-8-entitized.txt&quot;);
+        for ($i=0; $i&lt;count($input); ++$i) {
+            $this-&gt;assertEquals($output[$i], funky_javascript_fix($input[$i]));
+        }
+    }
+}
+
+
+class Test_BalanceTags extends _WPFormattingTest {
+    function test_adds_missing_end_tags() {
+        $this-&gt;assertEquals(&quot;&lt;b&gt;&lt;i&gt;abc&lt;/i&gt;&lt;/b&gt;&quot;, balanceTags(&quot;&lt;b&gt;&lt;i&gt;abc&lt;/b&gt;&quot;, true));
+    }
+    function test_fixes_simple_bad_nesting() {
+        $this-&gt;assertEquals(&quot;&lt;b&gt;&lt;i&gt;abc&lt;/i&gt;&lt;/b&gt;&quot;, balanceTags(&quot;&lt;b&gt;&lt;i&gt;abc&lt;/b&gt;&lt;/i&gt;&quot;, true));
+    }
+}
+
+class Test_Zeroise extends _WPFormattingTest {
+    function test_pads_with_leading_zeroes() {
+        $this-&gt;assertEquals(&quot;00005&quot;, zeroise(5, 5));
+    }
+    function test_does_nothing_if_input_is_already_longer() {
+        $this-&gt;assertEquals(&quot;5000000&quot;, zeroise(5000000, 2));
+    }
+}
+
+class Test_Backslashit extends _WPFormattingTest {
+    function test_backslashes_alphas() {
+        $this-&gt;assertEquals(&quot;\\a943\\b\\c&quot;, backslashit(&quot;a943bc&quot;));
+    }
+    function test_double_backslashes_leading_numbers() {
+        $this-&gt;assertEquals(&quot;\\\\95&quot;, backslashit(&quot;95&quot;));
+    }
+}
+
+class Test_Untrailingslashit extends _WPFormattingTest {
+    function test_removes_trailing_slashes() {
+        $this-&gt;assertEquals(&quot;a&quot;, untrailingslashit(&quot;a/&quot;));
+        $this-&gt;assertEquals(&quot;a&quot;, untrailingslashit(&quot;a////&quot;));
+    }
+}
+
+class Test_Trailingslashit extends _WPFormattingTest {
+    function test_adds_trailing_slash() {
+        $this-&gt;assertEquals(&quot;a/&quot;, trailingslashit(&quot;a&quot;));
+    }
+    function test_does_not_add_trailing_slash_if_one_exists() {
+        $this-&gt;assertEquals(&quot;a/&quot;, trailingslashit(&quot;a/&quot;));
+    }
+}
+
+class Test_Is_Email extends _WPFormattingTest {
+    function test_returns_true_if_given_a_valid_email_address() {
+        $data = array(
+            &quot;bob@example.com&quot;,
+            '&quot;Bob Johnson&quot; &lt;bob@example.com&gt;',
+            &quot;phil@example.info&quot;,
+            &quot;ace@204.32.222.14&quot;,
+            &quot;kevin@many.subdomains.make.a.happy.man.edu&quot;
+            );
+        foreach ( $data as $datum ) {
+            $this-&gt;assertEquals( $datum, is_email($datum), $datum );
+        }
+    }
+    // TODO: make up some more useful test data :)
+    function test_returns_false_if_given_an_invalid_email_address() {
+        $data = array(
+            &quot;khaaaaaaaaaaaaaaan!&quot;,
+            'http://bob.example.com/',
+            &quot;sif i'd give u it, spamer!1&quot;,
+            &quot;com.exampleNOSPAMbob&quot;,
+            &quot;bob@your mom&quot;
+            );
+        foreach ($data as $datum) {
+            $this-&gt;assertFalse(is_email($datum), $datum);
+        }
+    }
+}
+
+/*
+Decodes text in RFC2047 &quot;Q&quot;-encoding, e.g.
+
+    =?iso-8859-1?q?this=20is=20some=20text?=
+*/
+class Test_WP_ISO_Descrambler extends _WPFormattingTest {
+    function test_decodes_iso_8859_1_rfc2047_q_encoding() {
+        $this-&gt;assertEquals(&quot;this is some text&quot;, wp_iso_descrambler(&quot;=?iso-8859-1?q?this=20is=20some=20text?=&quot;));
+    }
+}
+
+class Test_Ent2NCR extends _WPFormattingTest {
+    function test_converts_named_entities_to_numeric_character_references() {
+        $data = $this-&gt;get_testdata(&quot;entities.txt&quot;);
+        foreach ($data as $datum) {
+            $parts = explode(&quot;|&quot;, $datum);
+            $name = &quot;&amp;&quot; . trim($parts[0]) . &quot;;&quot;;
+            $ncr = trim($parts[1]);
+            $this-&gt;assertEquals(&quot;&amp;#&quot;.$ncr.&quot;;&quot;, ent2ncr($name), $name);
+        }
+    }
+}
+
+?&gt;
</ins><span class="cx">Property changes on: wp-testcase/jacob/TestFormatting.php
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_admin_includes_pluginphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_admin_includes_plugin.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_admin_includes_templatephp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_admin_includes_template.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_admin_includes_themephp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_admin_includes_theme.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_cronphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_cron.php (365 => 366)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_cron.php        2011-06-03 05:17:22 UTC (rev 365)
+++ wp-testcase/test_cron.php        2011-06-05 07:25:21 UTC (rev 366)
</span><span class="lines">@@ -1,301 +1,301 @@
</span><del>-&lt;?php
-// test the cron scheduling functions
-
-class WPTestCronScheduling extends _WPEmptyBlog {
-        function setUp() {
-                parent::setUp();
-                // make sure the schedule is clear
-                _set_cron_array(array());
-        }
-
-        function tearDown() {
-                parent::tearDown();
-                // make sure the schedule is clear
-                _set_cron_array(array());
-        }
-        
-        function test_wp_get_schedule_empty() {
-                // nothing scheduled
-                $hook = rand_str();
-                $this-&gt;assertFalse(wp_get_schedule($hook));
-        }
-
-        function test_schedule_event_single() {
-                // schedule an event and make sure it's returned by wp_next_scheduled
-                $hook = rand_str();
-                $timestamp = strtotime('+1 hour');
-
-                wp_schedule_single_event( $timestamp, $hook );
-                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook) );
-
-                // it's a non recurring event
-                $this-&gt;assertEquals( '', wp_get_schedule($hook) );
-
-        }
-
-        function test_schedule_event_single_args() {
-                // schedule an event with arguments and make sure it's returned by wp_next_scheduled
-                $hook = rand_str();
-                $timestamp = strtotime('+1 hour');
-                $args = array(rand_str());
-
-                wp_schedule_single_event( $timestamp, $hook, $args );
-                // this returns the timestamp only if we provide matching args
-                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
-                // these don't match so return nothing
-                $this-&gt;assertEquals( false, wp_next_scheduled($hook) );
-                $this-&gt;assertEquals( false, wp_next_scheduled($hook, array(rand_str())) );
-
-                // it's a non recurring event
-                $this-&gt;assertEquals( '', wp_get_schedule($hook, $args) );
-        }
-
-        function test_schedule_event() {
-                // schedule an event and make sure it's returned by wp_next_scheduled
-                $hook = rand_str();
-                $recur = 'hourly';
-                $timestamp = strtotime('+1 hour');
-
-                wp_schedule_event( $timestamp, $recur, $hook );
-                // it's scheduled for the right time
-                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook) );
-                // it's a recurring event
-                $this-&gt;assertEquals( $recur, wp_get_schedule($hook) );
-        }
-
-        function test_schedule_event_args() {
-                // schedule an event and make sure it's returned by wp_next_scheduled
-                $hook = rand_str();
-                $timestamp = strtotime('+1 hour');
-                $recur = 'hourly';
-                $args = array(rand_str());
-
-                wp_schedule_event( $timestamp, 'hourly', $hook, $args );
-                // this returns the timestamp only if we provide matching args
-                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
-                // these don't match so return nothing
-                $this-&gt;assertEquals( false, wp_next_scheduled($hook) );
-                $this-&gt;assertEquals( false, wp_next_scheduled($hook, array(rand_str())) );
-
-                $this-&gt;assertEquals( $recur, wp_get_schedule($hook, $args) );
-
-        }
-
-        function test_unschedule_event() {
-                // schedule an event and make sure it's returned by wp_next_scheduled
-                $hook = rand_str();
-                $timestamp = strtotime('+1 hour');
-
-                wp_schedule_single_event( $timestamp, $hook );
-                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook) );
-
-                // now unschedule it and make sure it's gone
-                wp_unschedule_event( $timestamp, $hook );
-                $this-&gt;assertEquals( false, wp_next_scheduled($hook) );
-        }
-
-        function test_clear_schedule() {
-                $hook = rand_str();
-                $args = array(rand_str());
-
-                // schedule several events with and without arguments
-                wp_schedule_single_event( strtotime('+1 hour'), $hook );
-                wp_schedule_single_event( strtotime('+2 hour'), $hook );
-                wp_schedule_single_event( strtotime('+3 hour'), $hook, $args );
-                wp_schedule_single_event( strtotime('+4 hour'), $hook, $args );
-
-                // make sure they're returned by wp_next_scheduled()
-                $this-&gt;assertTrue( wp_next_scheduled($hook) &gt; 0 );
-                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
-
-                // clear the schedule for the no args events and make sure it's gone
-                wp_clear_scheduled_hook($hook);
-                $this-&gt;assertFalse( wp_next_scheduled($hook) );
-                // the args events should still be there
-                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
-
-                // clear the schedule for the args events and make sure they're gone too
-                // note: wp_clear_scheduled_hook() expects args passed directly, rather than as an array
-                wp_clear_scheduled_hook($hook, $args[0]);
-                $this-&gt;assertFalse( wp_next_scheduled($hook, $args) );
-        }
-
-        function test_clear_schedule_multiple_args() {
-                $hook = rand_str();
-                $args = array(rand_str(), rand_str());
-
-                // schedule several events with and without arguments
-                wp_schedule_single_event( strtotime('+1 hour'), $hook );
-                wp_schedule_single_event( strtotime('+2 hour'), $hook );
-                wp_schedule_single_event( strtotime('+3 hour'), $hook, $args );
-                wp_schedule_single_event( strtotime('+4 hour'), $hook, $args );
-
-                // make sure they're returned by wp_next_scheduled()
-                $this-&gt;assertTrue( wp_next_scheduled($hook) &gt; 0 );
-                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
-
-                // clear the schedule for the no args events and make sure it's gone
-                wp_clear_scheduled_hook($hook);
-                $this-&gt;assertFalse( wp_next_scheduled($hook) );
-                // the args events should still be there
-                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
-
-                // clear the schedule for the args events and make sure they're gone too
-                // note: wp_clear_scheduled_hook() used to expect args passed directly, rather than as an array pre WP 3.0
-                wp_clear_scheduled_hook($hook, $args[0], $args[1]);
-                $this-&gt;assertFalse( wp_next_scheduled($hook, $args) );
-        }
-
-        function test_clear_schedule_new_args() {
-                $this-&gt;knownWPBug(10468);
-                $hook = rand_str();
-                $args = array(rand_str());
-                $multi_hook = rand_str();
-                $multi_args = array(rand_str(), rand_str());
-                
-                // schedule several events with and without arguments
-                wp_schedule_single_event( strtotime('+1 hour'), $hook );
-                wp_schedule_single_event( strtotime('+2 hour'), $hook );
-                wp_schedule_single_event( strtotime('+3 hour'), $hook, $args );
-                wp_schedule_single_event( strtotime('+4 hour'), $hook, $args );
-                wp_schedule_single_event( strtotime('+5 hour'), $multi_hook, $multi_args );
-                wp_schedule_single_event( strtotime('+6 hour'), $multi_hook, $multi_args );
-                
-                // make sure they're returned by wp_next_scheduled()
-                $this-&gt;assertTrue( wp_next_scheduled($hook) &gt; 0 );
-                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
-
-                // clear the schedule for the no args events and make sure it's gone
-                wp_clear_scheduled_hook($hook);
-                $this-&gt;assertFalse( wp_next_scheduled($hook) );
-                // the args events should still be there
-                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
-
-                // clear the schedule for the args events and make sure they're gone too
-                // wp_clear_scheduled_hook() should take args as an array like the other functions.
-                wp_clear_scheduled_hook($hook, $args);
-                $this-&gt;assertFalse( wp_next_scheduled($hook, $args) );
-
-                // clear the schedule for the args events and make sure they're gone too
-                // wp_clear_scheduled_hook() should take args as an array like the other functions and does from WP 3.0
-                wp_clear_scheduled_hook($multi_hook, $multi_args);
-                $this-&gt;assertFalse( wp_next_scheduled($multi_hook, $multi_args) );
-                
-        }
-
-        function test_duplicate_event() {
-                $this-&gt;knownWPBug(6966);
-                // duplicate events close together should be skipped
-                $hook = rand_str();
-                $args = array(rand_str());
-                $ts1 = strtotime('+5 minutes');
-                $ts2 = strtotime('+3 minutes');
-                
-                // first one works
-                wp_schedule_single_event( $ts1, $hook, $args );
-                // second one is ignored
-                wp_schedule_single_event( $ts2, $hook, $args );
-                
-                // the next event should be at +5 minutes, not +3
-                $this-&gt;assertEquals( $ts1, wp_next_scheduled($hook, $args) );
-        }
-
-        function test_not_duplicate_event() {
-                $this-&gt;knownWPBug(6966);
-                // duplicate events far apart should work normally
-                $hook = rand_str();
-                $args = array(rand_str());
-                $ts1 = strtotime('+30 minutes');
-                $ts2 = strtotime('+3 minutes');
-                
-                // first one works
-                wp_schedule_single_event( $ts1, $hook, $args );
-                // second works too
-                wp_schedule_single_event( $ts2, $hook, $args );
-                
-                // the next event should be at +5 minutes, not +3
-                $this-&gt;assertEquals( $ts2, wp_next_scheduled($hook, $args) );
-                wp_unschedule_event( $ts2, $hook, $args );
-                // following event should be there too
-                $this-&gt;assertEquals( $ts1, wp_next_scheduled($hook, $args) );
-        }
-}
-
-/*
- * Disable the WP Cron running test for the moment as it kills the whole test suite.
- * TODO - Fix it to work with the new cron implementation in trunk
- * 
-class WPTestCronRunning extends _WPEmptyBlog {
-        function setUp() {
-                parent::setUp();
-                // make sure the schedule is clear
-                _set_cron_array(array());
-        }
-
-        function tearDown() {
-                parent::tearDown();
-                // make sure the schedule is clear
-                _set_cron_array(array());
-        }
-        function _do_cron() {
-                // FIXME: wp-cron.php is difficult to test, could be wrapped in a function
-                $_GET['check'] = wp_hash('187425');
-                require(ABSPATH.'/wp-cron.php');
-        }
-
-        function test_run_schedule_single() {
-                // schedule an event, run it, and make sure the hook is called
-                $hook = rand_str();
-                $args = array(rand_str());
-                $timestamp = strtotime('-1 second');
-
-                // register a test action
-                $a = new MockAction();
-                add_action($hook, array(&amp;$a, 'action'));
-
-                // schedule an event for 1 second ago
-                wp_schedule_single_event( $timestamp, $hook, $args );
-                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
-
-                // run cron jobs
-                $this-&gt;_do_cron();
-
-                // our action should have been called once with the correct args
-                $this-&gt;assertEquals( 1, $a-&gt;get_call_count() );
-                $this-&gt;assertEquals( array($args), $a-&gt;get_args() );
-                
-                // it shouldn't appear in the schedule anymore
-                $this-&gt;assertFalse( wp_next_scheduled($hook, $args) );
-
-        }
-        
-        function test_run_schedule_recurring() {
-                // schedule a recurring event, run it, and make sure the hook is called
-                $hook = rand_str();
-                $args = array(rand_str());
-                $timestamp = strtotime('-1 second');
-                $recur = 'hourly';
-
-                // register a test action
-                $a = new MockAction();
-                add_action($hook, array(&amp;$a, 'action'));
-
-                // schedule an event for 1 second ago
-                wp_schedule_event( $timestamp, $recur, $hook, $args );
-                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
-                $this-&gt;assertEquals( $recur, wp_get_schedule($hook, $args) );
-
-                // run cron jobs
-                $this-&gt;_do_cron();
-
-                // our action should have been called once with the correct args
-                $this-&gt;assertEquals( 1, $a-&gt;get_call_count() );
-                $this-&gt;assertEquals( array($args), $a-&gt;get_args() );
-                
-                // it should appear in the schedule to run again in an hour's time
-                $this-&gt;assertEquals( $timestamp + 3600, wp_next_scheduled($hook, $args) );
-
-        }
-}
-*/
-?&gt;
</del><ins>+&lt;?php
+// test the cron scheduling functions
+
+class WPTestCronScheduling extends _WPEmptyBlog {
+        function setUp() {
+                parent::setUp();
+                // make sure the schedule is clear
+                _set_cron_array(array());
+        }
+
+        function tearDown() {
+                parent::tearDown();
+                // make sure the schedule is clear
+                _set_cron_array(array());
+        }
+        
+        function test_wp_get_schedule_empty() {
+                // nothing scheduled
+                $hook = rand_str();
+                $this-&gt;assertFalse(wp_get_schedule($hook));
+        }
+
+        function test_schedule_event_single() {
+                // schedule an event and make sure it's returned by wp_next_scheduled
+                $hook = rand_str();
+                $timestamp = strtotime('+1 hour');
+
+                wp_schedule_single_event( $timestamp, $hook );
+                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook) );
+
+                // it's a non recurring event
+                $this-&gt;assertEquals( '', wp_get_schedule($hook) );
+
+        }
+
+        function test_schedule_event_single_args() {
+                // schedule an event with arguments and make sure it's returned by wp_next_scheduled
+                $hook = rand_str();
+                $timestamp = strtotime('+1 hour');
+                $args = array(rand_str());
+
+                wp_schedule_single_event( $timestamp, $hook, $args );
+                // this returns the timestamp only if we provide matching args
+                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
+                // these don't match so return nothing
+                $this-&gt;assertEquals( false, wp_next_scheduled($hook) );
+                $this-&gt;assertEquals( false, wp_next_scheduled($hook, array(rand_str())) );
+
+                // it's a non recurring event
+                $this-&gt;assertEquals( '', wp_get_schedule($hook, $args) );
+        }
+
+        function test_schedule_event() {
+                // schedule an event and make sure it's returned by wp_next_scheduled
+                $hook = rand_str();
+                $recur = 'hourly';
+                $timestamp = strtotime('+1 hour');
+
+                wp_schedule_event( $timestamp, $recur, $hook );
+                // it's scheduled for the right time
+                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook) );
+                // it's a recurring event
+                $this-&gt;assertEquals( $recur, wp_get_schedule($hook) );
+        }
+
+        function test_schedule_event_args() {
+                // schedule an event and make sure it's returned by wp_next_scheduled
+                $hook = rand_str();
+                $timestamp = strtotime('+1 hour');
+                $recur = 'hourly';
+                $args = array(rand_str());
+
+                wp_schedule_event( $timestamp, 'hourly', $hook, $args );
+                // this returns the timestamp only if we provide matching args
+                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
+                // these don't match so return nothing
+                $this-&gt;assertEquals( false, wp_next_scheduled($hook) );
+                $this-&gt;assertEquals( false, wp_next_scheduled($hook, array(rand_str())) );
+
+                $this-&gt;assertEquals( $recur, wp_get_schedule($hook, $args) );
+
+        }
+
+        function test_unschedule_event() {
+                // schedule an event and make sure it's returned by wp_next_scheduled
+                $hook = rand_str();
+                $timestamp = strtotime('+1 hour');
+
+                wp_schedule_single_event( $timestamp, $hook );
+                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook) );
+
+                // now unschedule it and make sure it's gone
+                wp_unschedule_event( $timestamp, $hook );
+                $this-&gt;assertEquals( false, wp_next_scheduled($hook) );
+        }
+
+        function test_clear_schedule() {
+                $hook = rand_str();
+                $args = array(rand_str());
+
+                // schedule several events with and without arguments
+                wp_schedule_single_event( strtotime('+1 hour'), $hook );
+                wp_schedule_single_event( strtotime('+2 hour'), $hook );
+                wp_schedule_single_event( strtotime('+3 hour'), $hook, $args );
+                wp_schedule_single_event( strtotime('+4 hour'), $hook, $args );
+
+                // make sure they're returned by wp_next_scheduled()
+                $this-&gt;assertTrue( wp_next_scheduled($hook) &gt; 0 );
+                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
+
+                // clear the schedule for the no args events and make sure it's gone
+                wp_clear_scheduled_hook($hook);
+                $this-&gt;assertFalse( wp_next_scheduled($hook) );
+                // the args events should still be there
+                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
+
+                // clear the schedule for the args events and make sure they're gone too
+                // note: wp_clear_scheduled_hook() expects args passed directly, rather than as an array
+                wp_clear_scheduled_hook($hook, $args[0]);
+                $this-&gt;assertFalse( wp_next_scheduled($hook, $args) );
+        }
+
+        function test_clear_schedule_multiple_args() {
+                $hook = rand_str();
+                $args = array(rand_str(), rand_str());
+
+                // schedule several events with and without arguments
+                wp_schedule_single_event( strtotime('+1 hour'), $hook );
+                wp_schedule_single_event( strtotime('+2 hour'), $hook );
+                wp_schedule_single_event( strtotime('+3 hour'), $hook, $args );
+                wp_schedule_single_event( strtotime('+4 hour'), $hook, $args );
+
+                // make sure they're returned by wp_next_scheduled()
+                $this-&gt;assertTrue( wp_next_scheduled($hook) &gt; 0 );
+                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
+
+                // clear the schedule for the no args events and make sure it's gone
+                wp_clear_scheduled_hook($hook);
+                $this-&gt;assertFalse( wp_next_scheduled($hook) );
+                // the args events should still be there
+                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
+
+                // clear the schedule for the args events and make sure they're gone too
+                // note: wp_clear_scheduled_hook() used to expect args passed directly, rather than as an array pre WP 3.0
+                wp_clear_scheduled_hook($hook, $args[0], $args[1]);
+                $this-&gt;assertFalse( wp_next_scheduled($hook, $args) );
+        }
+
+        function test_clear_schedule_new_args() {
+                $this-&gt;knownWPBug(10468);
+                $hook = rand_str();
+                $args = array(rand_str());
+                $multi_hook = rand_str();
+                $multi_args = array(rand_str(), rand_str());
+                
+                // schedule several events with and without arguments
+                wp_schedule_single_event( strtotime('+1 hour'), $hook );
+                wp_schedule_single_event( strtotime('+2 hour'), $hook );
+                wp_schedule_single_event( strtotime('+3 hour'), $hook, $args );
+                wp_schedule_single_event( strtotime('+4 hour'), $hook, $args );
+                wp_schedule_single_event( strtotime('+5 hour'), $multi_hook, $multi_args );
+                wp_schedule_single_event( strtotime('+6 hour'), $multi_hook, $multi_args );
+                
+                // make sure they're returned by wp_next_scheduled()
+                $this-&gt;assertTrue( wp_next_scheduled($hook) &gt; 0 );
+                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
+
+                // clear the schedule for the no args events and make sure it's gone
+                wp_clear_scheduled_hook($hook);
+                $this-&gt;assertFalse( wp_next_scheduled($hook) );
+                // the args events should still be there
+                $this-&gt;assertTrue( wp_next_scheduled($hook, $args) &gt; 0 );
+
+                // clear the schedule for the args events and make sure they're gone too
+                // wp_clear_scheduled_hook() should take args as an array like the other functions.
+                wp_clear_scheduled_hook($hook, $args);
+                $this-&gt;assertFalse( wp_next_scheduled($hook, $args) );
+
+                // clear the schedule for the args events and make sure they're gone too
+                // wp_clear_scheduled_hook() should take args as an array like the other functions and does from WP 3.0
+                wp_clear_scheduled_hook($multi_hook, $multi_args);
+                $this-&gt;assertFalse( wp_next_scheduled($multi_hook, $multi_args) );
+                
+        }
+
+        function test_duplicate_event() {
+                $this-&gt;knownWPBug(6966);
+                // duplicate events close together should be skipped
+                $hook = rand_str();
+                $args = array(rand_str());
+                $ts1 = strtotime('+5 minutes');
+                $ts2 = strtotime('+3 minutes');
+                
+                // first one works
+                wp_schedule_single_event( $ts1, $hook, $args );
+                // second one is ignored
+                wp_schedule_single_event( $ts2, $hook, $args );
+                
+                // the next event should be at +5 minutes, not +3
+                $this-&gt;assertEquals( $ts1, wp_next_scheduled($hook, $args) );
+        }
+
+        function test_not_duplicate_event() {
+                $this-&gt;knownWPBug(6966);
+                // duplicate events far apart should work normally
+                $hook = rand_str();
+                $args = array(rand_str());
+                $ts1 = strtotime('+30 minutes');
+                $ts2 = strtotime('+3 minutes');
+                
+                // first one works
+                wp_schedule_single_event( $ts1, $hook, $args );
+                // second works too
+                wp_schedule_single_event( $ts2, $hook, $args );
+                
+                // the next event should be at +5 minutes, not +3
+                $this-&gt;assertEquals( $ts2, wp_next_scheduled($hook, $args) );
+                wp_unschedule_event( $ts2, $hook, $args );
+                // following event should be there too
+                $this-&gt;assertEquals( $ts1, wp_next_scheduled($hook, $args) );
+        }
+}
+
+/*
+ * Disable the WP Cron running test for the moment as it kills the whole test suite.
+ * TODO - Fix it to work with the new cron implementation in trunk
+ * 
+class WPTestCronRunning extends _WPEmptyBlog {
+        function setUp() {
+                parent::setUp();
+                // make sure the schedule is clear
+                _set_cron_array(array());
+        }
+
+        function tearDown() {
+                parent::tearDown();
+                // make sure the schedule is clear
+                _set_cron_array(array());
+        }
+        function _do_cron() {
+                // FIXME: wp-cron.php is difficult to test, could be wrapped in a function
+                $_GET['check'] = wp_hash('187425');
+                require(ABSPATH.'/wp-cron.php');
+        }
+
+        function test_run_schedule_single() {
+                // schedule an event, run it, and make sure the hook is called
+                $hook = rand_str();
+                $args = array(rand_str());
+                $timestamp = strtotime('-1 second');
+
+                // register a test action
+                $a = new MockAction();
+                add_action($hook, array(&amp;$a, 'action'));
+
+                // schedule an event for 1 second ago
+                wp_schedule_single_event( $timestamp, $hook, $args );
+                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
+
+                // run cron jobs
+                $this-&gt;_do_cron();
+
+                // our action should have been called once with the correct args
+                $this-&gt;assertEquals( 1, $a-&gt;get_call_count() );
+                $this-&gt;assertEquals( array($args), $a-&gt;get_args() );
+                
+                // it shouldn't appear in the schedule anymore
+                $this-&gt;assertFalse( wp_next_scheduled($hook, $args) );
+
+        }
+        
+        function test_run_schedule_recurring() {
+                // schedule a recurring event, run it, and make sure the hook is called
+                $hook = rand_str();
+                $args = array(rand_str());
+                $timestamp = strtotime('-1 second');
+                $recur = 'hourly';
+
+                // register a test action
+                $a = new MockAction();
+                add_action($hook, array(&amp;$a, 'action'));
+
+                // schedule an event for 1 second ago
+                wp_schedule_event( $timestamp, $recur, $hook, $args );
+                $this-&gt;assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
+                $this-&gt;assertEquals( $recur, wp_get_schedule($hook, $args) );
+
+                // run cron jobs
+                $this-&gt;_do_cron();
+
+                // our action should have been called once with the correct args
+                $this-&gt;assertEquals( 1, $a-&gt;get_call_count() );
+                $this-&gt;assertEquals( array($args), $a-&gt;get_args() );
+                
+                // it should appear in the schedule to run again in an hour's time
+                $this-&gt;assertEquals( $timestamp + 3600, wp_next_scheduled($hook, $args) );
+
+        }
+}
+*/
+?&gt;
</ins><span class="cx">Property changes on: wp-testcase/test_cron.php
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_filtersphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_filters.php (365 => 366)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_filters.php        2011-06-03 05:17:22 UTC (rev 365)
+++ wp-testcase/test_filters.php        2011-06-05 07:25:21 UTC (rev 366)
</span><span class="lines">@@ -1,238 +1,238 @@
</span><del>-&lt;?php
-
-// test do_action and related functions
-
-class WPTestFilters extends WPTestCase {
-
-        function test_simple_filter() {
-                $a = new MockAction();
-                $tag = rand_str();
-                $val = rand_str();
-
-                add_filter($tag, array(&amp;$a, 'filter'));
-                $this-&gt;assertEquals($val, apply_filters($tag, $val));
-
-                // only one event occurred for the hook, with empty args
-                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
-                // only our hook was called
-                $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
-
-                $args = array_pop($a-&gt;get_args());
-                $this-&gt;assertEquals(array($val), $args);
-        }
-
-        function test_remove_filter() {
-                $a = new MockAction();
-                $tag = rand_str();
-                $val = rand_str();
-
-                add_filter($tag, array(&amp;$a, 'filter'));
-                $this-&gt;assertEquals($val, apply_filters($tag, $val));
-
-                // make sure our hook was called correctly
-                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
-                $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
-
-                // now remove the filter, do it again, and make sure it's not called this time
-                remove_filter($tag, array(&amp;$a, 'filter'));
-                $this-&gt;assertEquals($val, apply_filters($tag, $val));
-                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
-                $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
-
-        }
-        
-        function test_has_filter() {
-                        $tag = rand_str();
-                        $func = rand_str();
-                        
-                        $this-&gt;assertFalse( has_filter($tag, $func) );
-                        $this-&gt;assertFalse( has_filter($tag) );
-                        add_filter($tag, $func);
-                        $this-&gt;assertEquals( 10, has_filter($tag, $func) );
-                        $this-&gt;assertTrue( has_filter($tag) );
-                        remove_filter($tag, $func);
-                        $this-&gt;assertFalse( has_filter($tag, $func) );
-                        $this-&gt;assertFalse( has_filter($tag) );
-        }
-
-        // one tag with multiple filters
-        function test_multiple_filters() {
-                $a1 = new MockAction();
-                $a2 = new MockAction();
-                $tag = rand_str();
-                $val = rand_str();
-
-                // add both filters to the hook
-                add_filter($tag, array(&amp;$a1, 'filter'));
-                add_filter($tag, array(&amp;$a2, 'filter'));
-
-                $this-&gt;assertEquals($val, apply_filters($tag, $val));
-
-                // both filters called once each
-                $this-&gt;assertEquals(1, $a1-&gt;get_call_count());
-                $this-&gt;assertEquals(1, $a2-&gt;get_call_count());
-        }
-
-        function test_filter_args_1() {
-                $a = new MockAction();
-                $tag = rand_str();
-                $val = rand_str();
-                $arg1 = rand_str();
-
-                add_filter($tag, array(&amp;$a, 'filter'), 10, 2);
-                // call the filter with a single argument
-                $this-&gt;assertEquals($val, apply_filters($tag, $val, $arg1));
-
-                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
-                $this-&gt;assertEquals(array($val, $arg1), array_pop($a-&gt;get_args()));
-        }
-
-        function test_filter_args_2() {
-                $a1 = new MockAction();
-                $a2 = new MockAction();
-                $tag = rand_str();
-                $val = rand_str();
-                $arg1 = rand_str();
-                $arg2 = rand_str();
-
-                // a1 accepts two arguments, a2 doesn't
-                add_filter($tag, array(&amp;$a1, 'filter'), 10, 3);
-                add_filter($tag, array(&amp;$a2, 'filter'));
-                // call the filter with two arguments
-                $this-&gt;assertEquals($val, apply_filters($tag, $val, $arg1, $arg2));
-
-                // a1 should be called with both args
-                $this-&gt;assertEquals(1, $a1-&gt;get_call_count());
-                $this-&gt;assertEquals(array($val, $arg1, $arg2), array_pop($a1-&gt;get_args()));
-
-                // a2 should be called with one only
-                $this-&gt;assertEquals(1, $a2-&gt;get_call_count());
-                $this-&gt;assertEquals(array($val), array_pop($a2-&gt;get_args()));
-        }
-
-        function test_filter_priority() {
-                $a = new MockAction();
-                $tag = rand_str();
-                $val = rand_str();
-
-                // make two filters with different priorities
-                add_filter($tag, array(&amp;$a, 'filter'), 10);
-                add_filter($tag, array(&amp;$a, 'filter2'), 9);
-                $this-&gt;assertEquals($val, apply_filters($tag, $val));
-
-                // there should be two events, one per filter
-                $this-&gt;assertEquals(2, $a-&gt;get_call_count());
-
-                $expected = array (
-                        // filter2 is called first because it has priority 9
-                        array (
-                                'filter' =&gt; 'filter2',
-                                'tag' =&gt; $tag,
-                                'args' =&gt; array($val)
-                        ),
-                        // filter 1 is called second
-                        array (
-                                'filter' =&gt; 'filter',
-                                'tag' =&gt; $tag,
-                                'args' =&gt; array($val)
-                        ),
-                );
-
-                $this-&gt;assertEquals($expected, $a-&gt;get_events());
-        }
-
-        function test_all_filter() {
-                $a = new MockAction();
-                $tag1 = rand_str();
-                $tag2 = rand_str();
-                $val = rand_str();
-
-                // add an 'all' filter
-                add_filter('all', array(&amp;$a, 'filterall'));
-                // do some filters
-                $this-&gt;assertEquals($val, apply_filters($tag1, $val));
-                $this-&gt;assertEquals($val, apply_filters($tag2, $val));
-                $this-&gt;assertEquals($val, apply_filters($tag1, $val));
-                $this-&gt;assertEquals($val, apply_filters($tag1, $val));
-
-                // our filter should have been called once for each apply_filters call
-                $this-&gt;assertEquals(4, $a-&gt;get_call_count());
-                // the right hooks should have been called in order
-                $this-&gt;assertEquals(array($tag1, $tag2, $tag1, $tag1), $a-&gt;get_tags());
-
-                remove_filter('all', array(&amp;$a, 'filterall'));
-                $this-&gt;assertFalse( has_filter('all', array(&amp;$a, 'filterall')) );
-
-        }
-
-        function test_remove_all_filter() {
-                $a = new MockAction();
-                $tag = rand_str();
-                $val = rand_str();
-
-                add_filter('all', array(&amp;$a, 'filterall'));
-                $this-&gt;assertTrue( has_filter('all') );
-                $this-&gt;assertEquals( 10, has_filter('all', array(&amp;$a, 'filterall')) );
-                $this-&gt;assertEquals($val, apply_filters($tag, $val));
-
-                // make sure our hook was called correctly
-                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
-                $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
-
-                // now remove the filter, do it again, and make sure it's not called this time
-                remove_filter('all', array(&amp;$a, 'filterall'));
-                $this-&gt;assertFalse( has_filter('all', array(&amp;$a, 'filterall')) );
-                $this-&gt;assertFalse( has_filter('all') );
-                $this-&gt;assertEquals($val, apply_filters($tag, $val));
-                // call cound should remain at 1
-                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
-                $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
-        }
-
-        function test_filter_ref_array() {
-                $this-&gt;knownWPBug(9886);
-                $obj = new stdClass();
-                $a = new MockAction();
-                $tag = rand_str();
-
-                add_action($tag, array(&amp;$a, 'filter'));
-
-                apply_filters_ref_array($tag, array(&amp;$obj));
-
-                $args = $a-&gt;get_args();
-                $this-&gt;assertSame($args[0][0], $obj);
-                // just in case we don't trust assertSame
-                $obj-&gt;foo = true;
-                $this-&gt;assertFalse( empty($args[0][0]-&gt;foo) );
-        }
-
-        function test_filter_ref_array_result() {
-                $this-&gt;knownWPBug(12723);
-                $obj = new stdClass();
-                $a = new MockAction();
-                $b = new MockAction();
-                $tag = rand_str();
-
-                add_action($tag, array(&amp;$a, 'filter_append'), 10, 2);
-                add_action($tag, array(&amp;$b, 'filter_append'), 10, 2);
-                
-                $result = apply_filters_ref_array($tag, array('string', &amp;$obj));
-
-                $this-&gt;assertEquals($result, 'string_append_append');
-                
-                $args = $a-&gt;get_args();
-                $this-&gt;assertSame($args[0][1], $obj);
-                // just in case we don't trust assertSame
-                $obj-&gt;foo = true;
-                $this-&gt;assertFalse( empty($args[0][1]-&gt;foo) );
-
-                $args = $b-&gt;get_args();
-                $this-&gt;assertSame($args[0][1], $obj);
-                // just in case we don't trust assertSame
-                $obj-&gt;foo = true;
-                $this-&gt;assertFalse( empty($args[0][1]-&gt;foo) );
-                
-        }
-}
-
-?&gt;
</del><ins>+&lt;?php
+
+// test do_action and related functions
+
+class WPTestFilters extends WPTestCase {
+
+        function test_simple_filter() {
+                $a = new MockAction();
+                $tag = rand_str();
+                $val = rand_str();
+
+                add_filter($tag, array(&amp;$a, 'filter'));
+                $this-&gt;assertEquals($val, apply_filters($tag, $val));
+
+                // only one event occurred for the hook, with empty args
+                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
+                // only our hook was called
+                $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
+
+                $args = array_pop($a-&gt;get_args());
+                $this-&gt;assertEquals(array($val), $args);
+        }
+
+        function test_remove_filter() {
+                $a = new MockAction();
+                $tag = rand_str();
+                $val = rand_str();
+
+                add_filter($tag, array(&amp;$a, 'filter'));
+                $this-&gt;assertEquals($val, apply_filters($tag, $val));
+
+                // make sure our hook was called correctly
+                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
+                $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
+
+                // now remove the filter, do it again, and make sure it's not called this time
+                remove_filter($tag, array(&amp;$a, 'filter'));
+                $this-&gt;assertEquals($val, apply_filters($tag, $val));
+                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
+                $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
+
+        }
+        
+        function test_has_filter() {
+                        $tag = rand_str();
+                        $func = rand_str();
+                        
+                        $this-&gt;assertFalse( has_filter($tag, $func) );
+                        $this-&gt;assertFalse( has_filter($tag) );
+                        add_filter($tag, $func);
+                        $this-&gt;assertEquals( 10, has_filter($tag, $func) );
+                        $this-&gt;assertTrue( has_filter($tag) );
+                        remove_filter($tag, $func);
+                        $this-&gt;assertFalse( has_filter($tag, $func) );
+                        $this-&gt;assertFalse( has_filter($tag) );
+        }
+
+        // one tag with multiple filters
+        function test_multiple_filters() {
+                $a1 = new MockAction();
+                $a2 = new MockAction();
+                $tag = rand_str();
+                $val = rand_str();
+
+                // add both filters to the hook
+                add_filter($tag, array(&amp;$a1, 'filter'));
+                add_filter($tag, array(&amp;$a2, 'filter'));
+
+                $this-&gt;assertEquals($val, apply_filters($tag, $val));
+
+                // both filters called once each
+                $this-&gt;assertEquals(1, $a1-&gt;get_call_count());
+                $this-&gt;assertEquals(1, $a2-&gt;get_call_count());
+        }
+
+        function test_filter_args_1() {
+                $a = new MockAction();
+                $tag = rand_str();
+                $val = rand_str();
+                $arg1 = rand_str();
+
+                add_filter($tag, array(&amp;$a, 'filter'), 10, 2);
+                // call the filter with a single argument
+                $this-&gt;assertEquals($val, apply_filters($tag, $val, $arg1));
+
+                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
+                $this-&gt;assertEquals(array($val, $arg1), array_pop($a-&gt;get_args()));
+        }
+
+        function test_filter_args_2() {
+                $a1 = new MockAction();
+                $a2 = new MockAction();
+                $tag = rand_str();
+                $val = rand_str();
+                $arg1 = rand_str();
+                $arg2 = rand_str();
+
+                // a1 accepts two arguments, a2 doesn't
+                add_filter($tag, array(&amp;$a1, 'filter'), 10, 3);
+                add_filter($tag, array(&amp;$a2, 'filter'));
+                // call the filter with two arguments
+                $this-&gt;assertEquals($val, apply_filters($tag, $val, $arg1, $arg2));
+
+                // a1 should be called with both args
+                $this-&gt;assertEquals(1, $a1-&gt;get_call_count());
+                $this-&gt;assertEquals(array($val, $arg1, $arg2), array_pop($a1-&gt;get_args()));
+
+                // a2 should be called with one only
+                $this-&gt;assertEquals(1, $a2-&gt;get_call_count());
+                $this-&gt;assertEquals(array($val), array_pop($a2-&gt;get_args()));
+        }
+
+        function test_filter_priority() {
+                $a = new MockAction();
+                $tag = rand_str();
+                $val = rand_str();
+
+                // make two filters with different priorities
+                add_filter($tag, array(&amp;$a, 'filter'), 10);
+                add_filter($tag, array(&amp;$a, 'filter2'), 9);
+                $this-&gt;assertEquals($val, apply_filters($tag, $val));
+
+                // there should be two events, one per filter
+                $this-&gt;assertEquals(2, $a-&gt;get_call_count());
+
+                $expected = array (
+                        // filter2 is called first because it has priority 9
+                        array (
+                                'filter' =&gt; 'filter2',
+                                'tag' =&gt; $tag,
+                                'args' =&gt; array($val)
+                        ),
+                        // filter 1 is called second
+                        array (
+                                'filter' =&gt; 'filter',
+                                'tag' =&gt; $tag,
+                                'args' =&gt; array($val)
+                        ),
+                );
+
+                $this-&gt;assertEquals($expected, $a-&gt;get_events());
+        }
+
+        function test_all_filter() {
+                $a = new MockAction();
+                $tag1 = rand_str();
+                $tag2 = rand_str();
+                $val = rand_str();
+
+                // add an 'all' filter
+                add_filter('all', array(&amp;$a, 'filterall'));
+                // do some filters
+                $this-&gt;assertEquals($val, apply_filters($tag1, $val));
+                $this-&gt;assertEquals($val, apply_filters($tag2, $val));
+                $this-&gt;assertEquals($val, apply_filters($tag1, $val));
+                $this-&gt;assertEquals($val, apply_filters($tag1, $val));
+
+                // our filter should have been called once for each apply_filters call
+                $this-&gt;assertEquals(4, $a-&gt;get_call_count());
+                // the right hooks should have been called in order
+                $this-&gt;assertEquals(array($tag1, $tag2, $tag1, $tag1), $a-&gt;get_tags());
+
+                remove_filter('all', array(&amp;$a, 'filterall'));
+                $this-&gt;assertFalse( has_filter('all', array(&amp;$a, 'filterall')) );
+
+        }
+
+        function test_remove_all_filter() {
+                $a = new MockAction();
+                $tag = rand_str();
+                $val = rand_str();
+
+                add_filter('all', array(&amp;$a, 'filterall'));
+                $this-&gt;assertTrue( has_filter('all') );
+                $this-&gt;assertEquals( 10, has_filter('all', array(&amp;$a, 'filterall')) );
+                $this-&gt;assertEquals($val, apply_filters($tag, $val));
+
+                // make sure our hook was called correctly
+                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
+                $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
+
+                // now remove the filter, do it again, and make sure it's not called this time
+                remove_filter('all', array(&amp;$a, 'filterall'));
+                $this-&gt;assertFalse( has_filter('all', array(&amp;$a, 'filterall')) );
+                $this-&gt;assertFalse( has_filter('all') );
+                $this-&gt;assertEquals($val, apply_filters($tag, $val));
+                // call cound should remain at 1
+                $this-&gt;assertEquals(1, $a-&gt;get_call_count());
+                $this-&gt;assertEquals(array($tag), $a-&gt;get_tags());
+        }
+
+        function test_filter_ref_array() {
+                $this-&gt;knownWPBug(9886);
+                $obj = new stdClass();
+                $a = new MockAction();
+                $tag = rand_str();
+
+                add_action($tag, array(&amp;$a, 'filter'));
+
+                apply_filters_ref_array($tag, array(&amp;$obj));
+
+                $args = $a-&gt;get_args();
+                $this-&gt;assertSame($args[0][0], $obj);
+                // just in case we don't trust assertSame
+                $obj-&gt;foo = true;
+                $this-&gt;assertFalse( empty($args[0][0]-&gt;foo) );
+        }
+
+        function test_filter_ref_array_result() {
+                $this-&gt;knownWPBug(12723);
+                $obj = new stdClass();
+                $a = new MockAction();
+                $b = new MockAction();
+                $tag = rand_str();
+
+                add_action($tag, array(&amp;$a, 'filter_append'), 10, 2);
+                add_action($tag, array(&amp;$b, 'filter_append'), 10, 2);
+                
+                $result = apply_filters_ref_array($tag, array('string', &amp;$obj));
+
+                $this-&gt;assertEquals($result, 'string_append_append');
+                
+                $args = $a-&gt;get_args();
+                $this-&gt;assertSame($args[0][1], $obj);
+                // just in case we don't trust assertSame
+                $obj-&gt;foo = true;
+                $this-&gt;assertFalse( empty($args[0][1]-&gt;foo) );
+
+                $args = $b-&gt;get_args();
+                $this-&gt;assertSame($args[0][1], $obj);
+                // just in case we don't trust assertSame
+                $obj-&gt;foo = true;
+                $this-&gt;assertFalse( empty($args[0][1]-&gt;foo) );
+                
+        }
+}
+
+?&gt;
</ins><span class="cx">Property changes on: wp-testcase/test_filters.php
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_httpphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_http.php (365 => 366)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_http.php        2011-06-03 05:17:22 UTC (rev 365)
+++ wp-testcase/test_http.php        2011-06-05 07:25:21 UTC (rev 366)
</span><span class="lines">@@ -1,157 +1,157 @@
</span><del>-&lt;?php
-// Note, When running these tests, remember that some things are done differently based on safe_mode
-// You can run the test in safe_mode like such: php -d safe_mode=on wp-test.php - you may also need `-d safe_mode_gid=1` to relax the safe_mode checks to allow inclusion of PEAR.
-// The WP_HTTP tests require a class-http.php file of r17550 or later.
-class _WPHTTP extends WPTestCase {
-        var $redirection_script = 'http://tools.dd32.id.au/redirect/'; // You can use your own version here, You can find it in wp-testdata/WPHTTP-testcase-redirection-script.php
-
-        function SetUp() {
-
-                if ( is_callable( array('WP_HTTP', '_getTransport') ) ) {
-                        $this-&gt;markTestSkipped('The WP_HTTP tests require a class-http.php file of r17550 or later.');
-                        return;
-                }
-
-                $class = &quot;WP_HTTP_&quot; . $this-&gt;transport;
-                if ( !call_user_func( array($class, 'test') ) ) {
-                        $this-&gt;markTestSkipped( sprintf('The transport %s is not supported on this system', $this-&gt;transport) );
-                }
-
-                // Disable all transports aside from this one.
-                foreach ( array( 'curl', 'streams', 'fsockopen' ) as $t ) {
-                        remove_filter( &quot;use_{$t}_transport&quot;, '__return_false' ); // Just strip them all
-                        if ( $t != $this-&gt;transport )
-                                add_filter( &quot;use_{$t}_transport&quot;, '__return_false' ); // and add it back if need be..
-                }
-        }
-
-        function tearDown() {
-                foreach ( array( 'curl', 'streams', 'fsockopen' ) as $t ) {
-                        remove_filter( &quot;use_{$t}_transport&quot;, '__return_false' );
-                }
-        }
-
-        function test_redirect_on_301() {        
-                // 5 : 5 &amp; 301
-                $res = wp_remote_request($this-&gt;redirection_script . '?code=301&amp;rt=' . 5, array('redirection' =&gt; 5) );
-                $this-&gt;assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
-        }
-
-        function test_redirect_on_302() {        
-                // 5 : 5 &amp; 302
-                $res = wp_remote_request($this-&gt;redirection_script . '?code=302&amp;rt=' . 5, array('redirection' =&gt; 5) );
-                $this-&gt;assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
-        }
-        
-        function test_redirect_on_301_no_redirect() {
-                $this-&gt;knownWPBug(16855);
-                // 5 &gt; 0 &amp; 301
-                $res = wp_remote_request($this-&gt;redirection_script . '?code=301&amp;rt=' . 5, array('redirection' =&gt; 0) );
-                $this-&gt;assertEquals(301, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
-        }
-
-        function test_redirect_on_302_no_redirect() {
-                $this-&gt;knownWPBug(16855);
-                // 5 &gt; 0 &amp; 302
-                $res = wp_remote_request($this-&gt;redirection_script . '?code=302&amp;rt=' . 5, array('redirection' =&gt; 0) );
-                $this-&gt;assertEquals(302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
-        }
-
-        function test_redirections_equal() {        
-                // 5 - 5
-                $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 5, array('redirection' =&gt; 5) );
-                $this-&gt;assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
-        }
-
-        function test_no_head_redirections() {
-                // No redirections on HEAD request:
-                $res = wp_remote_request($this-&gt;redirection_script . '?code=302&amp;rt=' . 1, array('method' =&gt; 'HEAD') );
-                $this-&gt;assertEquals( 302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
-        }
-
-        function test_redirect_on_head() {
-                $this-&gt;knownWPBug(16855);
-                // Redirections on HEAD request when Requested
-                $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 5, array('redirection' =&gt; 5, 'method' =&gt; 'HEAD') );
-                $this-&gt;assertEquals( 200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
-        }
-
-        function test_redirections_greater() {
-                // 10 &gt; 5
-                $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 10, array('redirection' =&gt; 5) );
-                $this-&gt;assertTrue( is_wp_error($res), print_r($res, true) );
-        }
-
-        function test_redirections_greater_edgecase() {
-                // 6 &gt; 5 (close edgecase)
-                $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 6, array('redirection' =&gt; 5) );
-                $this-&gt;assertTrue( is_wp_error($res) );
-        }
-
-        function test_redirections_less_edgecase() {
-                // 4 &lt; 5 (close edgecase)
-                $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 4, array('redirection' =&gt; 5) );
-                $this-&gt;assertFalse( is_wp_error($res) );
-        }
-
-        function test_redirections_zero_redirections_specified() {
-                $this-&gt;knownWPBug(16855);
-                // 0 redirections asked for, Should return the document?
-                $res = wp_remote_request($this-&gt;redirection_script . '?code=302&amp;rt=' . 5, array('redirection' =&gt; 0) );
-                $this-&gt;assertEquals( 302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );                
-        }
-        
-        function test_location_header_on_200() {
-                //$this-&gt;knownWPBug(16889);
-                // 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.
-                
-                // Do not redirect on non 3xx status codes
-                //$res = wp_remote_request( $this-&gt;redirection_script . '?200-location=true' ); // Prints PASS on initial load, FAIL if the client follows the specified redirection
-                //$this-&gt;assertEquals( 'PASS', $res['body']);
-        }
-        
-        function test_send_headers() {
-                $this-&gt;knownWPBug(11888);
-                // Test that the headers sent are recieved by the server
-                $headers = array('test1' =&gt; 'test', 'test2' =&gt; 0, 'test3' =&gt; '');
-                $res = wp_remote_request( $this-&gt;redirection_script . '?header-check', array('headers' =&gt; $headers) );
-
-                $headers = array();
-                foreach ( explode(&quot;\n&quot;, $res['body']) as $key =&gt; $value ) {
-                        if ( empty($value) )
-                                continue;
-                        $parts = explode(':', $value,2);
-                        unset($heaers[$key]);
-                        $headers[ $parts[0] ] = $parts[1];
-                }
-
-                $this-&gt;assertTrue( isset($headers['test1']) &amp;&amp; 'test' == $headers['test1'] );
-                $this-&gt;assertTrue( isset($headers['test2']) &amp;&amp; '0' === $headers['test2'] );
-                // cURL/HTTP Extension Note: Will never pass, cURL does not pass headers with an empty value.
-                // Should it be that empty headers with empty values are NOT sent?
-                //$this-&gt;assertTrue( isset($headers['test3']) &amp;&amp; '' === $headers['test3'] );
-        }
-        
-        function test_file_stream() {
-                $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
-                $size = 87348;
-                $res = wp_remote_request( $url, array( 'stream' =&gt; true, 'timeout' =&gt; 30 ) ); //Auto generate the filename.
-
-                $this-&gt;assertEquals( '', $res['body'] ); // The body should be empty.
-                $this-&gt;assertEquals( $size, $res['headers']['content-length'] ); // Check the headers are returned (and the size is the same..)
-                $this-&gt;assertEquals( $size, filesize($res['filename']) ); // Check that the file is written to disk correctly without any extra characters
-
-                unlink($res['filename']); // Remove the temporary file
-        }
-}
-
-// Stubs to test each transport
-class WPHTTP_curl extends _WPHTTP {
-        var $transport = 'curl';
-}
-class WPHTTP_streams extends _WPHTTP {
-        var $transport = 'streams';
-}
-class WPHTTP_fsockopen extends _WPHTTP {
-        var $transport = 'fsockopen';
</del><ins>+&lt;?php
+// Note, When running these tests, remember that some things are done differently based on safe_mode
+// You can run the test in safe_mode like such: php -d safe_mode=on wp-test.php - you may also need `-d safe_mode_gid=1` to relax the safe_mode checks to allow inclusion of PEAR.
+// The WP_HTTP tests require a class-http.php file of r17550 or later.
+class _WPHTTP extends WPTestCase {
+        var $redirection_script = 'http://tools.dd32.id.au/redirect/'; // You can use your own version here, You can find it in wp-testdata/WPHTTP-testcase-redirection-script.php
+
+        function SetUp() {
+
+                if ( is_callable( array('WP_HTTP', '_getTransport') ) ) {
+                        $this-&gt;markTestSkipped('The WP_HTTP tests require a class-http.php file of r17550 or later.');
+                        return;
+                }
+
+                $class = &quot;WP_HTTP_&quot; . $this-&gt;transport;
+                if ( !call_user_func( array($class, 'test') ) ) {
+                        $this-&gt;markTestSkipped( sprintf('The transport %s is not supported on this system', $this-&gt;transport) );
+                }
+
+                // Disable all transports aside from this one.
+                foreach ( array( 'curl', 'streams', 'fsockopen' ) as $t ) {
+                        remove_filter( &quot;use_{$t}_transport&quot;, '__return_false' ); // Just strip them all
+                        if ( $t != $this-&gt;transport )
+                                add_filter( &quot;use_{$t}_transport&quot;, '__return_false' ); // and add it back if need be..
+                }
+        }
+
+        function tearDown() {
+                foreach ( array( 'curl', 'streams', 'fsockopen' ) as $t ) {
+                        remove_filter( &quot;use_{$t}_transport&quot;, '__return_false' );
+                }
+        }
+
+        function test_redirect_on_301() {        
+                // 5 : 5 &amp; 301
+                $res = wp_remote_request($this-&gt;redirection_script . '?code=301&amp;rt=' . 5, array('redirection' =&gt; 5) );
+                $this-&gt;assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
+        }
+
+        function test_redirect_on_302() {        
+                // 5 : 5 &amp; 302
+                $res = wp_remote_request($this-&gt;redirection_script . '?code=302&amp;rt=' . 5, array('redirection' =&gt; 5) );
+                $this-&gt;assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
+        }
+        
+        function test_redirect_on_301_no_redirect() {
+                $this-&gt;knownWPBug(16855);
+                // 5 &gt; 0 &amp; 301
+                $res = wp_remote_request($this-&gt;redirection_script . '?code=301&amp;rt=' . 5, array('redirection' =&gt; 0) );
+                $this-&gt;assertEquals(301, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
+        }
+
+        function test_redirect_on_302_no_redirect() {
+                $this-&gt;knownWPBug(16855);
+                // 5 &gt; 0 &amp; 302
+                $res = wp_remote_request($this-&gt;redirection_script . '?code=302&amp;rt=' . 5, array('redirection' =&gt; 0) );
+                $this-&gt;assertEquals(302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
+        }
+
+        function test_redirections_equal() {        
+                // 5 - 5
+                $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 5, array('redirection' =&gt; 5) );
+                $this-&gt;assertEquals(200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
+        }
+
+        function test_no_head_redirections() {
+                // No redirections on HEAD request:
+                $res = wp_remote_request($this-&gt;redirection_script . '?code=302&amp;rt=' . 1, array('method' =&gt; 'HEAD') );
+                $this-&gt;assertEquals( 302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
+        }
+
+        function test_redirect_on_head() {
+                $this-&gt;knownWPBug(16855);
+                // Redirections on HEAD request when Requested
+                $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 5, array('redirection' =&gt; 5, 'method' =&gt; 'HEAD') );
+                $this-&gt;assertEquals( 200, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );
+        }
+
+        function test_redirections_greater() {
+                // 10 &gt; 5
+                $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 10, array('redirection' =&gt; 5) );
+                $this-&gt;assertTrue( is_wp_error($res), print_r($res, true) );
+        }
+
+        function test_redirections_greater_edgecase() {
+                // 6 &gt; 5 (close edgecase)
+                $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 6, array('redirection' =&gt; 5) );
+                $this-&gt;assertTrue( is_wp_error($res) );
+        }
+
+        function test_redirections_less_edgecase() {
+                // 4 &lt; 5 (close edgecase)
+                $res = wp_remote_request($this-&gt;redirection_script . '?rt=' . 4, array('redirection' =&gt; 5) );
+                $this-&gt;assertFalse( is_wp_error($res) );
+        }
+
+        function test_redirections_zero_redirections_specified() {
+                $this-&gt;knownWPBug(16855);
+                // 0 redirections asked for, Should return the document?
+                $res = wp_remote_request($this-&gt;redirection_script . '?code=302&amp;rt=' . 5, array('redirection' =&gt; 0) );
+                $this-&gt;assertEquals( 302, (is_wp_error($res) ? 0 : (int)$res['response']['code']) );                
+        }
+        
+        function test_location_header_on_200() {
+                //$this-&gt;knownWPBug(16889);
+                // 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.
+                
+                // Do not redirect on non 3xx status codes
+                //$res = wp_remote_request( $this-&gt;redirection_script . '?200-location=true' ); // Prints PASS on initial load, FAIL if the client follows the specified redirection
+                //$this-&gt;assertEquals( 'PASS', $res['body']);
+        }
+        
+        function test_send_headers() {
+                $this-&gt;knownWPBug(11888);
+                // Test that the headers sent are recieved by the server
+                $headers = array('test1' =&gt; 'test', 'test2' =&gt; 0, 'test3' =&gt; '');
+                $res = wp_remote_request( $this-&gt;redirection_script . '?header-check', array('headers' =&gt; $headers) );
+
+                $headers = array();
+                foreach ( explode(&quot;\n&quot;, $res['body']) as $key =&gt; $value ) {
+                        if ( empty($value) )
+                                continue;
+                        $parts = explode(':', $value,2);
+                        unset($heaers[$key]);
+                        $headers[ $parts[0] ] = $parts[1];
+                }
+
+                $this-&gt;assertTrue( isset($headers['test1']) &amp;&amp; 'test' == $headers['test1'] );
+                $this-&gt;assertTrue( isset($headers['test2']) &amp;&amp; '0' === $headers['test2'] );
+                // cURL/HTTP Extension Note: Will never pass, cURL does not pass headers with an empty value.
+                // Should it be that empty headers with empty values are NOT sent?
+                //$this-&gt;assertTrue( isset($headers['test3']) &amp;&amp; '' === $headers['test3'] );
+        }
+        
+        function test_file_stream() {
+                $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
+                $size = 87348;
+                $res = wp_remote_request( $url, array( 'stream' =&gt; true, 'timeout' =&gt; 30 ) ); //Auto generate the filename.
+
+                $this-&gt;assertEquals( '', $res['body'] ); // The body should be empty.
+                $this-&gt;assertEquals( $size, $res['headers']['content-length'] ); // Check the headers are returned (and the size is the same..)
+                $this-&gt;assertEquals( $size, filesize($res['filename']) ); // Check that the file is written to disk correctly without any extra characters
+
+                unlink($res['filename']); // Remove the temporary file
+        }
+}
+
+// Stubs to test each transport
+class WPHTTP_curl extends _WPHTTP {
+        var $transport = 'curl';
+}
+class WPHTTP_streams extends _WPHTTP {
+        var $transport = 'streams';
+}
+class WPHTTP_fsockopen extends _WPHTTP {
+        var $transport = 'fsockopen';
</ins><span class="cx"> }
</span><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: wp-testcase/test_http.php
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_imagephp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_image.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_import_wpphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_import_wp.php (365 => 366)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_import_wp.php        2011-06-03 05:17:22 UTC (rev 365)
+++ wp-testcase/test_import_wp.php        2011-06-05 07:25:21 UTC (rev 366)
</span><span class="lines">@@ -1,486 +1,486 @@
</span><del>-&lt;?php
-
-#include_once(DIR_TESTROOT.'/wp-testlib/wp-profiler.php');
-
-// need to include the importer as an external, so path may need to change...
-
-// _nuke_main_tables style function on tearDown? (Should this be part of _WPEmptyBlog tearDown?)
-       
-class WXRParserTest extends WPTestCase {
-        function setUp() {
-                parent::setUp();
-
-                if ( ! defined( 'WP_IMPORTING' ) )
-                        define( 'WP_IMPORTING', true );
-                        
-                if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
-                        define( 'WP_LOAD_IMPORTERS', true );                
-
-                require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
-        }
-
-        function tearDown() {
-                parent::tearDown();
-        }
-        
-        function test_malformed_wxr() {
-                $file = DIR_TESTDATA . '/export/malformed.xml';
-        
-                // regex based parser cannot detect malformed XML
-                foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML' ) as $p ) {
-                        $parser = new $p;
-                        $result = $parser-&gt;parse($file);
-                        $this-&gt;assertTrue( is_wp_error( $result ) );
-                        $this-&gt;assertEquals( 'There was an error when reading this WXR file', $result-&gt;get_error_message() );        
-                }        
-        }        
-
-        function test_invalid_wxr() {
-                $f1 = DIR_TESTDATA . '/export/missing-version-tag.xml';
-                $f2 = DIR_TESTDATA . '/export/invalid-version-tag.xml';
-        
-                foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
-                        foreach ( array( $f1, $f2 ) as $file ) {
-                                $parser = new $p;
-                                $result = $parser-&gt;parse( $file );                                
-                                $this-&gt;assertTrue( is_wp_error( $result ) );
-                                $this-&gt;assertEquals( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result-&gt;get_error_message() );        
-                        }
-                }                        
-        }
-        
-        function test_wxr_version_1_1() {
-                $file = DIR_TESTDATA . '/export/valid-wxr-1.1.xml';
-                         
-                foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
-                        $message = $p . ' failed';
-                        $parser = new $p;
-                        $result = $parser-&gt;parse( $file );        
-                        
-                        $this-&gt;assertTrue( is_array( $result ), $message );                        
-                        $this-&gt;assertEquals( 'http://localhost/', $result['base_url'], $message );
-                        $this-&gt;assertEquals( array(  
-                                'author_id' =&gt; 2,
-                                'author_login' =&gt; 'john',
-                                'author_email' =&gt; 'johndoe@example.org',
-                                'author_display_name' =&gt; 'John Doe',
-                                'author_first_name' =&gt; 'John',
-                                'author_last_name' =&gt; 'Doe'
-                        ), $result['authors']['john'], $message );
-                        $this-&gt;assertEquals( array(
-                                'term_id' =&gt; 3,
-                                'category_nicename' =&gt; 'alpha',
-                                'category_parent' =&gt; '',
-                                'cat_name' =&gt; 'alpha',
-                                'category_description' =&gt; 'The alpha category'                        
-                        ), $result['categories'][0], $message );
-                        $this-&gt;assertEquals( array(
-                                'term_id' =&gt; 22,
-                                'tag_slug' =&gt; 'clippable',
-                                'tag_name' =&gt; 'Clippable',
-                                'tag_description' =&gt; 'The Clippable post_tag'                
-                        ), $result['tags'][0], $message );
-                        $this-&gt;assertEquals( array(
-                                'term_id' =&gt; 40,
-                                'term_taxonomy' =&gt; 'post_tax',
-                                'slug' =&gt; 'bieup',
-                                'term_parent' =&gt; '',                                
-                                'term_name' =&gt; 'bieup',
-                                'term_description' =&gt; 'The bieup post_tax'                
-                        ), $result['terms'][0], $message );                                        
-
-                        $this-&gt;assertEquals( 2, count($result['posts']), $message );
-                        $this-&gt;assertEquals( 19, count($result['posts'][0]), $message );
-                        $this-&gt;assertEquals( 18, count($result['posts'][1]), $message );
-                        $this-&gt;assertEquals( array(
-                                array( 'name' =&gt; 'alpha', 'slug' =&gt; 'alpha', 'domain' =&gt; 'category' ),
-                                array( 'name' =&gt; 'Clippable', 'slug' =&gt; 'clippable', 'domain' =&gt; 'post_tag' ),
-                                array( 'name' =&gt; 'bieup', 'slug' =&gt; 'bieup', 'domain' =&gt; 'post_tax' )
-                        ), $result['posts'][0]['terms'], $message );
-                        $this-&gt;assertEquals( array(
-                                array( 'key' =&gt; '_wp_page_template', 'value' =&gt; 'default' )
-                        ), $result['posts'][1]['postmeta'], $message );        
-                }
-        }
-        
-        function test_wxr_version_1_0() {
-                $file = DIR_TESTDATA . '/export/valid-wxr-1.0.xml';
-                
-                foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
-                        $message = $p . ' failed';
-                        $parser = new $p;
-                        $result = $parser-&gt;parse( $file );
-                        
-                        $this-&gt;assertTrue( is_array( $result ), $message );                        
-                        $this-&gt;assertEquals( 'http://localhost/', $result['base_url'], $message );
-                        $this-&gt;assertEquals( $result['categories'][0]['category_nicename'], 'alpha', $message );
-                        $this-&gt;assertEquals( $result['categories'][0]['cat_name'], 'alpha', $message );
-                        $this-&gt;assertEquals( $result['categories'][0]['category_parent'], '', $message );
-                        $this-&gt;assertEquals( $result['categories'][0]['category_description'], 'The alpha category', $message );
-                        $this-&gt;assertEquals( $result['tags'][0]['tag_slug'], 'chicken', $message );
-                        $this-&gt;assertEquals( $result['tags'][0]['tag_name'], 'chicken', $message );        
-
-                        $this-&gt;assertEquals( 6, count($result['posts']), $message );
-                        $this-&gt;assertEquals( 19, count($result['posts'][0]), $message );
-                        $this-&gt;assertEquals( 18, count($result['posts'][1]), $message );
-
-                        $this-&gt;assertEquals( array(
-                                array( 'name' =&gt; 'Uncategorized', 'slug' =&gt; 'uncategorized', 'domain' =&gt; 'category' )
-                        ), $result['posts'][0]['terms'], $message );
-                        $this-&gt;assertEquals( array(
-                                array( 'name' =&gt; 'alpha', 'slug' =&gt; 'alpha', 'domain' =&gt; 'category' ),
-                                array( 'name' =&gt; 'news', 'slug' =&gt; 'news', 'domain' =&gt; 'tag' ),
-                                array( 'name' =&gt; 'roar', 'slug' =&gt; 'roar', 'domain' =&gt; 'tag' )
-                        ), $result['posts'][2]['terms'], $message );
-                        $this-&gt;assertEquals( array(
-                                array( 'name' =&gt; 'chicken', 'slug' =&gt; 'chicken', 'domain' =&gt; 'tag' ),
-                                array( 'name' =&gt; 'child', 'slug' =&gt; 'child', 'domain' =&gt; 'category' ),
-                                array( 'name' =&gt; 'face', 'slug' =&gt; 'face', 'domain' =&gt; 'tag' )
-                        ), $result['posts'][3]['terms'], $message );
-
-                        $this-&gt;assertEquals( array(
-                                array( 'key' =&gt; '_wp_page_template', 'value' =&gt; 'default' )
-                        ), $result['posts'][1]['postmeta'], $message );
-                }
-        }
-        
-        // tags in CDATA #11574
-}
-
-class WPImportTest extends _WPEmptyBlog {
-        function setUp() {
-                parent::setUp();
-
-                if ( ! defined( 'WP_IMPORTING' ) )
-                        define( 'WP_IMPORTING', true );
-                        
-                if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
-                        define( 'WP_LOAD_IMPORTERS', true );
-                        
-                require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
-
-                global $wpdb;
-                // crude but effective: make sure there's no residual data in the main tables
-                foreach ( array('posts', 'postmeta', 'comments', 'terms', 'term_taxonomy', 'term_relationships', 'users', 'usermeta') as $table)
-                        $wpdb-&gt;query(&quot;DELETE FROM {$wpdb-&gt;$table}&quot;);
-        }
-
-        function tearDown() {
-                parent::tearDown();
-
-                $this-&gt;_delete_all_posts();
-
-                if ( $user = get_user_by( 'login', 'admin' ) )
-                        wp_delete_user( $user-&gt;ID );
-                if ( $user = get_user_by( 'login', 'editor' ) )
-                        wp_delete_user( $user-&gt;ID );
-                if ( $user = get_user_by( 'login', 'author' ) )
-                        wp_delete_user( $user-&gt;ID );
-        }
-        
-        function test_small_import() {
-                global $wpdb;
-
-                $authors = array( 'admin' =&gt; false, 'editor' =&gt; false, 'author' =&gt; false );        
-                $this-&gt;_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
-
-                // ensure that authors were imported correctly
-                $user_count = count_users();
-                $this-&gt;assertEquals( 3, $user_count['total_users'] );
-                $admin = get_user_by( 'login', 'admin' );
-                $this-&gt;assertEquals( 'admin', $admin-&gt;user_login );
-                $this-&gt;assertEquals( 'local@host.null', $admin-&gt;user_email );
-                $editor = get_user_by( 'login', 'editor' );
-                $this-&gt;assertEquals( 'editor', $editor-&gt;user_login );
-                $this-&gt;assertEquals( 'editor@example.org', $editor-&gt;user_email );
-                $this-&gt;assertEquals( 'FirstName', $editor-&gt;user_firstname );
-                $this-&gt;assertEquals( 'LastName', $editor-&gt;user_lastname );
-                $author = get_user_by( 'login', 'author' );
-                $this-&gt;assertEquals( 'author', $author-&gt;user_login );
-                $this-&gt;assertEquals( 'author@example.org', $author-&gt;user_email );
-
-                // check that terms were imported correctly
-                $this-&gt;assertEquals( 30, wp_count_terms( 'category' ) );
-                $this-&gt;assertEquals( 3, wp_count_terms( 'post_tag' ) );
-                $foo = get_term_by( 'slug', 'foo', 'category' );
-                $this-&gt;assertEquals( 0, $foo-&gt;parent );
-                $bar = get_term_by( 'slug', 'bar', 'category' );
-                $foo_bar = get_term_by( 'slug', 'foo-bar', 'category' );
-                $this-&gt;assertEquals( $bar-&gt;term_id, $foo_bar-&gt;parent );
-
-                // check that posts/pages were imported correctly
-                $post_count = wp_count_posts( 'post' );
-                $this-&gt;assertEquals( 5, $post_count-&gt;publish );
-                $this-&gt;assertEquals( 1, $post_count-&gt;private );
-                $page_count = wp_count_posts( 'page' );
-                $this-&gt;assertEquals( 4, $page_count-&gt;publish );
-                $this-&gt;assertEquals( 1, $page_count-&gt;draft );
-                $comment_count = wp_count_comments();
-                $this-&gt;assertEquals( 1, $comment_count-&gt;total_comments );
-
-                $posts = get_posts( array( 'numberposts' =&gt; 20, 'post_type' =&gt; 'any', 'post_status' =&gt; 'any', 'orderby' =&gt; 'ID' ) );
-                $this-&gt;assertEquals( 11, count($posts) );
-
-                $post = $posts[0];
-                $this-&gt;assertEquals( 'Many Categories', $post-&gt;post_title );
-                $this-&gt;assertEquals( 'many-categories', $post-&gt;post_name );
-                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
-                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
-                $cats = wp_get_post_categories( $post-&gt;ID );
-                $this-&gt;assertEquals( 27, count($cats) );
-
-                $post = $posts[1];
-                $this-&gt;assertEquals( 'Non-standard post format', $post-&gt;post_title );
-                $this-&gt;assertEquals( 'non-standard-post-format', $post-&gt;post_name );
-                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
-                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
-                $cats = wp_get_post_categories( $post-&gt;ID );
-                $this-&gt;assertEquals( 1, count($cats) );
-                $this-&gt;assertTrue( has_post_format( 'aside', $post-&gt;ID ) );
-
-                $post = $posts[2];
-                $this-&gt;assertEquals( 'Top-level Foo', $post-&gt;post_title );
-                $this-&gt;assertEquals( 'top-level-foo', $post-&gt;post_name );
-                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
-                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
-                $cats = wp_get_post_categories( $post-&gt;ID, array( 'fields' =&gt; 'all' ) );
-                $this-&gt;assertEquals( 1, count($cats) );
-                $this-&gt;assertEquals( 'foo', $cats[0]-&gt;slug );
-
-                $post = $posts[3];
-                $this-&gt;assertEquals( 'Foo-child', $post-&gt;post_title );
-                $this-&gt;assertEquals( 'foo-child', $post-&gt;post_name );
-                $this-&gt;assertEquals( $editor-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
-                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
-                $cats = wp_get_post_categories( $post-&gt;ID, array( 'fields' =&gt; 'all' ) );
-                $this-&gt;assertEquals( 1, count($cats) );
-                $this-&gt;assertEquals( 'foo-bar', $cats[0]-&gt;slug );
-
-                $post = $posts[4];
-                $this-&gt;assertEquals( 'Private Post', $post-&gt;post_title );
-                $this-&gt;assertEquals( 'private-post', $post-&gt;post_name );
-                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'private', $post-&gt;post_status );
-                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
-                $cats = wp_get_post_categories( $post-&gt;ID );
-                $this-&gt;assertEquals( 1, count($cats) );
-                $tags = wp_get_post_tags( $post-&gt;ID );
-                $this-&gt;assertEquals( 3, count($tags) );
-                $this-&gt;assertEquals( 'tag1', $tags[0]-&gt;slug );
-                $this-&gt;assertEquals( 'tag2', $tags[1]-&gt;slug );
-                $this-&gt;assertEquals( 'tag3', $tags[2]-&gt;slug );
-
-                $post = $posts[5];
-                $this-&gt;assertEquals( '1-col page', $post-&gt;post_title );
-                $this-&gt;assertEquals( '1-col-page', $post-&gt;post_name );
-                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'page', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
-                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
-                $this-&gt;assertEquals( 'onecolumn-page.php', get_post_meta( $post-&gt;ID, '_wp_page_template', true ) );
-
-                $post = $posts[6];
-                $this-&gt;assertEquals( 'Draft Page', $post-&gt;post_title );
-                $this-&gt;assertEquals( '', $post-&gt;post_name );
-                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'page', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'draft', $post-&gt;post_status );
-                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
-                $this-&gt;assertEquals( 'default', get_post_meta( $post-&gt;ID, '_wp_page_template', true ) );
-
-                $post = $posts[7];
-                $this-&gt;assertEquals( 'Parent Page', $post-&gt;post_title );
-                $this-&gt;assertEquals( 'parent-page', $post-&gt;post_name );
-                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'page', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
-                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
-                $this-&gt;assertEquals( 'default', get_post_meta( $post-&gt;ID, '_wp_page_template', true ) );
-
-                $post = $posts[8];
-                $this-&gt;assertEquals( 'Child Page', $post-&gt;post_title );
-                $this-&gt;assertEquals( 'child-page', $post-&gt;post_name );
-                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'page', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
-                $this-&gt;assertEquals( $posts[7]-&gt;ID, $post-&gt;post_parent );
-                $this-&gt;assertEquals( 'default', get_post_meta( $post-&gt;ID, '_wp_page_template', true ) );
-
-                $post = $posts[9];
-                $this-&gt;assertEquals( 'Sample Page', $post-&gt;post_title );
-                $this-&gt;assertEquals( 'sample-page', $post-&gt;post_name );
-                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'page', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
-                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
-                $this-&gt;assertEquals( 'default', get_post_meta( $post-&gt;ID, '_wp_page_template', true ) );
-
-                $post = $posts[10];
-                $this-&gt;assertEquals( 'Hello world!', $post-&gt;post_title );
-                $this-&gt;assertEquals( 'hello-world', $post-&gt;post_name );
-                $this-&gt;assertEquals( $author-&gt;ID, $post-&gt;post_author );
-                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
-                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
-                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
-                $cats = wp_get_post_categories( $post-&gt;ID );
-                $this-&gt;assertEquals( 1, count($cats) );
-        }
-        
-        function test_double_import() {
-                $authors = array( 'admin' =&gt; false, 'editor' =&gt; false, 'author' =&gt; false );
-                $this-&gt;_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
-                $this-&gt;_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
-
-                $user_count = count_users();
-                $this-&gt;assertEquals( 3, $user_count['total_users'] );
-                $admin = get_user_by( 'login', 'admin' );
-                $this-&gt;assertEquals( 'admin', $admin-&gt;user_login );
-                $this-&gt;assertEquals( 'local@host.null', $admin-&gt;user_email );
-                $editor = get_user_by( 'login', 'editor' );
-                $this-&gt;assertEquals( 'editor', $editor-&gt;user_login );
-                $this-&gt;assertEquals( 'editor@example.org', $editor-&gt;user_email );
-                $this-&gt;assertEquals( 'FirstName', $editor-&gt;user_firstname );
-                $this-&gt;assertEquals( 'LastName', $editor-&gt;user_lastname );
-                $author = get_user_by( 'login', 'author' );
-                $this-&gt;assertEquals( 'author', $author-&gt;user_login );
-                $this-&gt;assertEquals( 'author@example.org', $author-&gt;user_email );
-
-                $this-&gt;assertEquals( 30, wp_count_terms( 'category' ) );
-                $this-&gt;assertEquals( 3, wp_count_terms( 'post_tag' ) );
-                $foo = get_term_by( 'slug', 'foo', 'category' );
-                $this-&gt;assertEquals( 0, $foo-&gt;parent );
-                $bar = get_term_by( 'slug', 'bar', 'category' );
-                $foo_bar = get_term_by( 'slug', 'foo-bar', 'category' );
-                $this-&gt;assertEquals( $bar-&gt;term_id, $foo_bar-&gt;parent );
-
-                $post_count = wp_count_posts( 'post' );
-                $this-&gt;assertEquals( 5, $post_count-&gt;publish );
-                $this-&gt;assertEquals( 1, $post_count-&gt;private );
-                $page_count = wp_count_posts( 'page' );
-                $this-&gt;assertEquals( 4, $page_count-&gt;publish );
-                $this-&gt;assertEquals( 1, $page_count-&gt;draft );
-                $comment_count = wp_count_comments();
-                $this-&gt;assertEquals( 1, $comment_count-&gt;total_comments );
-        }
-
-        // function test_menu_import
-}
-
-class TestImportWP_PostMeta extends _WPEmptyBlog {
-        function setUp() {
-                parent::setUp();
-                
-                if ( ! defined( 'WP_IMPORTING' ) )
-                        define( 'WP_IMPORTING', true );
-                        
-                if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
-                        define( 'WP_LOAD_IMPORTERS', true );
-                        
-                require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
-        }
-
-        function tearDown() {
-                parent::tearDown();
-        }
-        
-        function test_serialized_postmeta_no_cdata() {
-                $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-no-cdata.xml', array( 'johncoswell' =&gt; false ) );        
-                $expected['special_post_title'] = 'A special title';
-                $expected['is_calendar'] = '';        
-                $this-&gt;assertEquals( $expected, get_post_meta( 122, 'post-options', true ) );
-        }
-        
-        function test_utw_postmeta() {
-                $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-utw-post-meta-import.xml', array( 'johncoswell' =&gt; false ) );
-
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;album&quot;;
-                $expected[] = $classy;
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;apple&quot;;
-                $expected[] = $classy;
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;art&quot;;
-                $expected[] = $classy;
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;artwork&quot;;
-                $expected[] = $classy;        
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;dead-tracks&quot;;
-                $expected[] = $classy;        
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;ipod&quot;;
-                $expected[] = $classy;
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;itunes&quot;;
-                $expected[] = $classy;
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;javascript&quot;;
-                $expected[] = $classy;
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;lyrics&quot;;
-                $expected[] = $classy;        
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;script&quot;;
-                $expected[] = $classy;        
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;tracks&quot;;
-                $expected[] = $classy;        
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;windows-scripting-host&quot;;
-                $expected[] = $classy;        
-                $classy = new StdClass();
-                $classy-&gt;tag =  &quot;wscript&quot;;
-                $expected[] = $classy;        
-                
-                $this-&gt;assertEquals( $expected, get_post_meta( 150, 'test', true ) );
-        }
-}
-
-class TestImportWP_PostMetaCDATA extends _WPEmptyBlog {
-        function setUp() {
-                parent::setUp();
-
-                if ( ! defined( 'WP_IMPORTING' ) )
-                        define( 'WP_IMPORTING', true );
-
-                if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
-                        define( 'WP_LOAD_IMPORTERS', true );
-
-                require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
-        }
-
-        function tearDown() {
-                parent::tearDown();
-        }
-
-        // #9633
-        function test_serialized_postmeta_with_cdata() {
-                $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' =&gt; false ) );
-
-                //HTML in the CDATA should work with old WordPress version
-                $this-&gt;assertEquals( '&lt;pre&gt;some html&lt;/pre&gt;', get_post_meta( 10, 'contains-html', true ) );                
-                //Serialised will only work with 3.0 onwards.
-                $expected[&quot;special_post_title&quot;] = &quot;A special title&quot;;
-                $expected[&quot;is_calendar&quot;] = &quot;&quot;;
-                $this-&gt;assertEquals( $expected, get_post_meta( 10, 'post-options', true ) );                
-        }
-
-        // #11574
-        function test_serialized_postmeta_with_evil_stuff_in_cdata() {
-                $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' =&gt; false ) );
-                // evil content in the CDATA
-                $this-&gt;assertEquals( '&lt;wp:meta_value&gt;evil&lt;/wp:meta_value&gt;', get_post_meta( 10, 'evil', true ) );
-        }
-}
-
-?&gt;
</del><ins>+&lt;?php
+
+#include_once(DIR_TESTROOT.'/wp-testlib/wp-profiler.php');
+
+// need to include the importer as an external, so path may need to change...
+
+// _nuke_main_tables style function on tearDown? (Should this be part of _WPEmptyBlog tearDown?)
+       
+class WXRParserTest extends WPTestCase {
+        function setUp() {
+                parent::setUp();
+
+                if ( ! defined( 'WP_IMPORTING' ) )
+                        define( 'WP_IMPORTING', true );
+                        
+                if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
+                        define( 'WP_LOAD_IMPORTERS', true );                
+
+                require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
+        }
+
+        function tearDown() {
+                parent::tearDown();
+        }
+        
+        function test_malformed_wxr() {
+                $file = DIR_TESTDATA . '/export/malformed.xml';
+        
+                // regex based parser cannot detect malformed XML
+                foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML' ) as $p ) {
+                        $parser = new $p;
+                        $result = $parser-&gt;parse($file);
+                        $this-&gt;assertTrue( is_wp_error( $result ) );
+                        $this-&gt;assertEquals( 'There was an error when reading this WXR file', $result-&gt;get_error_message() );        
+                }        
+        }        
+
+        function test_invalid_wxr() {
+                $f1 = DIR_TESTDATA . '/export/missing-version-tag.xml';
+                $f2 = DIR_TESTDATA . '/export/invalid-version-tag.xml';
+        
+                foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
+                        foreach ( array( $f1, $f2 ) as $file ) {
+                                $parser = new $p;
+                                $result = $parser-&gt;parse( $file );                                
+                                $this-&gt;assertTrue( is_wp_error( $result ) );
+                                $this-&gt;assertEquals( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result-&gt;get_error_message() );        
+                        }
+                }                        
+        }
+        
+        function test_wxr_version_1_1() {
+                $file = DIR_TESTDATA . '/export/valid-wxr-1.1.xml';
+                         
+                foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
+                        $message = $p . ' failed';
+                        $parser = new $p;
+                        $result = $parser-&gt;parse( $file );        
+                        
+                        $this-&gt;assertTrue( is_array( $result ), $message );                        
+                        $this-&gt;assertEquals( 'http://localhost/', $result['base_url'], $message );
+                        $this-&gt;assertEquals( array(  
+                                'author_id' =&gt; 2,
+                                'author_login' =&gt; 'john',
+                                'author_email' =&gt; 'johndoe@example.org',
+                                'author_display_name' =&gt; 'John Doe',
+                                'author_first_name' =&gt; 'John',
+                                'author_last_name' =&gt; 'Doe'
+                        ), $result['authors']['john'], $message );
+                        $this-&gt;assertEquals( array(
+                                'term_id' =&gt; 3,
+                                'category_nicename' =&gt; 'alpha',
+                                'category_parent' =&gt; '',
+                                'cat_name' =&gt; 'alpha',
+                                'category_description' =&gt; 'The alpha category'                        
+                        ), $result['categories'][0], $message );
+                        $this-&gt;assertEquals( array(
+                                'term_id' =&gt; 22,
+                                'tag_slug' =&gt; 'clippable',
+                                'tag_name' =&gt; 'Clippable',
+                                'tag_description' =&gt; 'The Clippable post_tag'                
+                        ), $result['tags'][0], $message );
+                        $this-&gt;assertEquals( array(
+                                'term_id' =&gt; 40,
+                                'term_taxonomy' =&gt; 'post_tax',
+                                'slug' =&gt; 'bieup',
+                                'term_parent' =&gt; '',                                
+                                'term_name' =&gt; 'bieup',
+                                'term_description' =&gt; 'The bieup post_tax'                
+                        ), $result['terms'][0], $message );                                        
+
+                        $this-&gt;assertEquals( 2, count($result['posts']), $message );
+                        $this-&gt;assertEquals( 19, count($result['posts'][0]), $message );
+                        $this-&gt;assertEquals( 18, count($result['posts'][1]), $message );
+                        $this-&gt;assertEquals( array(
+                                array( 'name' =&gt; 'alpha', 'slug' =&gt; 'alpha', 'domain' =&gt; 'category' ),
+                                array( 'name' =&gt; 'Clippable', 'slug' =&gt; 'clippable', 'domain' =&gt; 'post_tag' ),
+                                array( 'name' =&gt; 'bieup', 'slug' =&gt; 'bieup', 'domain' =&gt; 'post_tax' )
+                        ), $result['posts'][0]['terms'], $message );
+                        $this-&gt;assertEquals( array(
+                                array( 'key' =&gt; '_wp_page_template', 'value' =&gt; 'default' )
+                        ), $result['posts'][1]['postmeta'], $message );        
+                }
+        }
+        
+        function test_wxr_version_1_0() {
+                $file = DIR_TESTDATA . '/export/valid-wxr-1.0.xml';
+                
+                foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
+                        $message = $p . ' failed';
+                        $parser = new $p;
+                        $result = $parser-&gt;parse( $file );
+                        
+                        $this-&gt;assertTrue( is_array( $result ), $message );                        
+                        $this-&gt;assertEquals( 'http://localhost/', $result['base_url'], $message );
+                        $this-&gt;assertEquals( $result['categories'][0]['category_nicename'], 'alpha', $message );
+                        $this-&gt;assertEquals( $result['categories'][0]['cat_name'], 'alpha', $message );
+                        $this-&gt;assertEquals( $result['categories'][0]['category_parent'], '', $message );
+                        $this-&gt;assertEquals( $result['categories'][0]['category_description'], 'The alpha category', $message );
+                        $this-&gt;assertEquals( $result['tags'][0]['tag_slug'], 'chicken', $message );
+                        $this-&gt;assertEquals( $result['tags'][0]['tag_name'], 'chicken', $message );        
+
+                        $this-&gt;assertEquals( 6, count($result['posts']), $message );
+                        $this-&gt;assertEquals( 19, count($result['posts'][0]), $message );
+                        $this-&gt;assertEquals( 18, count($result['posts'][1]), $message );
+
+                        $this-&gt;assertEquals( array(
+                                array( 'name' =&gt; 'Uncategorized', 'slug' =&gt; 'uncategorized', 'domain' =&gt; 'category' )
+                        ), $result['posts'][0]['terms'], $message );
+                        $this-&gt;assertEquals( array(
+                                array( 'name' =&gt; 'alpha', 'slug' =&gt; 'alpha', 'domain' =&gt; 'category' ),
+                                array( 'name' =&gt; 'news', 'slug' =&gt; 'news', 'domain' =&gt; 'tag' ),
+                                array( 'name' =&gt; 'roar', 'slug' =&gt; 'roar', 'domain' =&gt; 'tag' )
+                        ), $result['posts'][2]['terms'], $message );
+                        $this-&gt;assertEquals( array(
+                                array( 'name' =&gt; 'chicken', 'slug' =&gt; 'chicken', 'domain' =&gt; 'tag' ),
+                                array( 'name' =&gt; 'child', 'slug' =&gt; 'child', 'domain' =&gt; 'category' ),
+                                array( 'name' =&gt; 'face', 'slug' =&gt; 'face', 'domain' =&gt; 'tag' )
+                        ), $result['posts'][3]['terms'], $message );
+
+                        $this-&gt;assertEquals( array(
+                                array( 'key' =&gt; '_wp_page_template', 'value' =&gt; 'default' )
+                        ), $result['posts'][1]['postmeta'], $message );
+                }
+        }
+        
+        // tags in CDATA #11574
+}
+
+class WPImportTest extends _WPEmptyBlog {
+        function setUp() {
+                parent::setUp();
+
+                if ( ! defined( 'WP_IMPORTING' ) )
+                        define( 'WP_IMPORTING', true );
+                        
+                if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
+                        define( 'WP_LOAD_IMPORTERS', true );
+                        
+                require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
+
+                global $wpdb;
+                // crude but effective: make sure there's no residual data in the main tables
+                foreach ( array('posts', 'postmeta', 'comments', 'terms', 'term_taxonomy', 'term_relationships', 'users', 'usermeta') as $table)
+                        $wpdb-&gt;query(&quot;DELETE FROM {$wpdb-&gt;$table}&quot;);
+        }
+
+        function tearDown() {
+                parent::tearDown();
+
+                $this-&gt;_delete_all_posts();
+
+                if ( $user = get_user_by( 'login', 'admin' ) )
+                        wp_delete_user( $user-&gt;ID );
+                if ( $user = get_user_by( 'login', 'editor' ) )
+                        wp_delete_user( $user-&gt;ID );
+                if ( $user = get_user_by( 'login', 'author' ) )
+                        wp_delete_user( $user-&gt;ID );
+        }
+        
+        function test_small_import() {
+                global $wpdb;
+
+                $authors = array( 'admin' =&gt; false, 'editor' =&gt; false, 'author' =&gt; false );        
+                $this-&gt;_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
+
+                // ensure that authors were imported correctly
+                $user_count = count_users();
+                $this-&gt;assertEquals( 3, $user_count['total_users'] );
+                $admin = get_user_by( 'login', 'admin' );
+                $this-&gt;assertEquals( 'admin', $admin-&gt;user_login );
+                $this-&gt;assertEquals( 'local@host.null', $admin-&gt;user_email );
+                $editor = get_user_by( 'login', 'editor' );
+                $this-&gt;assertEquals( 'editor', $editor-&gt;user_login );
+                $this-&gt;assertEquals( 'editor@example.org', $editor-&gt;user_email );
+                $this-&gt;assertEquals( 'FirstName', $editor-&gt;user_firstname );
+                $this-&gt;assertEquals( 'LastName', $editor-&gt;user_lastname );
+                $author = get_user_by( 'login', 'author' );
+                $this-&gt;assertEquals( 'author', $author-&gt;user_login );
+                $this-&gt;assertEquals( 'author@example.org', $author-&gt;user_email );
+
+                // check that terms were imported correctly
+                $this-&gt;assertEquals( 30, wp_count_terms( 'category' ) );
+                $this-&gt;assertEquals( 3, wp_count_terms( 'post_tag' ) );
+                $foo = get_term_by( 'slug', 'foo', 'category' );
+                $this-&gt;assertEquals( 0, $foo-&gt;parent );
+                $bar = get_term_by( 'slug', 'bar', 'category' );
+                $foo_bar = get_term_by( 'slug', 'foo-bar', 'category' );
+                $this-&gt;assertEquals( $bar-&gt;term_id, $foo_bar-&gt;parent );
+
+                // check that posts/pages were imported correctly
+                $post_count = wp_count_posts( 'post' );
+                $this-&gt;assertEquals( 5, $post_count-&gt;publish );
+                $this-&gt;assertEquals( 1, $post_count-&gt;private );
+                $page_count = wp_count_posts( 'page' );
+                $this-&gt;assertEquals( 4, $page_count-&gt;publish );
+                $this-&gt;assertEquals( 1, $page_count-&gt;draft );
+                $comment_count = wp_count_comments();
+                $this-&gt;assertEquals( 1, $comment_count-&gt;total_comments );
+
+                $posts = get_posts( array( 'numberposts' =&gt; 20, 'post_type' =&gt; 'any', 'post_status' =&gt; 'any', 'orderby' =&gt; 'ID' ) );
+                $this-&gt;assertEquals( 11, count($posts) );
+
+                $post = $posts[0];
+                $this-&gt;assertEquals( 'Many Categories', $post-&gt;post_title );
+                $this-&gt;assertEquals( 'many-categories', $post-&gt;post_name );
+                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
+                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
+                $cats = wp_get_post_categories( $post-&gt;ID );
+                $this-&gt;assertEquals( 27, count($cats) );
+
+                $post = $posts[1];
+                $this-&gt;assertEquals( 'Non-standard post format', $post-&gt;post_title );
+                $this-&gt;assertEquals( 'non-standard-post-format', $post-&gt;post_name );
+                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
+                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
+                $cats = wp_get_post_categories( $post-&gt;ID );
+                $this-&gt;assertEquals( 1, count($cats) );
+                $this-&gt;assertTrue( has_post_format( 'aside', $post-&gt;ID ) );
+
+                $post = $posts[2];
+                $this-&gt;assertEquals( 'Top-level Foo', $post-&gt;post_title );
+                $this-&gt;assertEquals( 'top-level-foo', $post-&gt;post_name );
+                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
+                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
+                $cats = wp_get_post_categories( $post-&gt;ID, array( 'fields' =&gt; 'all' ) );
+                $this-&gt;assertEquals( 1, count($cats) );
+                $this-&gt;assertEquals( 'foo', $cats[0]-&gt;slug );
+
+                $post = $posts[3];
+                $this-&gt;assertEquals( 'Foo-child', $post-&gt;post_title );
+                $this-&gt;assertEquals( 'foo-child', $post-&gt;post_name );
+                $this-&gt;assertEquals( $editor-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
+                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
+                $cats = wp_get_post_categories( $post-&gt;ID, array( 'fields' =&gt; 'all' ) );
+                $this-&gt;assertEquals( 1, count($cats) );
+                $this-&gt;assertEquals( 'foo-bar', $cats[0]-&gt;slug );
+
+                $post = $posts[4];
+                $this-&gt;assertEquals( 'Private Post', $post-&gt;post_title );
+                $this-&gt;assertEquals( 'private-post', $post-&gt;post_name );
+                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'private', $post-&gt;post_status );
+                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
+                $cats = wp_get_post_categories( $post-&gt;ID );
+                $this-&gt;assertEquals( 1, count($cats) );
+                $tags = wp_get_post_tags( $post-&gt;ID );
+                $this-&gt;assertEquals( 3, count($tags) );
+                $this-&gt;assertEquals( 'tag1', $tags[0]-&gt;slug );
+                $this-&gt;assertEquals( 'tag2', $tags[1]-&gt;slug );
+                $this-&gt;assertEquals( 'tag3', $tags[2]-&gt;slug );
+
+                $post = $posts[5];
+                $this-&gt;assertEquals( '1-col page', $post-&gt;post_title );
+                $this-&gt;assertEquals( '1-col-page', $post-&gt;post_name );
+                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'page', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
+                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
+                $this-&gt;assertEquals( 'onecolumn-page.php', get_post_meta( $post-&gt;ID, '_wp_page_template', true ) );
+
+                $post = $posts[6];
+                $this-&gt;assertEquals( 'Draft Page', $post-&gt;post_title );
+                $this-&gt;assertEquals( '', $post-&gt;post_name );
+                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'page', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'draft', $post-&gt;post_status );
+                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
+                $this-&gt;assertEquals( 'default', get_post_meta( $post-&gt;ID, '_wp_page_template', true ) );
+
+                $post = $posts[7];
+                $this-&gt;assertEquals( 'Parent Page', $post-&gt;post_title );
+                $this-&gt;assertEquals( 'parent-page', $post-&gt;post_name );
+                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'page', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
+                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
+                $this-&gt;assertEquals( 'default', get_post_meta( $post-&gt;ID, '_wp_page_template', true ) );
+
+                $post = $posts[8];
+                $this-&gt;assertEquals( 'Child Page', $post-&gt;post_title );
+                $this-&gt;assertEquals( 'child-page', $post-&gt;post_name );
+                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'page', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
+                $this-&gt;assertEquals( $posts[7]-&gt;ID, $post-&gt;post_parent );
+                $this-&gt;assertEquals( 'default', get_post_meta( $post-&gt;ID, '_wp_page_template', true ) );
+
+                $post = $posts[9];
+                $this-&gt;assertEquals( 'Sample Page', $post-&gt;post_title );
+                $this-&gt;assertEquals( 'sample-page', $post-&gt;post_name );
+                $this-&gt;assertEquals( $admin-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'page', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
+                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
+                $this-&gt;assertEquals( 'default', get_post_meta( $post-&gt;ID, '_wp_page_template', true ) );
+
+                $post = $posts[10];
+                $this-&gt;assertEquals( 'Hello world!', $post-&gt;post_title );
+                $this-&gt;assertEquals( 'hello-world', $post-&gt;post_name );
+                $this-&gt;assertEquals( $author-&gt;ID, $post-&gt;post_author );
+                $this-&gt;assertEquals( 'post', $post-&gt;post_type );
+                $this-&gt;assertEquals( 'publish', $post-&gt;post_status );
+                $this-&gt;assertEquals( 0, $post-&gt;post_parent );
+                $cats = wp_get_post_categories( $post-&gt;ID );
+                $this-&gt;assertEquals( 1, count($cats) );
+        }
+        
+        function test_double_import() {
+                $authors = array( 'admin' =&gt; false, 'editor' =&gt; false, 'author' =&gt; false );
+                $this-&gt;_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
+                $this-&gt;_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
+
+                $user_count = count_users();
+                $this-&gt;assertEquals( 3, $user_count['total_users'] );
+                $admin = get_user_by( 'login', 'admin' );
+                $this-&gt;assertEquals( 'admin', $admin-&gt;user_login );
+                $this-&gt;assertEquals( 'local@host.null', $admin-&gt;user_email );
+                $editor = get_user_by( 'login', 'editor' );
+                $this-&gt;assertEquals( 'editor', $editor-&gt;user_login );
+                $this-&gt;assertEquals( 'editor@example.org', $editor-&gt;user_email );
+                $this-&gt;assertEquals( 'FirstName', $editor-&gt;user_firstname );
+                $this-&gt;assertEquals( 'LastName', $editor-&gt;user_lastname );
+                $author = get_user_by( 'login', 'author' );
+                $this-&gt;assertEquals( 'author', $author-&gt;user_login );
+                $this-&gt;assertEquals( 'author@example.org', $author-&gt;user_email );
+
+                $this-&gt;assertEquals( 30, wp_count_terms( 'category' ) );
+                $this-&gt;assertEquals( 3, wp_count_terms( 'post_tag' ) );
+                $foo = get_term_by( 'slug', 'foo', 'category' );
+                $this-&gt;assertEquals( 0, $foo-&gt;parent );
+                $bar = get_term_by( 'slug', 'bar', 'category' );
+                $foo_bar = get_term_by( 'slug', 'foo-bar', 'category' );
+                $this-&gt;assertEquals( $bar-&gt;term_id, $foo_bar-&gt;parent );
+
+                $post_count = wp_count_posts( 'post' );
+                $this-&gt;assertEquals( 5, $post_count-&gt;publish );
+                $this-&gt;assertEquals( 1, $post_count-&gt;private );
+                $page_count = wp_count_posts( 'page' );
+                $this-&gt;assertEquals( 4, $page_count-&gt;publish );
+                $this-&gt;assertEquals( 1, $page_count-&gt;draft );
+                $comment_count = wp_count_comments();
+                $this-&gt;assertEquals( 1, $comment_count-&gt;total_comments );
+        }
+
+        // function test_menu_import
+}
+
+class TestImportWP_PostMeta extends _WPEmptyBlog {
+        function setUp() {
+                parent::setUp();
+                
+                if ( ! defined( 'WP_IMPORTING' ) )
+                        define( 'WP_IMPORTING', true );
+                        
+                if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
+                        define( 'WP_LOAD_IMPORTERS', true );
+                        
+                require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
+        }
+
+        function tearDown() {
+                parent::tearDown();
+        }
+        
+        function test_serialized_postmeta_no_cdata() {
+                $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-no-cdata.xml', array( 'johncoswell' =&gt; false ) );        
+                $expected['special_post_title'] = 'A special title';
+                $expected['is_calendar'] = '';        
+                $this-&gt;assertEquals( $expected, get_post_meta( 122, 'post-options', true ) );
+        }
+        
+        function test_utw_postmeta() {
+                $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-utw-post-meta-import.xml', array( 'johncoswell' =&gt; false ) );
+
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;album&quot;;
+                $expected[] = $classy;
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;apple&quot;;
+                $expected[] = $classy;
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;art&quot;;
+                $expected[] = $classy;
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;artwork&quot;;
+                $expected[] = $classy;        
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;dead-tracks&quot;;
+                $expected[] = $classy;        
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;ipod&quot;;
+                $expected[] = $classy;
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;itunes&quot;;
+                $expected[] = $classy;
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;javascript&quot;;
+                $expected[] = $classy;
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;lyrics&quot;;
+                $expected[] = $classy;        
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;script&quot;;
+                $expected[] = $classy;        
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;tracks&quot;;
+                $expected[] = $classy;        
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;windows-scripting-host&quot;;
+                $expected[] = $classy;        
+                $classy = new StdClass();
+                $classy-&gt;tag =  &quot;wscript&quot;;
+                $expected[] = $classy;        
+                
+                $this-&gt;assertEquals( $expected, get_post_meta( 150, 'test', true ) );
+        }
+}
+
+class TestImportWP_PostMetaCDATA extends _WPEmptyBlog {
+        function setUp() {
+                parent::setUp();
+
+                if ( ! defined( 'WP_IMPORTING' ) )
+                        define( 'WP_IMPORTING', true );
+
+                if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
+                        define( 'WP_LOAD_IMPORTERS', true );
+
+                require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
+        }
+
+        function tearDown() {
+                parent::tearDown();
+        }
+
+        // #9633
+        function test_serialized_postmeta_with_cdata() {
+                $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' =&gt; false ) );
+
+                //HTML in the CDATA should work with old WordPress version
+                $this-&gt;assertEquals( '&lt;pre&gt;some html&lt;/pre&gt;', get_post_meta( 10, 'contains-html', true ) );                
+                //Serialised will only work with 3.0 onwards.
+                $expected[&quot;special_post_title&quot;] = &quot;A special title&quot;;
+                $expected[&quot;is_calendar&quot;] = &quot;&quot;;
+                $this-&gt;assertEquals( $expected, get_post_meta( 10, 'post-options', true ) );                
+        }
+
+        // #11574
+        function test_serialized_postmeta_with_evil_stuff_in_cdata() {
+                $this-&gt;_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' =&gt; false ) );
+                // evil content in the CDATA
+                $this-&gt;assertEquals( '&lt;wp:meta_value&gt;evil&lt;/wp:meta_value&gt;', get_post_meta( 10, 'evil', true ) );
+        }
+}
+
+?&gt;
</ins><span class="cx">Property changes on: wp-testcase/test_import_wp.php
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_cachephp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_cache.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_classwpdependenciesphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_class-wp-dependencies.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_compatphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_compat.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_feed_rss2php"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_feed_rss2.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_filephp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_file.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_formattingphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_formatting.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_functionsphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_functions.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_pluggablephp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_pluggable.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_postphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_post.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_taxonomyphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_taxonomy.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_themephp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_theme.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_wpscriptsphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_wp-scripts.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_includes_wpstylesphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_includes_wp-styles.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_link_functionsphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_link_functions.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_metaphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_meta.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_post_filteringphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_post_filtering.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_post_outputphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_post_output.php (365 => 366)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_post_output.php        2011-06-03 05:17:22 UTC (rev 365)
+++ wp-testcase/test_post_output.php        2011-06-05 07:25:21 UTC (rev 366)
</span><span class="lines">@@ -1,329 +1,329 @@
</span><del>-&lt;?php
-
-// test the output of post template tags etc
-
-class _WPTestSinglePost extends _WPEmptyBlog {
-
-        var $post_title = NULL;
-        var $post_content = NULL;
-
-        var $the_title = NULL;
-        var $the_content = NULL;
-
-        function _do_post() {
-                $post = array(
-                        'post_author' =&gt; $this-&gt;author-&gt;ID,
-                        'post_status' =&gt; 'publish',
-                        'post_content' =&gt; $this-&gt;post_content,
-                        'post_title' =&gt; $this-&gt;post_title,
-                );
-
-                // insert a post
-                $this-&gt;post_id = $this-&gt;post_ids[] = wp_insert_post($post);
-
-                // pretend we're on the single permlink page for that post
-                $out = wp_get_single_post($this-&gt;post_id);
-                $this-&gt;http(get_permalink($this-&gt;post_id));
-
-                $this-&gt;assertTrue(is_single());
-                $this-&gt;assertTrue(have_posts());
-                $this-&gt;assertNull(the_post());
-        }
-
-
-}
-
-class WPTestPostMoreVB extends _WPTestSinglePost {
-
-        function setUp() {
-
-                $this-&gt;post_content =&lt;&lt;&lt;EOF
-&lt;i&gt;This is the excerpt.&lt;/i&gt;
-&lt;!--more--&gt;
-This is the &lt;b&gt;body&lt;/b&gt;.
-EOF;
-
-                parent::setUp();
-        }
-
-        function test_the_content() {
-                $this-&gt;_do_post();
-                $the_content =&lt;&lt;&lt;EOF
-&lt;p&gt;&lt;i&gt;This is the excerpt.&lt;/i&gt;&lt;br /&gt;
-&lt;span id=&quot;more-{$this-&gt;post_id}&quot;&gt;&lt;/span&gt;&lt;br /&gt;
-This is the &lt;b&gt;body&lt;/b&gt;.&lt;/p&gt;
-EOF;
-
-                $this-&gt;assertEquals(strip_ws($the_content), strip_ws(get_echo('the_content')));
-        }
-
-}
-
-class WPTestShortcodeOutput1 extends _WPTestSinglePost {
-        function setUp() {
-
-                $this-&gt;post_content =&lt;&lt;&lt;EOF
-[dumptag foo=&quot;bar&quot; baz=&quot;123&quot;]
-
-[dumptag foo=123 baz=bar]
-
-[dumptag http://example.com]
-
-EOF;
-
-                parent::setUp();
-        }
-
-        function test_the_content() {
-                $this-&gt;_do_post();
-                $expected =&lt;&lt;&lt;EOF
-foo = bar
-baz = 123
-foo = 123
-baz = bar
-0 = http://example.com
-
-EOF;
-
-                $this-&gt;assertEquals(strip_ws($expected), strip_ws(get_echo('the_content')));
-        }
-}
-
-class WPTestShortcodeOutputParagraph extends _WPTestSinglePost {
-        function setUp() {
-
-                $this-&gt;post_content =&lt;&lt;&lt;EOF
-Graf by itself:
-
-[paragraph]my graf[/paragraph]
-
-  [paragraph foo=&quot;bar&quot;]another graf with whitespace[/paragraph]  
-
-An [paragraph]inline graf[/paragraph], this doesn't make much sense.
-
-A graf with a single EOL first:
-[paragraph]blah[/paragraph]
-
-EOF;
-
-                parent::setUp();
-        }
-
-        function test_the_content() {
-                $this-&gt;_do_post();
-                $expected =&lt;&lt;&lt;EOF
-&lt;p&gt;Graf by itself:&lt;/p&gt;
-&lt;p class='graf'&gt;my graf&lt;/p&gt;
-
-  &lt;p class='graf'&gt;another graf with whitespace&lt;/p&gt;
-
-&lt;p&gt;An &lt;p class='graf'&gt;inline graf&lt;/p&gt;
-, this doesn&amp;#8217;t make much sense.&lt;/p&gt;
-&lt;p&gt;A graf with a single EOL first:&lt;br /&gt;
-&lt;p class='graf'&gt;blah&lt;/p&gt;
-&lt;/p&gt;
-
-EOF;
-
-                $this-&gt;assertEquals(strip_ws($expected), strip_ws(get_echo('the_content')));
-        }
-}
-
-class WPTestGalleryPost extends _WPDataset1 {
-        function setUp() {
-                parent::setUp();
-                global $wp_rewrite;
-                $wp_rewrite-&gt;set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
-                $wp_rewrite-&gt;flush_rules();
-        }
-        
-        function test_the_content() {
-                // permalink page
-                $this-&gt;http('/2008/04/01/simple-gallery-test/');
-                the_post();
-                // filtered output
-                $out = get_echo('the_content');
-                
-                $expected = &lt;&lt;&lt;EOF
-&lt;p&gt;There are ten images attached to this post. Â Here&amp;#8217;s a gallery:&lt;/p&gt;
-
-                &lt;style type='text/css'&gt;
-                        .gallery {
-                                margin: auto;
-                        }
-                        .gallery-item {
-                                float: left;
-                                margin-top: 10px;
-                                text-align: center;
-                                width: 33%;                        }
-                        .gallery img {
-                                border: 2px solid #cfcfcf;
-                        }
-                        .gallery-caption {
-                                margin-left: 0;
-                        }
-                &lt;/style&gt;
-                &lt;!-- see gallery_shortcode() in wp-includes/media.php --&gt;
-                &lt;div class='gallery'&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20040724_152504_53/' title='dsc20040724_152504_53'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20040724_152504_537.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/canola/' title='canola'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/canola3.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050315_145007_13/' title='dsc20050315_145007_13'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050315_145007_134.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050604_133440_34/' title='dsc20050604_133440_34'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050604_133440_343.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050831_165238_33/' title='dsc20050831_165238_33'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050831_165238_333.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050901_105100_21/' title='dsc20050901_105100_21'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050901_105100_213.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050813_115856_5/' title='dsc20050813_115856_5'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050813_115856_54.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050720_123726_27/' title='dsc20050720_123726_27'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050720_123726_274.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050727_091048_22/' title='Title: Seedlings'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050727_091048_224.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050726_083116_18/' title='dsc20050726_083116_18'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050726_083116_184.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;
-                        &lt;br style='clear: both;' /&gt;
-                &lt;/div&gt;
-
-&lt;p&gt;It&amp;#8217;s the simplest form of the gallery tag. Â All images are from the public domain site burningwell.org.&lt;/p&gt;
-&lt;p&gt;The images have various combinations of titles, captions and descriptions.&lt;/p&gt;
-EOF;
-                $this-&gt;assertEquals(strip_ws($expected), strip_ws($out));
-        }
-
-        function test_gallery_attributes() {
-                // make sure the gallery shortcode attributes are parsed correctly
-                
-                $id = 575;
-                $post = get_post($id);
-                $post-&gt;post_content = '[gallery columns=&quot;1&quot; size=&quot;medium&quot;]';
-                wp_update_post($post);
-                
-                // permalink page
-                $this-&gt;http('/2008/04/01/simple-gallery-test/');
-                the_post();
-                // filtered output
-                $out = get_echo('the_content');
-
-                $expected = &lt;&lt;&lt;EOF
-                &lt;style type='text/css'&gt;
-                        .gallery {
-                                margin: auto;
-                        }
-                        .gallery-item {
-                                float: left;
-                                margin-top: 10px;
-                                text-align: center;
-                                width: 100%;                        }
-                        .gallery img {
-                                border: 2px solid #cfcfcf;
-                        }
-                        .gallery-caption {
-                                margin-left: 0;
-                        }
-                &lt;/style&gt;
-                &lt;!-- see gallery_shortcode() in wp-includes/media.php --&gt;
-                &lt;div class='gallery'&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/?attachment_id=565' title='dsc20040724_152504_53'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20040724_152504_537.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/?attachment_id=566' title='canola'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/canola3.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/?attachment_id=567' title='dsc20050315_145007_13'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050315_145007_134.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/?attachment_id=568' title='dsc20050604_133440_34'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050604_133440_343.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/?attachment_id=569' title='dsc20050831_165238_33'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050831_165238_333.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/?attachment_id=570' title='dsc20050901_105100_21'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050901_105100_213.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/?attachment_id=571' title='dsc20050813_115856_5'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050813_115856_54.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/?attachment_id=572' title='dsc20050720_123726_27'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050720_123726_274.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/?attachment_id=573' title='Title: Seedlings'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050727_091048_224.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
-                        &lt;dt class='gallery-icon'&gt;
-                                &lt;a href='http://example.com/?attachment_id=574' title='dsc20050726_083116_18'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050726_083116_184.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
-                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;
-                        &lt;br style='clear: both;' /&gt;
-                &lt;/div&gt;
-
-EOF;
-                $this-&gt;assertEquals(strip_ws($expected), strip_ws($out));
-        }
-
-}
-
-
-
-class WPTestAttributeFiltering extends _WPTestSinglePost {
-        function setUp() {
-
-                // http://bpr3.org/?p=87
-                // the title attribute should make it through unfiltered
-                $this-&gt;post_content =&lt;&lt;&lt;EOF
-&lt;span class=&quot;Z3988&quot; title=&quot;ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.aulast=Mariat&amp;rft.aufirst=Denis&amp;rft. au=Denis+Mariat&amp;rft.au=Sead+Taourit&amp;rft.au=G%C3%A9rard+Gu%C3%A9rin&amp; rft.title=Genetics+Selection+Evolution&amp;rft.atitle=&amp;rft.date=2003&amp;rft. volume=35&amp;rft.issue=1&amp;rft.spage=119&amp;rft.epage=133&amp;rft.genre=article&amp; rft.id=info:DOI/10.1051%2Fgse%3A2002039&quot;&gt;&lt;/span&gt;Mariat, D., Taourit, S., Guérin, G. (2003). . &lt;span style=&quot;font-style: italic;&quot;&gt;Genetics Selection Evolution, 35&lt;/span&gt;(1), 119-133. DOI: &lt;a rev=&quot;review&quot; href= &quot;http://dx.doi.org/10.1051/gse:2002039&quot;&gt;10.1051/gse:2002039&lt;/a&gt;
-
-EOF;
-
-                parent::setUp();
-        }
-
-        function test_the_content() {
-                $this-&gt;_do_post();
-                $expected =&lt;&lt;&lt;EOF
-&lt;p&gt;&lt;span class=&quot;Z3988&quot; title=&quot;ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.aulast=Mariat&amp;rft.aufirst=Denis&amp;rft. au=Denis+Mariat&amp;rft.au=Sead+Taourit&amp;rft.au=G%C3%A9rard+Gu%C3%A9rin&amp; rft.title=Genetics+Selection+Evolution&amp;rft.atitle=&amp;rft.date=2003&amp;rft. volume=35&amp;rft.issue=1&amp;rft.spage=119&amp;rft.epage=133&amp;rft.genre=article&amp; rft.id=info:DOI/10.1051%2Fgse%3A2002039&quot;&gt;&lt;/span&gt;Mariat, D., Taourit, S., Guérin, G. (2003). . &lt;span style=&quot;font-style: italic;&quot;&gt;Genetics Selection Evolution, 35&lt;/span&gt;(1), 119-133. DOI: &lt;a rev=&quot;review&quot; href= &quot;http://dx.doi.org/10.1051/gse:2002039&quot;&gt;10.1051/gse:2002039&lt;/a&gt;&lt;/p&gt;
-
-EOF;
-
-                $this-&gt;assertEquals(strip_ws($expected), strip_ws(get_echo('the_content')));
-        }
-}
-
-class WPTestAttributeColon extends _WPTestSinglePost {
-        function setUp() {
-
-                // http://bpr3.org/?p=87
-                // the title attribute should make it through unfiltered
-                $this-&gt;post_content =&lt;&lt;&lt;EOF
-&lt;span title=&quot;My friends: Alice, Bob and Carol&quot;&gt;foo&lt;/span&gt;
-
-EOF;
-
-                parent::setUp();
-        }
-
-        function test_the_content() {
-                $this-&gt;_do_post();
-                $expected =&lt;&lt;&lt;EOF
-&lt;p&gt;&lt;span title=&quot;My friends: Alice, Bob and Carol&quot;&gt;foo&lt;/span&gt;&lt;/p&gt;
-
-EOF;
-
-                $this-&gt;assertEquals(strip_ws($expected), strip_ws(get_echo('the_content')));
-        }
-}
-
</del><ins>+&lt;?php
+
+// test the output of post template tags etc
+
+class _WPTestSinglePost extends _WPEmptyBlog {
+
+        var $post_title = NULL;
+        var $post_content = NULL;
+
+        var $the_title = NULL;
+        var $the_content = NULL;
+
+        function _do_post() {
+                $post = array(
+                        'post_author' =&gt; $this-&gt;author-&gt;ID,
+                        'post_status' =&gt; 'publish',
+                        'post_content' =&gt; $this-&gt;post_content,
+                        'post_title' =&gt; $this-&gt;post_title,
+                );
+
+                // insert a post
+                $this-&gt;post_id = $this-&gt;post_ids[] = wp_insert_post($post);
+
+                // pretend we're on the single permlink page for that post
+                $out = wp_get_single_post($this-&gt;post_id);
+                $this-&gt;http(get_permalink($this-&gt;post_id));
+
+                $this-&gt;assertTrue(is_single());
+                $this-&gt;assertTrue(have_posts());
+                $this-&gt;assertNull(the_post());
+        }
+
+
+}
+
+class WPTestPostMoreVB extends _WPTestSinglePost {
+
+        function setUp() {
+
+                $this-&gt;post_content =&lt;&lt;&lt;EOF
+&lt;i&gt;This is the excerpt.&lt;/i&gt;
+&lt;!--more--&gt;
+This is the &lt;b&gt;body&lt;/b&gt;.
+EOF;
+
+                parent::setUp();
+        }
+
+        function test_the_content() {
+                $this-&gt;_do_post();
+                $the_content =&lt;&lt;&lt;EOF
+&lt;p&gt;&lt;i&gt;This is the excerpt.&lt;/i&gt;&lt;br /&gt;
+&lt;span id=&quot;more-{$this-&gt;post_id}&quot;&gt;&lt;/span&gt;&lt;br /&gt;
+This is the &lt;b&gt;body&lt;/b&gt;.&lt;/p&gt;
+EOF;
+
+                $this-&gt;assertEquals(strip_ws($the_content), strip_ws(get_echo('the_content')));
+        }
+
+}
+
+class WPTestShortcodeOutput1 extends _WPTestSinglePost {
+        function setUp() {
+
+                $this-&gt;post_content =&lt;&lt;&lt;EOF
+[dumptag foo=&quot;bar&quot; baz=&quot;123&quot;]
+
+[dumptag foo=123 baz=bar]
+
+[dumptag http://example.com]
+
+EOF;
+
+                parent::setUp();
+        }
+
+        function test_the_content() {
+                $this-&gt;_do_post();
+                $expected =&lt;&lt;&lt;EOF
+foo = bar
+baz = 123
+foo = 123
+baz = bar
+0 = http://example.com
+
+EOF;
+
+                $this-&gt;assertEquals(strip_ws($expected), strip_ws(get_echo('the_content')));
+        }
+}
+
+class WPTestShortcodeOutputParagraph extends _WPTestSinglePost {
+        function setUp() {
+
+                $this-&gt;post_content =&lt;&lt;&lt;EOF
+Graf by itself:
+
+[paragraph]my graf[/paragraph]
+
+  [paragraph foo=&quot;bar&quot;]another graf with whitespace[/paragraph]  
+
+An [paragraph]inline graf[/paragraph], this doesn't make much sense.
+
+A graf with a single EOL first:
+[paragraph]blah[/paragraph]
+
+EOF;
+
+                parent::setUp();
+        }
+
+        function test_the_content() {
+                $this-&gt;_do_post();
+                $expected =&lt;&lt;&lt;EOF
+&lt;p&gt;Graf by itself:&lt;/p&gt;
+&lt;p class='graf'&gt;my graf&lt;/p&gt;
+
+  &lt;p class='graf'&gt;another graf with whitespace&lt;/p&gt;
+
+&lt;p&gt;An &lt;p class='graf'&gt;inline graf&lt;/p&gt;
+, this doesn&amp;#8217;t make much sense.&lt;/p&gt;
+&lt;p&gt;A graf with a single EOL first:&lt;br /&gt;
+&lt;p class='graf'&gt;blah&lt;/p&gt;
+&lt;/p&gt;
+
+EOF;
+
+                $this-&gt;assertEquals(strip_ws($expected), strip_ws(get_echo('the_content')));
+        }
+}
+
+class WPTestGalleryPost extends _WPDataset1 {
+        function setUp() {
+                parent::setUp();
+                global $wp_rewrite;
+                $wp_rewrite-&gt;set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
+                $wp_rewrite-&gt;flush_rules();
+        }
+        
+        function test_the_content() {
+                // permalink page
+                $this-&gt;http('/2008/04/01/simple-gallery-test/');
+                the_post();
+                // filtered output
+                $out = get_echo('the_content');
+                
+                $expected = &lt;&lt;&lt;EOF
+&lt;p&gt;There are ten images attached to this post. Â Here&amp;#8217;s a gallery:&lt;/p&gt;
+
+                &lt;style type='text/css'&gt;
+                        .gallery {
+                                margin: auto;
+                        }
+                        .gallery-item {
+                                float: left;
+                                margin-top: 10px;
+                                text-align: center;
+                                width: 33%;                        }
+                        .gallery img {
+                                border: 2px solid #cfcfcf;
+                        }
+                        .gallery-caption {
+                                margin-left: 0;
+                        }
+                &lt;/style&gt;
+                &lt;!-- see gallery_shortcode() in wp-includes/media.php --&gt;
+                &lt;div class='gallery'&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20040724_152504_53/' title='dsc20040724_152504_53'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20040724_152504_537.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/canola/' title='canola'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/canola3.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050315_145007_13/' title='dsc20050315_145007_13'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050315_145007_134.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050604_133440_34/' title='dsc20050604_133440_34'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050604_133440_343.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050831_165238_33/' title='dsc20050831_165238_33'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050831_165238_333.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050901_105100_21/' title='dsc20050901_105100_21'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050901_105100_213.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050813_115856_5/' title='dsc20050813_115856_5'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050813_115856_54.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050720_123726_27/' title='dsc20050720_123726_27'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050720_123726_274.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050727_091048_22/' title='Title: Seedlings'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050727_091048_224.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050726_083116_18/' title='dsc20050726_083116_18'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050726_083116_184.jpg&quot; class=&quot;attachment-thumbnail&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;
+                        &lt;br style='clear: both;' /&gt;
+                &lt;/div&gt;
+
+&lt;p&gt;It&amp;#8217;s the simplest form of the gallery tag. Â All images are from the public domain site burningwell.org.&lt;/p&gt;
+&lt;p&gt;The images have various combinations of titles, captions and descriptions.&lt;/p&gt;
+EOF;
+                $this-&gt;assertEquals(strip_ws($expected), strip_ws($out));
+        }
+
+        function test_gallery_attributes() {
+                // make sure the gallery shortcode attributes are parsed correctly
+                
+                $id = 575;
+                $post = get_post($id);
+                $post-&gt;post_content = '[gallery columns=&quot;1&quot; size=&quot;medium&quot;]';
+                wp_update_post($post);
+                
+                // permalink page
+                $this-&gt;http('/2008/04/01/simple-gallery-test/');
+                the_post();
+                // filtered output
+                $out = get_echo('the_content');
+
+                $expected = &lt;&lt;&lt;EOF
+                &lt;style type='text/css'&gt;
+                        .gallery {
+                                margin: auto;
+                        }
+                        .gallery-item {
+                                float: left;
+                                margin-top: 10px;
+                                text-align: center;
+                                width: 100%;                        }
+                        .gallery img {
+                                border: 2px solid #cfcfcf;
+                        }
+                        .gallery-caption {
+                                margin-left: 0;
+                        }
+                &lt;/style&gt;
+                &lt;!-- see gallery_shortcode() in wp-includes/media.php --&gt;
+                &lt;div class='gallery'&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/?attachment_id=565' title='dsc20040724_152504_53'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20040724_152504_537.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/?attachment_id=566' title='canola'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/canola3.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/?attachment_id=567' title='dsc20050315_145007_13'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050315_145007_134.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/?attachment_id=568' title='dsc20050604_133440_34'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050604_133440_343.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/?attachment_id=569' title='dsc20050831_165238_33'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050831_165238_333.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/?attachment_id=570' title='dsc20050901_105100_21'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050901_105100_213.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/?attachment_id=571' title='dsc20050813_115856_5'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050813_115856_54.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/?attachment_id=572' title='dsc20050720_123726_27'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050720_123726_274.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/?attachment_id=573' title='Title: Seedlings'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050727_091048_224.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;&lt;dl class='gallery-item'&gt;
+                        &lt;dt class='gallery-icon'&gt;
+                                &lt;a href='http://example.com/?attachment_id=574' title='dsc20050726_083116_18'&gt;&lt;img src=&quot;http://example.com/wp-content/uploads/2008/04/dsc20050726_083116_184.jpg&quot; class=&quot;attachment-medium&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
+                        &lt;/dt&gt;&lt;/dl&gt;&lt;br style=&quot;clear: both&quot; /&gt;
+                        &lt;br style='clear: both;' /&gt;
+                &lt;/div&gt;
+
+EOF;
+                $this-&gt;assertEquals(strip_ws($expected), strip_ws($out));
+        }
+
+}
+
+
+
+class WPTestAttributeFiltering extends _WPTestSinglePost {
+        function setUp() {
+
+                // http://bpr3.org/?p=87
+                // the title attribute should make it through unfiltered
+                $this-&gt;post_content =&lt;&lt;&lt;EOF
+&lt;span class=&quot;Z3988&quot; title=&quot;ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.aulast=Mariat&amp;rft.aufirst=Denis&amp;rft. au=Denis+Mariat&amp;rft.au=Sead+Taourit&amp;rft.au=G%C3%A9rard+Gu%C3%A9rin&amp; rft.title=Genetics+Selection+Evolution&amp;rft.atitle=&amp;rft.date=2003&amp;rft. volume=35&amp;rft.issue=1&amp;rft.spage=119&amp;rft.epage=133&amp;rft.genre=article&amp; rft.id=info:DOI/10.1051%2Fgse%3A2002039&quot;&gt;&lt;/span&gt;Mariat, D., Taourit, S., Guérin, G. (2003). . &lt;span style=&quot;font-style: italic;&quot;&gt;Genetics Selection Evolution, 35&lt;/span&gt;(1), 119-133. DOI: &lt;a rev=&quot;review&quot; href= &quot;http://dx.doi.org/10.1051/gse:2002039&quot;&gt;10.1051/gse:2002039&lt;/a&gt;
+
+EOF;
+
+                parent::setUp();
+        }
+
+        function test_the_content() {
+                $this-&gt;_do_post();
+                $expected =&lt;&lt;&lt;EOF
+&lt;p&gt;&lt;span class=&quot;Z3988&quot; title=&quot;ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.aulast=Mariat&amp;rft.aufirst=Denis&amp;rft. au=Denis+Mariat&amp;rft.au=Sead+Taourit&amp;rft.au=G%C3%A9rard+Gu%C3%A9rin&amp; rft.title=Genetics+Selection+Evolution&amp;rft.atitle=&amp;rft.date=2003&amp;rft. volume=35&amp;rft.issue=1&amp;rft.spage=119&amp;rft.epage=133&amp;rft.genre=article&amp; rft.id=info:DOI/10.1051%2Fgse%3A2002039&quot;&gt;&lt;/span&gt;Mariat, D., Taourit, S., Guérin, G. (2003). . &lt;span style=&quot;font-style: italic;&quot;&gt;Genetics Selection Evolution, 35&lt;/span&gt;(1), 119-133. DOI: &lt;a rev=&quot;review&quot; href= &quot;http://dx.doi.org/10.1051/gse:2002039&quot;&gt;10.1051/gse:2002039&lt;/a&gt;&lt;/p&gt;
+
+EOF;
+
+                $this-&gt;assertEquals(strip_ws($expected), strip_ws(get_echo('the_content')));
+        }
+}
+
+class WPTestAttributeColon extends _WPTestSinglePost {
+        function setUp() {
+
+                // http://bpr3.org/?p=87
+                // the title attribute should make it through unfiltered
+                $this-&gt;post_content =&lt;&lt;&lt;EOF
+&lt;span title=&quot;My friends: Alice, Bob and Carol&quot;&gt;foo&lt;/span&gt;
+
+EOF;
+
+                parent::setUp();
+        }
+
+        function test_the_content() {
+                $this-&gt;_do_post();
+                $expected =&lt;&lt;&lt;EOF
+&lt;p&gt;&lt;span title=&quot;My friends: Alice, Bob and Carol&quot;&gt;foo&lt;/span&gt;&lt;/p&gt;
+
+EOF;
+
+                $this-&gt;assertEquals(strip_ws($expected), strip_ws(get_echo('the_content')));
+        }
+}
+
</ins><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: wp-testcase/test_post_output.php
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_queryphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_query.php (365 => 366)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_query.php        2011-06-03 05:17:22 UTC (rev 365)
+++ wp-testcase/test_query.php        2011-06-05 07:25:21 UTC (rev 366)
</span><span class="lines">@@ -1,567 +1,567 @@
</span><del>-&lt;?php
-
-// test the is_*() functions in query.php across the URL structure
-
-// this exercises both query.php and rewrite.php: urls are fed through the rewrite code,
-// then we test the effects of each url on the wp_query object.
-
-class TestWPQueryVars extends _WPDataset1 {
-        function setUp() {
-                parent::setUp();
-                global $wp_rewrite;
-                $wp_rewrite-&gt;set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
-                create_initial_taxonomies();
-                $wp_rewrite-&gt;flush_rules();
-        }
-
-        function tearDown() {
-                global $wp_rewrite;
-                $wp_rewrite-&gt;set_permalink_structure('');
-                parent::tearDown();
-        }
-
-        function _get_post_id_by_name($name) {
-                global $wpdb;
-                $name = $wpdb-&gt;escape($name);
-                $page_id = $wpdb-&gt;get_var(&quot;SELECT ID from {$wpdb-&gt;posts} WHERE post_name = '{$name}' LIMIT 1&quot;);
-                assert(is_numeric($page_id));
-                return $page_id;
-        }
-
-        function _all_post_ids($type='post') {
-                global $wpdb;
-                $type = $wpdb-&gt;escape($type);
-                return $wpdb-&gt;get_col(&quot;SELECT ID FROM {$wpdb-&gt;posts} WHERE post_type='{$type}' and post_status='publish'&quot;);
-        }
-
-        /**
-         * Check each of the WP_Query is_* functions/properties against expected boolean value.
-         *
-         * Any properties that are listed by name as parameters will be expected to be true; any others are
-         * expected to be false. For example, assertQueryTrue('is_single', 'is_feed') means is_single()
-         * and is_feed() must be true and everything else must be false to pass.
-         *
-         * @param string $prop,... Any number of WP_Query properties that are expected to be true for the current request.
-         */
-        function assertQueryTrue(/* ... */) {
-                global $wp_query;
-                $all = array(
-                        'is_single', 'is_preview', 'is_page', 'is_archive', 'is_date', 'is_year', 'is_month', 'is_day', 'is_time',
-                        'is_author', 'is_category', 'is_tag', 'is_tax', 'is_search', 'is_feed', 'is_comment_feed', 'is_trackback',
-                        'is_home', 'is_404', 'is_comments_popup', 'is_paged', 'is_admin', 'is_attachment', 'is_singular', 'is_robots',
-                        'is_posts_page', 'is_post_type_archive',
-                );
-                $true = func_get_args();
-
-                $passed = true;
-                $not_false = $not_true = array(); // properties that were not set to expected values
-                
-                foreach ( $all as $query_thing ) {
-                        $result = is_callable( $query_thing ) ? call_user_func( $query_thing ) : $wp_query-&gt;$query_thing;
-
-                        if ( in_array( $query_thing, $true ) ) {
-                                if ( ! $result ) {
-                                        array_push( $not_true, $query_thing );
-                                        $passed = false;
-                                }
-                        } else if ( $result ) {
-                                array_push( $not_false, $query_thing );
-                                $passed = false;
-                        }
-                }
-
-                $message = '';
-                if ( count($not_true) )
-                        $message .= implode( $not_true, ', ' ) . ' should be true. ';
-                if ( count($not_false) )
-                        $message .= implode( $not_false, ', ' ) . ' should be false.';
-                $this-&gt;assertTrue( $passed, $message );
-        }
-
-        function test_home() {
-                $this-&gt;http('/');
-                $this-&gt;assertQueryTrue('is_home');
-        }
-
-        function test_404() {
-                $this-&gt;http('/'.rand_str());
-                $this-&gt;assertQueryTrue('is_404');
-        }
-
-        function test_permalink() {
-                $this-&gt;http( get_permalink($this-&gt;_get_post_id_by_name('hello-world')) );
-                $this-&gt;assertQueryTrue('is_single', 'is_singular');
-        }
-
-        function test_post_comments_feed() {
-                $this-&gt;http(get_post_comments_feed_link($this-&gt;_get_post_id_by_name('hello-world')));
-                $this-&gt;assertQueryTrue('is_feed', 'is_single', 'is_singular', 'is_comment_feed');
-        }
-
-        function test_page() {
-                $page_id = $this-&gt;_get_post_id_by_name('about');
-                $this-&gt;http(get_permalink($page_id));
-                $this-&gt;assertQueryTrue('is_page','is_singular');
-        }
-
-        function test_parent_page() {
-                $page_id = $this-&gt;_get_post_id_by_name('parent-page');
-                $this-&gt;http(get_permalink($page_id));
-
-                $this-&gt;assertQueryTrue('is_page','is_singular');
-        }
-
-        function test_child_page_1() {
-                $page_id = $this-&gt;_get_post_id_by_name('child-page-1');
-                $this-&gt;http(get_permalink($page_id));
-
-                $this-&gt;assertQueryTrue('is_page','is_singular');
-        }
-
-        function test_child_page_2() {
-                $page_id = $this-&gt;_get_post_id_by_name('child-page-2');
-                $this-&gt;http(get_permalink($page_id));
-
-                $this-&gt;assertQueryTrue('is_page','is_singular');
-        }
-
-        // '(about)/trackback/?$' =&gt; 'index.php?pagename=$matches[1]&amp;tb=1'
-        function test_page_trackback() {
-                $pages = array('about', 'lorem-ipsum', 'parent-page', 'child-page-1', 'child-page-2');
-                foreach ($pages as $name) {
-                        $page_id = $this-&gt;_get_post_id_by_name($name);
-                        $url = get_permalink($page_id);
-                        $this-&gt;http(&quot;{$url}trackback/&quot;);
-
-                        // make sure the correct wp_query flags are set
-                        $this-&gt;assertQueryTrue('is_page','is_singular','is_trackback');
-
-                        // make sure the correct page was fetched
-                        global $wp_query;
-                        $this-&gt;assertEquals( $page_id, $wp_query-&gt;get_queried_object()-&gt;ID );
-                }
-        }
-
-        //'(about)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?pagename=$matches[1]&amp;feed=$matches[2]'
-        function test_page_feed() {
-                $pages = array('about', 'lorem-ipsum', 'parent-page', 'child-page-1', 'child-page-2');
-                foreach ($pages as $name) {
-                        $page_id = $this-&gt;_get_post_id_by_name($name);
-                        $url = get_permalink($page_id);
-                        $this-&gt;http(&quot;{$url}feed/&quot;);
-
-                        // make sure the correct wp_query flags are set
-                        $this-&gt;assertQueryTrue('is_page', 'is_singular', 'is_feed', 'is_comment_feed');
-
-                        // make sure the correct page was fetched
-                        global $wp_query;
-                        $this-&gt;assertEquals( $page_id, $wp_query-&gt;get_queried_object()-&gt;ID );
-                }
-
-        }
-
-        // '(about)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?pagename=$matches[1]&amp;feed=$matches[2]'
-        function test_page_feed_atom() {
-                $pages = array('about', 'lorem-ipsum', 'parent-page', 'child-page-1', 'child-page-2');
-                foreach ($pages as $name) {
-                        $page_id = $this-&gt;_get_post_id_by_name($name);
-                        $url = get_permalink($page_id);
-                        $this-&gt;http(&quot;{$url}feed/atom/&quot;);
-
-                        // make sure the correct wp_query flags are set
-                        $this-&gt;assertQueryTrue('is_page', 'is_singular', 'is_feed', 'is_comment_feed');
-
-                        // make sure the correct page was fetched
-                        global $wp_query;
-                        $this-&gt;assertEquals( $page_id, $wp_query-&gt;get_queried_object()-&gt;ID );
-                }
-        }
-
-        // '(about)/page/?([0-9]{1,})/?$' =&gt; 'index.php?pagename=$matches[1]&amp;paged=$matches[2]'
-        function test_page_page_2() {
-                $pages = array('about', 'lorem-ipsum', 'parent-page', 'child-page-1', 'child-page-2');
-                foreach ($pages as $name) {
-                        $page_id = $this-&gt;_get_post_id_by_name($name);
-                        $url = get_permalink($page_id);
-                        $this-&gt;http(&quot;{$url}page/2/&quot;);
-
-                        // make sure the correct wp_query flags are set
-                        $this-&gt;assertQueryTrue('is_page', 'is_singular', 'is_paged');
-
-                        // make sure the correct page was fetched
-                        global $wp_query;
-                        $this-&gt;assertEquals( $page_id, $wp_query-&gt;get_queried_object()-&gt;ID );
-                }
-        }
-
-        // FIXME: what is this for?
-        // '(about)(/[0-9]+)?/?$' =&gt; 'index.php?pagename=$matches[1]&amp;page=$matches[2]'
-        function test_page_page_2_short() {
-                //return $this-&gt;markTestSkipped();
-                // identical to /about/page/2/ ?
-                $this-&gt;http('/about/2/');
-
-                $this-&gt;assertQueryTrue('is_page', 'is_singular');
-        }
-
-        // FIXME: no tests for these yet
-        // 'about/attachment/([^/]+)/?$' =&gt; 'index.php?attachment=$matches[1]',
-        // 'about/attachment/([^/]+)/trackback/?$' =&gt; 'index.php?attachment=$matches[1]&amp;tb=1',
-        // 'about/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
-        // 'about/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
-
-        // 'feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?&amp;feed=$matches[1]',
-        // '(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?&amp;feed=$matches[1]',
-        function test_main_feed_2() {
-                $feeds = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-
-                // long version
-                foreach ($feeds as $feed) {
-                        $this-&gt;http(&quot;/feed/{$feed}/&quot;);
-                        $this-&gt;assertQueryTrue('is_feed');
-                }
-
-                // short version
-                foreach ($feeds as $feed) {
-                        $this-&gt;http(&quot;/{$feed}/&quot;);
-                        $this-&gt;assertQueryTrue('is_feed');
-                }
-
-        }
-
-        function test_main_feed() {
-                $types = array('rss2', 'rss', 'atom');
-                foreach ($types as $type) {
-                        $this-&gt;http(get_feed_link($type));
-                        $this-&gt;assertQueryTrue('is_feed');
-                }
-        }
-
-        // 'page/?([0-9]{1,})/?$' =&gt; 'index.php?&amp;paged=$matches[1]',
-        function test_paged() {
-                for ($i=2; $i&lt;4; $i++) {
-                        $this-&gt;http(&quot;/page/{$i}/&quot;);
-                        $this-&gt;assertQueryTrue('is_home', 'is_paged');
-                }
-        }
-
-        // 'comments/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?&amp;feed=$matches[1]&amp;withcomments=1',
-        // 'comments/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?&amp;feed=$matches[1]&amp;withcomments=1',
-        function test_main_comments_feed() {
-                // check the url as generated by get_post_comments_feed_link()
-                $this-&gt;http(get_post_comments_feed_link($this-&gt;_get_post_id_by_name('hello-world')));
-                $this-&gt;assertQueryTrue('is_feed', 'is_single', 'is_singular', 'is_comment_feed');
-
-                // check the long form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/comments/feed/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_feed', 'is_comment_feed');
-                }
-
-                // check the short form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/comments/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_feed', 'is_comment_feed');
-                }
-
-        }
-
-        // 'comments/page/?([0-9]{1,})/?$' =&gt; 'index.php?&amp;paged=$matches[1]',
-        function test_comments_page() {
-                $this-&gt;http('/comments/page/2/');
-                $this-&gt;assertQueryTrue('is_home', 'is_paged');
-        }
-
-
-        // 'search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?s=$matches[1]&amp;feed=$matches[2]',
-        // 'search/(.+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?s=$matches[1]&amp;feed=$matches[2]',
-        function test_search_feed() {
-                // check the long form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/search/test/feed/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_feed', 'is_search');
-                }
-
-                // check the short form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/search/test/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_feed', 'is_search');
-                }
-        }
-
-        // 'search/(.+)/page/?([0-9]{1,})/?$' =&gt; 'index.php?s=$matches[1]&amp;paged=$matches[2]',
-        function test_search_paged() {
-                $this-&gt;http('/search/test/page/2/');
-                $this-&gt;assertQueryTrue('is_search', 'is_paged');
-        }
-
-        // 'search/(.+)/?$' =&gt; 'index.php?s=$matches[1]',
-        function test_search() {
-                $this-&gt;http('/search/test/');
-                $this-&gt;assertQueryTrue('is_search');
-        }
-
-        // 'category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?category_name=$matches[1]&amp;feed=$matches[2]',
-        // 'category/(.+?)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?category_name=$matches[1]&amp;feed=$matches[2]',
-        function test_category_feed() {
-                // check the long form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/category/cat-a/feed/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_category');
-                }
-
-                // check the short form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/category/cat-a/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_category');
-                }
-        }
-
-        // 'category/(.+?)/page/?([0-9]{1,})/?$' =&gt; 'index.php?category_name=$matches[1]&amp;paged=$matches[2]',
-        function test_category_paged() {
-                $this-&gt;http('/category/uncategorized/page/2/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_category', 'is_paged');
-        }
-
-        // 'category/(.+?)/?$' =&gt; 'index.php?category_name=$matches[1]',
-        function test_category() {
-                $this-&gt;http('/category/cat-a/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_category');
-        }
-
-        // 'tag/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?tag=$matches[1]&amp;feed=$matches[2]',
-        // 'tag/(.+?)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?tag=$matches[1]&amp;feed=$matches[2]',
-        function test_tag_feed() {
-                // check the long form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/tag/tag-a/feed/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_tag');
-                }
-
-                // check the short form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/tag/tag-a/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_tag');
-                }
-        }
-
-        // 'tag/(.+?)/page/?([0-9]{1,})/?$' =&gt; 'index.php?tag=$matches[1]&amp;paged=$matches[2]',
-        function test_tag_paged() {
-                $this-&gt;markTestSkipped(); // tag-a doesn't have enough posts -&gt; 404
-                $this-&gt;http('/tag/tag-a/page/2/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_tag', 'is_paged');
-        }
-
-        // 'tag/(.+?)/?$' =&gt; 'index.php?tag=$matches[1]',
-        function test_tag() {
-                $this-&gt;http('/tag/tag-a/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_tag');
-        }
-
-        // 'author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?author_name=$matches[1]&amp;feed=$matches[2]',
-        // 'author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?author_name=$matches[1]&amp;feed=$matches[2]',
-        function test_author_feed() {
-                // check the long form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/author/user-a/feed/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_author');
-                }
-
-                // check the short form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/author/user-a/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_author');
-                }
-        }
-
-        // 'author/([^/]+)/page/?([0-9]{1,})/?$' =&gt; 'index.php?author_name=$matches[1]&amp;paged=$matches[2]',
-        function test_author_paged() {
-                $this-&gt;http('/author/user-a/page/2/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_author', 'is_paged');
-        }
-
-        // 'author/([^/]+)/?$' =&gt; 'index.php?author_name=$matches[1]',
-        function test_author() {
-                $this-&gt;http('/author/user-a/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_author');
-        }
-
-        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;feed=$matches[4]',
-        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;feed=$matches[4]',
-        function test_ymd_feed() {
-                // check the long form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/2007/09/04/feed/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_day', 'is_date');
-                }
-
-                // check the short form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/2007/09/04/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_day', 'is_date');
-                }
-        }
-
-        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;paged=$matches[4]',
-        function test_ymd_paged() {
-                $this-&gt;http('/2007/09/04/page/2/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_day', 'is_date', 'is_paged');
-        }
-
-        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]',
-        function test_ymd() {
-                $this-&gt;http('/2007/09/04/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_day', 'is_date');
-        }
-        
-        // '([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]',
-        // '([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]',
-        function test_ym_feed() {
-                // check the long form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/2007/09/feed/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_month', 'is_date');
-                }
-
-                // check the short form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/2007/09/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_month', 'is_date');
-                }
-        }
-
-        // '([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;paged=$matches[3]',
-        function test_ym_paged() {
-                $this-&gt;http('/2007/09/page/2/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_date', 'is_month', 'is_paged');
-        }
-
-        // '([0-9]{4})/([0-9]{1,2})/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]',
-        function test_ym() {
-                $this-&gt;http('/2007/09/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_date', 'is_month');
-        }
-
-        // '([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;feed=$matches[2]',
-        // '([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;feed=$matches[2]',
-        function test_y_feed() {
-                // check the long form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/2007/feed/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_year', 'is_date');
-                }
-
-                // check the short form
-                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                foreach ($types as $type) {
-                                $this-&gt;http(&quot;/2007/{$type}&quot;);
-                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_year', 'is_date');
-                }
-        }
-
-        // '([0-9]{4})/page/?([0-9]{1,})/?$' =&gt; 'index.php?year=$matches[1]&amp;paged=$matches[2]',
-        function test_y_paged() {
-                $this-&gt;http('/2007/page/2/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_date', 'is_year', 'is_paged');
-        }
-
-        // '([0-9]{4})/?$' =&gt; 'index.php?year=$matches[1]',
-        function test_y() {
-                $this-&gt;http('/2007/');
-                $this-&gt;assertQueryTrue('is_archive', 'is_date', 'is_year');
-        }
-
-
-        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;name=$matches[4]&amp;tb=1',
-        function test_post_trackback() {
-                foreach ($this-&gt;_all_post_ids() as $id) {
-                        $permalink = get_permalink($id);
-                        $this-&gt;http(&quot;{$permalink}trackback/&quot;);
-                        $this-&gt;assertQueryTrue('is_single', 'is_singular', 'is_trackback');
-                }
-        }
-
-        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;name=$matches[4]&amp;feed=$matches[5]',
-        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;name=$matches[4]&amp;feed=$matches[5]',
-        function test_post_comment_feed() {
-                foreach ($this-&gt;_all_post_ids() as $id) {
-                        $permalink = get_permalink($id);
-                        
-                        $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                        foreach ($types as $type) {
-                                        $this-&gt;http(&quot;{$permalink}feed/{$type}&quot;);
-                                        $this-&gt;assertQueryTrue('is_single', 'is_singular', 'is_feed', 'is_comment_feed');
-                        }
-
-                        // check the short form
-                        $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
-                        foreach ($types as $type) {
-                                        $this-&gt;http(&quot;{$permalink}{$type}&quot;);
-                                        $this-&gt;assertQueryTrue('is_single', 'is_singular', 'is_feed', 'is_comment_feed');
-                        }
-
-                }
-        }
-
-        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;name=$matches[4]&amp;paged=$matches[5]',
-        function test_post_paged_long() {
-                $this-&gt;markTestSkipped(); // @todo post doesn't exist in Data Set 1, plus /page/x isn't for single posts
-                // the long version
-                $this-&gt;http('/2007/09/04/a-post-with-multiple-pages/page/2/');
-                // should is_paged be true also?
-                $this-&gt;assertQueryTrue('is_single', 'is_singular');
-        }
-
-        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;name=$matches[4]&amp;page=$matches[5]',
-        function test_post_paged_short() {
-                $this-&gt;markTestSkipped(); // @todo post doesn't exist in Data Set 1
-                // and the short version
-                $this-&gt;http('/2007/09/04/a-post-with-multiple-pages/2/');
-                // should is_paged be true also?
-                $this-&gt;assertQueryTrue('is_single', 'is_singular');
-                
-        }
-        
-        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/?$' =&gt; 'index.php?attachment=$matches[1]',
-        function test_post_attachment() {
-                $this-&gt;markTestSkipped(); // @todo ID 8 is a page in Data Set 1
-                $permalink = get_attachment_link(8);
-                $this-&gt;http($permalink);
-                $this-&gt;assertQueryTrue('is_attachment', 'is_singular');
-        }
-
-        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/trackback/?$' =&gt; 'index.php?attachment=$matches[1]&amp;tb=1',
-        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
-        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
-        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/?$' =&gt; 'index.php?attachment=$matches[1]',
-        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/trackback/?$' =&gt; 'index.php?attachment=$matches[1]&amp;tb=1',
-        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
-        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
-}
-
-class TestWPQueryVerbosePageRules extends TestWPQueryVars {
-        function setUp() {
-                parent::setUp();
-                global $wp_rewrite;
-                $wp_rewrite-&gt;set_permalink_structure('/%author%/%year%/%postname%/');
-                create_initial_taxonomies();
-                $wp_rewrite-&gt;flush_rules();
-        }
-}
-
-?&gt;
</del><ins>+&lt;?php
+
+// test the is_*() functions in query.php across the URL structure
+
+// this exercises both query.php and rewrite.php: urls are fed through the rewrite code,
+// then we test the effects of each url on the wp_query object.
+
+class TestWPQueryVars extends _WPDataset1 {
+        function setUp() {
+                parent::setUp();
+                global $wp_rewrite;
+                $wp_rewrite-&gt;set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
+                create_initial_taxonomies();
+                $wp_rewrite-&gt;flush_rules();
+        }
+
+        function tearDown() {
+                global $wp_rewrite;
+                $wp_rewrite-&gt;set_permalink_structure('');
+                parent::tearDown();
+        }
+
+        function _get_post_id_by_name($name) {
+                global $wpdb;
+                $name = $wpdb-&gt;escape($name);
+                $page_id = $wpdb-&gt;get_var(&quot;SELECT ID from {$wpdb-&gt;posts} WHERE post_name = '{$name}' LIMIT 1&quot;);
+                assert(is_numeric($page_id));
+                return $page_id;
+        }
+
+        function _all_post_ids($type='post') {
+                global $wpdb;
+                $type = $wpdb-&gt;escape($type);
+                return $wpdb-&gt;get_col(&quot;SELECT ID FROM {$wpdb-&gt;posts} WHERE post_type='{$type}' and post_status='publish'&quot;);
+        }
+
+        /**
+         * Check each of the WP_Query is_* functions/properties against expected boolean value.
+         *
+         * Any properties that are listed by name as parameters will be expected to be true; any others are
+         * expected to be false. For example, assertQueryTrue('is_single', 'is_feed') means is_single()
+         * and is_feed() must be true and everything else must be false to pass.
+         *
+         * @param string $prop,... Any number of WP_Query properties that are expected to be true for the current request.
+         */
+        function assertQueryTrue(/* ... */) {
+                global $wp_query;
+                $all = array(
+                        'is_single', 'is_preview', 'is_page', 'is_archive', 'is_date', 'is_year', 'is_month', 'is_day', 'is_time',
+                        'is_author', 'is_category', 'is_tag', 'is_tax', 'is_search', 'is_feed', 'is_comment_feed', 'is_trackback',
+                        'is_home', 'is_404', 'is_comments_popup', 'is_paged', 'is_admin', 'is_attachment', 'is_singular', 'is_robots',
+                        'is_posts_page', 'is_post_type_archive',
+                );
+                $true = func_get_args();
+
+                $passed = true;
+                $not_false = $not_true = array(); // properties that were not set to expected values
+                
+                foreach ( $all as $query_thing ) {
+                        $result = is_callable( $query_thing ) ? call_user_func( $query_thing ) : $wp_query-&gt;$query_thing;
+
+                        if ( in_array( $query_thing, $true ) ) {
+                                if ( ! $result ) {
+                                        array_push( $not_true, $query_thing );
+                                        $passed = false;
+                                }
+                        } else if ( $result ) {
+                                array_push( $not_false, $query_thing );
+                                $passed = false;
+                        }
+                }
+
+                $message = '';
+                if ( count($not_true) )
+                        $message .= implode( $not_true, ', ' ) . ' should be true. ';
+                if ( count($not_false) )
+                        $message .= implode( $not_false, ', ' ) . ' should be false.';
+                $this-&gt;assertTrue( $passed, $message );
+        }
+
+        function test_home() {
+                $this-&gt;http('/');
+                $this-&gt;assertQueryTrue('is_home');
+        }
+
+        function test_404() {
+                $this-&gt;http('/'.rand_str());
+                $this-&gt;assertQueryTrue('is_404');
+        }
+
+        function test_permalink() {
+                $this-&gt;http( get_permalink($this-&gt;_get_post_id_by_name('hello-world')) );
+                $this-&gt;assertQueryTrue('is_single', 'is_singular');
+        }
+
+        function test_post_comments_feed() {
+                $this-&gt;http(get_post_comments_feed_link($this-&gt;_get_post_id_by_name('hello-world')));
+                $this-&gt;assertQueryTrue('is_feed', 'is_single', 'is_singular', 'is_comment_feed');
+        }
+
+        function test_page() {
+                $page_id = $this-&gt;_get_post_id_by_name('about');
+                $this-&gt;http(get_permalink($page_id));
+                $this-&gt;assertQueryTrue('is_page','is_singular');
+        }
+
+        function test_parent_page() {
+                $page_id = $this-&gt;_get_post_id_by_name('parent-page');
+                $this-&gt;http(get_permalink($page_id));
+
+                $this-&gt;assertQueryTrue('is_page','is_singular');
+        }
+
+        function test_child_page_1() {
+                $page_id = $this-&gt;_get_post_id_by_name('child-page-1');
+                $this-&gt;http(get_permalink($page_id));
+
+                $this-&gt;assertQueryTrue('is_page','is_singular');
+        }
+
+        function test_child_page_2() {
+                $page_id = $this-&gt;_get_post_id_by_name('child-page-2');
+                $this-&gt;http(get_permalink($page_id));
+
+                $this-&gt;assertQueryTrue('is_page','is_singular');
+        }
+
+        // '(about)/trackback/?$' =&gt; 'index.php?pagename=$matches[1]&amp;tb=1'
+        function test_page_trackback() {
+                $pages = array('about', 'lorem-ipsum', 'parent-page', 'child-page-1', 'child-page-2');
+                foreach ($pages as $name) {
+                        $page_id = $this-&gt;_get_post_id_by_name($name);
+                        $url = get_permalink($page_id);
+                        $this-&gt;http(&quot;{$url}trackback/&quot;);
+
+                        // make sure the correct wp_query flags are set
+                        $this-&gt;assertQueryTrue('is_page','is_singular','is_trackback');
+
+                        // make sure the correct page was fetched
+                        global $wp_query;
+                        $this-&gt;assertEquals( $page_id, $wp_query-&gt;get_queried_object()-&gt;ID );
+                }
+        }
+
+        //'(about)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?pagename=$matches[1]&amp;feed=$matches[2]'
+        function test_page_feed() {
+                $pages = array('about', 'lorem-ipsum', 'parent-page', 'child-page-1', 'child-page-2');
+                foreach ($pages as $name) {
+                        $page_id = $this-&gt;_get_post_id_by_name($name);
+                        $url = get_permalink($page_id);
+                        $this-&gt;http(&quot;{$url}feed/&quot;);
+
+                        // make sure the correct wp_query flags are set
+                        $this-&gt;assertQueryTrue('is_page', 'is_singular', 'is_feed', 'is_comment_feed');
+
+                        // make sure the correct page was fetched
+                        global $wp_query;
+                        $this-&gt;assertEquals( $page_id, $wp_query-&gt;get_queried_object()-&gt;ID );
+                }
+
+        }
+
+        // '(about)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?pagename=$matches[1]&amp;feed=$matches[2]'
+        function test_page_feed_atom() {
+                $pages = array('about', 'lorem-ipsum', 'parent-page', 'child-page-1', 'child-page-2');
+                foreach ($pages as $name) {
+                        $page_id = $this-&gt;_get_post_id_by_name($name);
+                        $url = get_permalink($page_id);
+                        $this-&gt;http(&quot;{$url}feed/atom/&quot;);
+
+                        // make sure the correct wp_query flags are set
+                        $this-&gt;assertQueryTrue('is_page', 'is_singular', 'is_feed', 'is_comment_feed');
+
+                        // make sure the correct page was fetched
+                        global $wp_query;
+                        $this-&gt;assertEquals( $page_id, $wp_query-&gt;get_queried_object()-&gt;ID );
+                }
+        }
+
+        // '(about)/page/?([0-9]{1,})/?$' =&gt; 'index.php?pagename=$matches[1]&amp;paged=$matches[2]'
+        function test_page_page_2() {
+                $pages = array('about', 'lorem-ipsum', 'parent-page', 'child-page-1', 'child-page-2');
+                foreach ($pages as $name) {
+                        $page_id = $this-&gt;_get_post_id_by_name($name);
+                        $url = get_permalink($page_id);
+                        $this-&gt;http(&quot;{$url}page/2/&quot;);
+
+                        // make sure the correct wp_query flags are set
+                        $this-&gt;assertQueryTrue('is_page', 'is_singular', 'is_paged');
+
+                        // make sure the correct page was fetched
+                        global $wp_query;
+                        $this-&gt;assertEquals( $page_id, $wp_query-&gt;get_queried_object()-&gt;ID );
+                }
+        }
+
+        // FIXME: what is this for?
+        // '(about)(/[0-9]+)?/?$' =&gt; 'index.php?pagename=$matches[1]&amp;page=$matches[2]'
+        function test_page_page_2_short() {
+                //return $this-&gt;markTestSkipped();
+                // identical to /about/page/2/ ?
+                $this-&gt;http('/about/2/');
+
+                $this-&gt;assertQueryTrue('is_page', 'is_singular');
+        }
+
+        // FIXME: no tests for these yet
+        // 'about/attachment/([^/]+)/?$' =&gt; 'index.php?attachment=$matches[1]',
+        // 'about/attachment/([^/]+)/trackback/?$' =&gt; 'index.php?attachment=$matches[1]&amp;tb=1',
+        // 'about/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
+        // 'about/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
+
+        // 'feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?&amp;feed=$matches[1]',
+        // '(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?&amp;feed=$matches[1]',
+        function test_main_feed_2() {
+                $feeds = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+
+                // long version
+                foreach ($feeds as $feed) {
+                        $this-&gt;http(&quot;/feed/{$feed}/&quot;);
+                        $this-&gt;assertQueryTrue('is_feed');
+                }
+
+                // short version
+                foreach ($feeds as $feed) {
+                        $this-&gt;http(&quot;/{$feed}/&quot;);
+                        $this-&gt;assertQueryTrue('is_feed');
+                }
+
+        }
+
+        function test_main_feed() {
+                $types = array('rss2', 'rss', 'atom');
+                foreach ($types as $type) {
+                        $this-&gt;http(get_feed_link($type));
+                        $this-&gt;assertQueryTrue('is_feed');
+                }
+        }
+
+        // 'page/?([0-9]{1,})/?$' =&gt; 'index.php?&amp;paged=$matches[1]',
+        function test_paged() {
+                for ($i=2; $i&lt;4; $i++) {
+                        $this-&gt;http(&quot;/page/{$i}/&quot;);
+                        $this-&gt;assertQueryTrue('is_home', 'is_paged');
+                }
+        }
+
+        // 'comments/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?&amp;feed=$matches[1]&amp;withcomments=1',
+        // 'comments/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?&amp;feed=$matches[1]&amp;withcomments=1',
+        function test_main_comments_feed() {
+                // check the url as generated by get_post_comments_feed_link()
+                $this-&gt;http(get_post_comments_feed_link($this-&gt;_get_post_id_by_name('hello-world')));
+                $this-&gt;assertQueryTrue('is_feed', 'is_single', 'is_singular', 'is_comment_feed');
+
+                // check the long form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/comments/feed/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_feed', 'is_comment_feed');
+                }
+
+                // check the short form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/comments/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_feed', 'is_comment_feed');
+                }
+
+        }
+
+        // 'comments/page/?([0-9]{1,})/?$' =&gt; 'index.php?&amp;paged=$matches[1]',
+        function test_comments_page() {
+                $this-&gt;http('/comments/page/2/');
+                $this-&gt;assertQueryTrue('is_home', 'is_paged');
+        }
+
+
+        // 'search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?s=$matches[1]&amp;feed=$matches[2]',
+        // 'search/(.+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?s=$matches[1]&amp;feed=$matches[2]',
+        function test_search_feed() {
+                // check the long form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/search/test/feed/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_feed', 'is_search');
+                }
+
+                // check the short form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/search/test/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_feed', 'is_search');
+                }
+        }
+
+        // 'search/(.+)/page/?([0-9]{1,})/?$' =&gt; 'index.php?s=$matches[1]&amp;paged=$matches[2]',
+        function test_search_paged() {
+                $this-&gt;http('/search/test/page/2/');
+                $this-&gt;assertQueryTrue('is_search', 'is_paged');
+        }
+
+        // 'search/(.+)/?$' =&gt; 'index.php?s=$matches[1]',
+        function test_search() {
+                $this-&gt;http('/search/test/');
+                $this-&gt;assertQueryTrue('is_search');
+        }
+
+        // 'category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?category_name=$matches[1]&amp;feed=$matches[2]',
+        // 'category/(.+?)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?category_name=$matches[1]&amp;feed=$matches[2]',
+        function test_category_feed() {
+                // check the long form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/category/cat-a/feed/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_category');
+                }
+
+                // check the short form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/category/cat-a/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_category');
+                }
+        }
+
+        // 'category/(.+?)/page/?([0-9]{1,})/?$' =&gt; 'index.php?category_name=$matches[1]&amp;paged=$matches[2]',
+        function test_category_paged() {
+                $this-&gt;http('/category/uncategorized/page/2/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_category', 'is_paged');
+        }
+
+        // 'category/(.+?)/?$' =&gt; 'index.php?category_name=$matches[1]',
+        function test_category() {
+                $this-&gt;http('/category/cat-a/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_category');
+        }
+
+        // 'tag/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?tag=$matches[1]&amp;feed=$matches[2]',
+        // 'tag/(.+?)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?tag=$matches[1]&amp;feed=$matches[2]',
+        function test_tag_feed() {
+                // check the long form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/tag/tag-a/feed/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_tag');
+                }
+
+                // check the short form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/tag/tag-a/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_tag');
+                }
+        }
+
+        // 'tag/(.+?)/page/?([0-9]{1,})/?$' =&gt; 'index.php?tag=$matches[1]&amp;paged=$matches[2]',
+        function test_tag_paged() {
+                $this-&gt;markTestSkipped(); // tag-a doesn't have enough posts -&gt; 404
+                $this-&gt;http('/tag/tag-a/page/2/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_tag', 'is_paged');
+        }
+
+        // 'tag/(.+?)/?$' =&gt; 'index.php?tag=$matches[1]',
+        function test_tag() {
+                $this-&gt;http('/tag/tag-a/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_tag');
+        }
+
+        // 'author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?author_name=$matches[1]&amp;feed=$matches[2]',
+        // 'author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?author_name=$matches[1]&amp;feed=$matches[2]',
+        function test_author_feed() {
+                // check the long form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/author/user-a/feed/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_author');
+                }
+
+                // check the short form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/author/user-a/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_author');
+                }
+        }
+
+        // 'author/([^/]+)/page/?([0-9]{1,})/?$' =&gt; 'index.php?author_name=$matches[1]&amp;paged=$matches[2]',
+        function test_author_paged() {
+                $this-&gt;http('/author/user-a/page/2/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_author', 'is_paged');
+        }
+
+        // 'author/([^/]+)/?$' =&gt; 'index.php?author_name=$matches[1]',
+        function test_author() {
+                $this-&gt;http('/author/user-a/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_author');
+        }
+
+        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;feed=$matches[4]',
+        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;feed=$matches[4]',
+        function test_ymd_feed() {
+                // check the long form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/2007/09/04/feed/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_day', 'is_date');
+                }
+
+                // check the short form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/2007/09/04/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_day', 'is_date');
+                }
+        }
+
+        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;paged=$matches[4]',
+        function test_ymd_paged() {
+                $this-&gt;http('/2007/09/04/page/2/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_day', 'is_date', 'is_paged');
+        }
+
+        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]',
+        function test_ymd() {
+                $this-&gt;http('/2007/09/04/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_day', 'is_date');
+        }
+        
+        // '([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]',
+        // '([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]',
+        function test_ym_feed() {
+                // check the long form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/2007/09/feed/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_month', 'is_date');
+                }
+
+                // check the short form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/2007/09/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_month', 'is_date');
+                }
+        }
+
+        // '([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;paged=$matches[3]',
+        function test_ym_paged() {
+                $this-&gt;http('/2007/09/page/2/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_date', 'is_month', 'is_paged');
+        }
+
+        // '([0-9]{4})/([0-9]{1,2})/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]',
+        function test_ym() {
+                $this-&gt;http('/2007/09/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_date', 'is_month');
+        }
+
+        // '([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;feed=$matches[2]',
+        // '([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;feed=$matches[2]',
+        function test_y_feed() {
+                // check the long form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/2007/feed/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_year', 'is_date');
+                }
+
+                // check the short form
+                $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                foreach ($types as $type) {
+                                $this-&gt;http(&quot;/2007/{$type}&quot;);
+                                $this-&gt;assertQueryTrue('is_archive', 'is_feed', 'is_year', 'is_date');
+                }
+        }
+
+        // '([0-9]{4})/page/?([0-9]{1,})/?$' =&gt; 'index.php?year=$matches[1]&amp;paged=$matches[2]',
+        function test_y_paged() {
+                $this-&gt;http('/2007/page/2/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_date', 'is_year', 'is_paged');
+        }
+
+        // '([0-9]{4})/?$' =&gt; 'index.php?year=$matches[1]',
+        function test_y() {
+                $this-&gt;http('/2007/');
+                $this-&gt;assertQueryTrue('is_archive', 'is_date', 'is_year');
+        }
+
+
+        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;name=$matches[4]&amp;tb=1',
+        function test_post_trackback() {
+                foreach ($this-&gt;_all_post_ids() as $id) {
+                        $permalink = get_permalink($id);
+                        $this-&gt;http(&quot;{$permalink}trackback/&quot;);
+                        $this-&gt;assertQueryTrue('is_single', 'is_singular', 'is_trackback');
+                }
+        }
+
+        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;name=$matches[4]&amp;feed=$matches[5]',
+        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;name=$matches[4]&amp;feed=$matches[5]',
+        function test_post_comment_feed() {
+                foreach ($this-&gt;_all_post_ids() as $id) {
+                        $permalink = get_permalink($id);
+                        
+                        $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                        foreach ($types as $type) {
+                                        $this-&gt;http(&quot;{$permalink}feed/{$type}&quot;);
+                                        $this-&gt;assertQueryTrue('is_single', 'is_singular', 'is_feed', 'is_comment_feed');
+                        }
+
+                        // check the short form
+                        $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+                        foreach ($types as $type) {
+                                        $this-&gt;http(&quot;{$permalink}{$type}&quot;);
+                                        $this-&gt;assertQueryTrue('is_single', 'is_singular', 'is_feed', 'is_comment_feed');
+                        }
+
+                }
+        }
+
+        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;name=$matches[4]&amp;paged=$matches[5]',
+        function test_post_paged_long() {
+                $this-&gt;markTestSkipped(); // @todo post doesn't exist in Data Set 1, plus /page/x isn't for single posts
+                // the long version
+                $this-&gt;http('/2007/09/04/a-post-with-multiple-pages/page/2/');
+                // should is_paged be true also?
+                $this-&gt;assertQueryTrue('is_single', 'is_singular');
+        }
+
+        // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$' =&gt; 'index.php?year=$matches[1]&amp;monthnum=$matches[2]&amp;day=$matches[3]&amp;name=$matches[4]&amp;page=$matches[5]',
+        function test_post_paged_short() {
+                $this-&gt;markTestSkipped(); // @todo post doesn't exist in Data Set 1
+                // and the short version
+                $this-&gt;http('/2007/09/04/a-post-with-multiple-pages/2/');
+                // should is_paged be true also?
+                $this-&gt;assertQueryTrue('is_single', 'is_singular');
+                
+        }
+        
+        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/?$' =&gt; 'index.php?attachment=$matches[1]',
+        function test_post_attachment() {
+                $this-&gt;markTestSkipped(); // @todo ID 8 is a page in Data Set 1
+                $permalink = get_attachment_link(8);
+                $this-&gt;http($permalink);
+                $this-&gt;assertQueryTrue('is_attachment', 'is_singular');
+        }
+
+        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/trackback/?$' =&gt; 'index.php?attachment=$matches[1]&amp;tb=1',
+        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
+        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
+        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/?$' =&gt; 'index.php?attachment=$matches[1]',
+        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/trackback/?$' =&gt; 'index.php?attachment=$matches[1]&amp;tb=1',
+        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
+        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' =&gt; 'index.php?attachment=$matches[1]&amp;feed=$matches[2]',
+}
+
+class TestWPQueryVerbosePageRules extends TestWPQueryVars {
+        function setUp() {
+                parent::setUp();
+                global $wp_rewrite;
+                $wp_rewrite-&gt;set_permalink_structure('/%author%/%year%/%postname%/');
+                create_initial_taxonomies();
+                $wp_rewrite-&gt;flush_rules();
+        }
+}
+
+?&gt;
</ins><span class="cx">Property changes on: wp-testcase/test_query.php
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_query_resultsphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_query_results.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_shortcodephp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_shortcode.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_uploadsphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_uploads.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_userphp"></a>
<div class="modfile"><h4>Modified: wp-testcase/test_user.php (365 => 366)</h4>
<pre class="diff"><span>
<span class="info">--- wp-testcase/test_user.php        2011-06-03 05:17:22 UTC (rev 365)
+++ wp-testcase/test_user.php        2011-06-05 07:25:21 UTC (rev 366)
</span><span class="lines">@@ -1,172 +1,172 @@
</span><del>-&lt;?php
-
-// test functions in wp-includes/user.php
-
-class TestWPUser extends _WPEmptyBlog {
-
-        var $user_ids = array();
-
-        function setUp() {
-                parent::setUp();
-                // keep track of users we create
-                $user_ids = array();
-        }
-
-        function tearDown() {
-                parent::tearDown();
-                // delete any users that were created during tests
-                foreach ($this-&gt;user_ids as $id)
-                        wp_delete_user($id);
-        }
-
-        function test_get_users_of_blog() {
-                // add one of each user role
-                $user_role = array();
-                foreach (array('administrator', 'editor', 'author', 'contributor', 'subscriber') as $role) {
-                        $id = $this-&gt;_make_user($role);
-                        $user_role[$id] = $role;
-                }
-
-                $user_list = get_users_of_blog();
-
-                // find the role of each user as returned by get_users_of_blog
-                $found = array();
-                foreach ($user_list as $user) {
-                        // only include the users we just created - there might be some others that existed previously
-                        if (isset($user_role[$user-&gt;user_id])) {
-                                $roles = array_keys(unserialize($user-&gt;meta_value));
-                                $found[$user-&gt;user_id] = $roles[0];
-                        }
-                }
-
-                // make sure every user we created was returned
-                $this-&gt;assertEquals($user_role, $found);
-
-        }
-
-        // simple get/set tests for user_option functions
-        function test_user_option() {
-
-                $key = rand_str();
-                $val = rand_str();
-
-                $user_id = $this-&gt;_make_user('author');
-
-                // get an option that doesn't exist
-                $this-&gt;assertFalse(get_user_option($key, $user_id));
-
-                // set and get
-                update_user_option( $user_id, $key, $val );
-                $this-&gt;assertEquals( $val, get_user_option($key, $user_id) );
-
-                // change and get again
-                $val2 = rand_str();
-                update_user_option( $user_id, $key, $val2 );
-                $this-&gt;assertEquals( $val2, get_user_option($key, $user_id) );
-
-        }
-
-        // simple tests for usermeta functions
-        function test_usermeta() {
-
-                $key = rand_str();
-                $val = rand_str();
-
-                $user_id = $this-&gt;_make_user('author');
-
-                // get a meta key that doesn't exist
-                $this-&gt;assertEquals( '', get_usermeta($user_id, $key) );
-
-                // set and get
-                update_usermeta( $user_id, $key, $val );
-                $this-&gt;assertEquals( $val, get_usermeta($user_id, $key) );
-
-                // change and get again
-                $val2 = rand_str();
-                update_usermeta( $user_id, $key, $val2 );
-                $this-&gt;assertEquals( $val2, get_usermeta($user_id, $key) );
-
-                // delete and get
-                delete_usermeta( $user_id, $key );
-                $this-&gt;assertEquals( '', get_usermeta($user_id, $key) );
-
-                // delete by key AND value
-                update_usermeta( $user_id, $key, $val );
-                // incorrect key: key still exists
-                delete_usermeta( $user_id, $key, rand_str() );
-                $this-&gt;assertEquals( $val, get_usermeta($user_id, $key) );
-                // correct key: deleted
-                delete_usermeta( $user_id, $key, $val );
-                $this-&gt;assertEquals( '', get_usermeta($user_id, $key) );
-
-        }
-
-        // test usermeta functions in array mode
-        function test_usermeta_array() {
-
-                // some values to set
-                $vals = array(
-                        rand_str() =&gt; 'val-'.rand_str(),
-                        rand_str() =&gt; 'val-'.rand_str(),
-                        rand_str() =&gt; 'val-'.rand_str(),
-                );
-
-                $user_id = $this-&gt;_make_user('author');
-
-                // there is already some stuff in the array
-                $this-&gt;assertTrue(is_array(get_usermeta($user_id)));
-                
-                foreach ($vals as $k=&gt;$v)
-                        update_usermeta( $user_id, $k, $v );
-                
-                // get the complete usermeta array
-                $out = get_usermeta($user_id);
-
-                // for reasons unclear, the resulting array is indexed numerically; meta keys are not included anywhere.
-                // so we'll just check to make sure our values are included somewhere.
-                foreach ($vals as $v)
-                        $this-&gt;assertTrue(in_array($v, $out));
-                        
-                // delete one key and check again
-                $key_to_delete = array_pop(array_keys($vals));
-                delete_usermeta($user_id, $key_to_delete);
-                $out = get_usermeta($user_id);
-                // make sure that key is excluded from the results
-                foreach ($vals as $k=&gt;$v) {
-                        if ($k == $key_to_delete)
-                                $this-&gt;assertFalse(in_array($v, $out));
-                        else
-                                $this-&gt;assertTrue(in_array($v, $out));
-                }
-        }
-
-        // simple test for user dropdown
-        function test_wp_dropdown_users() {
-                // mu doesn't have this function?
-                if (!is_callable('wp_dropdown_users'))
-                        return $this-&gt;markTestSkipped();
-
-                // add some users
-                foreach (array('administrator', 'editor', 'author', 'contributor', 'subscriber') as $role) {
-                        $id = $this-&gt;_make_user($role, &quot;test-{$role}&quot;);
-                        $user[] = $id;
-                }
-
-                $expected = &lt;&lt;&lt;EOF
-&lt;select name='user' id='user' class=''&gt;
-&lt;option value='1'&gt;{$this-&gt;author-&gt;display_name}&lt;/option&gt;
-&lt;option value='{$user[0]}'&gt;test-administrator&lt;/option&gt;
-&lt;option value='{$user[1]}'&gt;test-editor&lt;/option&gt;
-&lt;option value='{$user[2]}'&gt;test-author&lt;/option&gt;
-&lt;option value='{$user[3]}'&gt;test-contributor&lt;/option&gt;
-&lt;option value='{$user[4]}'&gt;test-subscriber&lt;/option&gt;
-&lt;/select&gt;
-EOF;
-
-                $out = wp_dropdown_users('echo=0&amp;orderby=ID');
-
-                $this-&gt;assertEquals(strip_ws($expected), strip_ws($out));
-        }
-}
-
-?&gt;
</del><ins>+&lt;?php
+
+// test functions in wp-includes/user.php
+
+class TestWPUser extends _WPEmptyBlog {
+
+        var $user_ids = array();
+
+        function setUp() {
+                parent::setUp();
+                // keep track of users we create
+                $user_ids = array();
+        }
+
+        function tearDown() {
+                parent::tearDown();
+                // delete any users that were created during tests
+                foreach ($this-&gt;user_ids as $id)
+                        wp_delete_user($id);
+        }
+
+        function test_get_users_of_blog() {
+                // add one of each user role
+                $user_role = array();
+                foreach (array('administrator', 'editor', 'author', 'contributor', 'subscriber') as $role) {
+                        $id = $this-&gt;_make_user($role);
+                        $user_role[$id] = $role;
+                }
+
+                $user_list = get_users_of_blog();
+
+                // find the role of each user as returned by get_users_of_blog
+                $found = array();
+                foreach ($user_list as $user) {
+                        // only include the users we just created - there might be some others that existed previously
+                        if (isset($user_role[$user-&gt;user_id])) {
+                                $roles = array_keys(unserialize($user-&gt;meta_value));
+                                $found[$user-&gt;user_id] = $roles[0];
+                        }
+                }
+
+                // make sure every user we created was returned
+                $this-&gt;assertEquals($user_role, $found);
+
+        }
+
+        // simple get/set tests for user_option functions
+        function test_user_option() {
+
+                $key = rand_str();
+                $val = rand_str();
+
+                $user_id = $this-&gt;_make_user('author');
+
+                // get an option that doesn't exist
+                $this-&gt;assertFalse(get_user_option($key, $user_id));
+
+                // set and get
+                update_user_option( $user_id, $key, $val );
+                $this-&gt;assertEquals( $val, get_user_option($key, $user_id) );
+
+                // change and get again
+                $val2 = rand_str();
+                update_user_option( $user_id, $key, $val2 );
+                $this-&gt;assertEquals( $val2, get_user_option($key, $user_id) );
+
+        }
+
+        // simple tests for usermeta functions
+        function test_usermeta() {
+
+                $key = rand_str();
+                $val = rand_str();
+
+                $user_id = $this-&gt;_make_user('author');
+
+                // get a meta key that doesn't exist
+                $this-&gt;assertEquals( '', get_usermeta($user_id, $key) );
+
+                // set and get
+                update_usermeta( $user_id, $key, $val );
+                $this-&gt;assertEquals( $val, get_usermeta($user_id, $key) );
+
+                // change and get again
+                $val2 = rand_str();
+                update_usermeta( $user_id, $key, $val2 );
+                $this-&gt;assertEquals( $val2, get_usermeta($user_id, $key) );
+
+                // delete and get
+                delete_usermeta( $user_id, $key );
+                $this-&gt;assertEquals( '', get_usermeta($user_id, $key) );
+
+                // delete by key AND value
+                update_usermeta( $user_id, $key, $val );
+                // incorrect key: key still exists
+                delete_usermeta( $user_id, $key, rand_str() );
+                $this-&gt;assertEquals( $val, get_usermeta($user_id, $key) );
+                // correct key: deleted
+                delete_usermeta( $user_id, $key, $val );
+                $this-&gt;assertEquals( '', get_usermeta($user_id, $key) );
+
+        }
+
+        // test usermeta functions in array mode
+        function test_usermeta_array() {
+
+                // some values to set
+                $vals = array(
+                        rand_str() =&gt; 'val-'.rand_str(),
+                        rand_str() =&gt; 'val-'.rand_str(),
+                        rand_str() =&gt; 'val-'.rand_str(),
+                );
+
+                $user_id = $this-&gt;_make_user('author');
+
+                // there is already some stuff in the array
+                $this-&gt;assertTrue(is_array(get_usermeta($user_id)));
+                
+                foreach ($vals as $k=&gt;$v)
+                        update_usermeta( $user_id, $k, $v );
+                
+                // get the complete usermeta array
+                $out = get_usermeta($user_id);
+
+                // for reasons unclear, the resulting array is indexed numerically; meta keys are not included anywhere.
+                // so we'll just check to make sure our values are included somewhere.
+                foreach ($vals as $v)
+                        $this-&gt;assertTrue(in_array($v, $out));
+                        
+                // delete one key and check again
+                $key_to_delete = array_pop(array_keys($vals));
+                delete_usermeta($user_id, $key_to_delete);
+                $out = get_usermeta($user_id);
+                // make sure that key is excluded from the results
+                foreach ($vals as $k=&gt;$v) {
+                        if ($k == $key_to_delete)
+                                $this-&gt;assertFalse(in_array($v, $out));
+                        else
+                                $this-&gt;assertTrue(in_array($v, $out));
+                }
+        }
+
+        // simple test for user dropdown
+        function test_wp_dropdown_users() {
+                // mu doesn't have this function?
+                if (!is_callable('wp_dropdown_users'))
+                        return $this-&gt;markTestSkipped();
+
+                // add some users
+                foreach (array('administrator', 'editor', 'author', 'contributor', 'subscriber') as $role) {
+                        $id = $this-&gt;_make_user($role, &quot;test-{$role}&quot;);
+                        $user[] = $id;
+                }
+
+                $expected = &lt;&lt;&lt;EOF
+&lt;select name='user' id='user' class=''&gt;
+&lt;option value='1'&gt;{$this-&gt;author-&gt;display_name}&lt;/option&gt;
+&lt;option value='{$user[0]}'&gt;test-administrator&lt;/option&gt;
+&lt;option value='{$user[1]}'&gt;test-editor&lt;/option&gt;
+&lt;option value='{$user[2]}'&gt;test-author&lt;/option&gt;
+&lt;option value='{$user[3]}'&gt;test-contributor&lt;/option&gt;
+&lt;option value='{$user[4]}'&gt;test-subscriber&lt;/option&gt;
+&lt;/select&gt;
+EOF;
+
+                $out = wp_dropdown_users('echo=0&amp;orderby=ID');
+
+                $this-&gt;assertEquals(strip_ws($expected), strip_ws($out));
+        }
+}
+
+?&gt;
</ins><span class="cx">Property changes on: wp-testcase/test_user.php
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="wptestcasetest_user_capabilitiesphp"></a>
<div class="propset"><h4>Property changes: wp-testcase/test_user_capabilities.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
</div>

</body>
</html>