<!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>[51623] trunk/tests/phpunit/tests/formatting: Tests: Rename classes in `phpunit/tests/formatting/` per the naming conventions.</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 { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/51623">51623</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/51623","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-08-16 21:33:54 +0000 (Mon, 16 Aug 2021)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Tests: Rename classes in `phpunit/tests/formatting/` per the naming conventions.

https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to <a href="https://core.trac.wordpress.org/changeset/47780">[47780]</a>, <a href="https://core.trac.wordpress.org/changeset/48911">[48911]</a>, <a href="https://core.trac.wordpress.org/changeset/49327">[49327]</a>, <a href="https://core.trac.wordpress.org/changeset/50291">[50291]</a>, <a href="https://core.trac.wordpress.org/changeset/50292">[50292]</a>, <a href="https://core.trac.wordpress.org/changeset/50342">[50342]</a>, <a href="https://core.trac.wordpress.org/changeset/50452">[50452]</a>, <a href="https://core.trac.wordpress.org/changeset/50453">[50453]</a>, <a href="https://core.trac.wordpress.org/changeset/50456">[50456]</a>, <a href="https://core.trac.wordpress.org/changeset/50967">[50967]</a>, <a href="https://core.trac.wordpress.org/changeset/50968">[50968]</a>, <a href="https://core.trac.wordpress.org/changeset/50969">[50969]</a>, <a href="https://core.trac.wordpress.org/changeset/51491">[51491]</a>, <a href="https://core.trac.wordpress.org/changeset/51492">[514
 92]</a>, <a href="https://core.trac.wordpress.org/changeset/51493">[51493]</a>.

See <a href="https://core.trac.wordpress.org/ticket/53363">#53363</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestsformattingent2ncrphp">trunk/tests/phpunit/tests/formatting/ent2ncr.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestsformattingcapitalPDangitphp">trunk/tests/phpunit/tests/formatting/capitalPDangit.php</a></li>
<li><a href="#trunktestsphpunittestsformattingcleanPrephp">trunk/tests/phpunit/tests/formatting/cleanPre.php</a></li>
<li><a href="#trunktestsphpunittestsformattingconvertInvalidEntriesphp">trunk/tests/phpunit/tests/formatting/convertInvalidEntries.php</a></li>
<li><a href="#trunktestsphpunittestsformattingconvertSmiliesphp">trunk/tests/phpunit/tests/formatting/convertSmilies.php</a></li>
<li><a href="#trunktestsphpunittestsformattingemojiphp">trunk/tests/phpunit/tests/formatting/emoji.php</a></li>
<li><a href="#trunktestsphpunittestsformattingescAttrphp">trunk/tests/phpunit/tests/formatting/escAttr.php</a></li>
<li><a href="#trunktestsphpunittestsformattingescHtmlphp">trunk/tests/phpunit/tests/formatting/escHtml.php</a></li>
<li><a href="#trunktestsphpunittestsformattingescJsphp">trunk/tests/phpunit/tests/formatting/escJs.php</a></li>
<li><a href="#trunktestsphpunittestsformattingescTextareaphp">trunk/tests/phpunit/tests/formatting/escTextarea.php</a></li>
<li><a href="#trunktestsphpunittestsformattingescUrlphp">trunk/tests/phpunit/tests/formatting/escUrl.php</a></li>
<li><a href="#trunktestsphpunittestsformattingescXmlphp">trunk/tests/phpunit/tests/formatting/escXml.php</a></li>
<li><a href="#trunktestsphpunittestsformattingexcerptRemoveBlocksphp">trunk/tests/phpunit/tests/formatting/excerptRemoveBlocks.php</a></li>
<li><a href="#trunktestsphpunittestsformattinggetBloginfophp">trunk/tests/phpunit/tests/formatting/getBloginfo.php</a></li>
<li><a href="#trunktestsphpunittestsformattinggetUrlInContentphp">trunk/tests/phpunit/tests/formatting/getUrlInContent.php</a></li>
<li><a href="#trunktestsphpunittestsformattinghumanTimeDiffphp">trunk/tests/phpunit/tests/formatting/humanTimeDiff.php</a></li>
<li><a href="#trunktestsphpunittestsformattingisEmailphp">trunk/tests/phpunit/tests/formatting/isEmail.php</a></li>
<li><a href="#trunktestsphpunittestsformattinglikeEscapephp">trunk/tests/phpunit/tests/formatting/likeEscape.php</a></li>
<li><a href="#trunktestsphpunittestsformattinglinksAddTargetphp">trunk/tests/phpunit/tests/formatting/linksAddTarget.php</a></li>
<li><a href="#trunktestsphpunittestsformattingmakeClickablephp">trunk/tests/phpunit/tests/formatting/makeClickable.php</a></li>
<li><a href="#trunktestsphpunittestsformattingmapDeepphp">trunk/tests/phpunit/tests/formatting/mapDeep.php</a></li>
<li><a href="#trunktestsphpunittestsformattingnormalizeWhitespacephp">trunk/tests/phpunit/tests/formatting/normalizeWhitespace.php</a></li>
<li><a href="#trunktestsphpunittestsformattingremoveAccentsphp">trunk/tests/phpunit/tests/formatting/removeAccents.php</a></li>
<li><a href="#trunktestsphpunittestsformattingsanitizeFileNamephp">trunk/tests/phpunit/tests/formatting/sanitizeFileName.php</a></li>
<li><a href="#trunktestsphpunittestsformattingsanitizeMimeTypephp">trunk/tests/phpunit/tests/formatting/sanitizeMimeType.php</a></li>
<li><a href="#trunktestsphpunittestsformattingsanitizeOrderbyphp">trunk/tests/phpunit/tests/formatting/sanitizeOrderby.php</a></li>
<li><a href="#trunktestsphpunittestsformattingsanitizePostphp">trunk/tests/phpunit/tests/formatting/sanitizePost.php</a></li>
<li><a href="#trunktestsphpunittestsformattingsanitizeTextFieldphp">trunk/tests/phpunit/tests/formatting/sanitizeTextField.php</a></li>
<li><a href="#trunktestsphpunittestsformattingsanitizeTitlephp">trunk/tests/phpunit/tests/formatting/sanitizeTitle.php</a></li>
<li><a href="#trunktestsphpunittestsformattingsanitizeTitleWithDashesphp">trunk/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php</a></li>
<li><a href="#trunktestsphpunittestsformattingsanitizeTrackbackUrlsphp">trunk/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php</a></li>
<li><a href="#trunktestsphpunittestsformattingsanitizeUserphp">trunk/tests/phpunit/tests/formatting/sanitizeUser.php</a></li>
<li><a href="#trunktestsphpunittestsformattingseemsUtf8php">trunk/tests/phpunit/tests/formatting/seemsUtf8.php</a></li>
<li><a href="#trunktestsphpunittestsformattingslashitphp">trunk/tests/phpunit/tests/formatting/slashit.php</a></li>
<li><a href="#trunktestsphpunittestsformattingstripslashesDeepphp">trunk/tests/phpunit/tests/formatting/stripslashesDeep.php</a></li>
<li><a href="#trunktestsphpunittestsformattingurlShortenphp">trunk/tests/phpunit/tests/formatting/urlShorten.php</a></li>
<li><a href="#trunktestsphpunittestsformattingurlencodeDeepphp">trunk/tests/phpunit/tests/formatting/urlencodeDeep.php</a></li>
<li><a href="#trunktestsphpunittestsformattingutf8UriEncodephp">trunk/tests/phpunit/tests/formatting/utf8UriEncode.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpAutopphp">trunk/tests/phpunit/tests/formatting/wpAutop.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpBasenamephp">trunk/tests/phpunit/tests/formatting/wpBasename.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpHtmlExcerptphp">trunk/tests/phpunit/tests/formatting/wpHtmlExcerpt.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpHtmlSplitphp">trunk/tests/phpunit/tests/formatting/wpHtmlSplit.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpHtmleditPrephp">trunk/tests/phpunit/tests/formatting/wpHtmleditPre.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpIsoDescramblerphp">trunk/tests/phpunit/tests/formatting/wpIsoDescrambler.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpMakeLinkRelativephp">trunk/tests/phpunit/tests/formatting/wpMakeLinkRelative.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpRelNofollowphp">trunk/tests/phpunit/tests/formatting/wpRelNofollow.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpRelUgcphp">trunk/tests/phpunit/tests/formatting/wpRelUgc.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpReplaceInHtmlTagsphp">trunk/tests/phpunit/tests/formatting/wpReplaceInHtmlTags.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpRicheditPrephp">trunk/tests/phpunit/tests/formatting/wpRicheditPre.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpSlashphp">trunk/tests/phpunit/tests/formatting/wpSlash.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpSpecialcharsphp">trunk/tests/phpunit/tests/formatting/wpSpecialchars.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpStripAllTagsphp">trunk/tests/phpunit/tests/formatting/wpStripAllTags.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpTargetedLinkRelphp">trunk/tests/phpunit/tests/formatting/wpTargetedLinkRel.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpTexturizephp">trunk/tests/phpunit/tests/formatting/wpTexturize.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpTrimExcerptphp">trunk/tests/phpunit/tests/formatting/wpTrimExcerpt.php</a></li>
<li><a href="#trunktestsphpunittestsformattingwpTrimWordsphp">trunk/tests/phpunit/tests/formatting/wpTrimWords.php</a></li>
<li><a href="#trunktestsphpunittestsformattingzeroisephp">trunk/tests/phpunit/tests/formatting/zeroise.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestsformattingAutopphp">trunk/tests/phpunit/tests/formatting/Autop.php</a></li>
<li><a href="#trunktestsphpunittestsformattingBlogInfophp">trunk/tests/phpunit/tests/formatting/BlogInfo.php</a></li>
<li><a href="#trunktestsphpunittestsformattingCapitalPDangitphp">trunk/tests/phpunit/tests/formatting/CapitalPDangit.php</a></li>
<li><a href="#trunktestsphpunittestsformattingCleanPrephp">trunk/tests/phpunit/tests/formatting/CleanPre.php</a></li>
<li><a href="#trunktestsphpunittestsformattingConvertInvalidEntriesphp">trunk/tests/phpunit/tests/formatting/ConvertInvalidEntries.php</a></li>
<li><a href="#trunktestsphpunittestsformattingEmojiphp">trunk/tests/phpunit/tests/formatting/Emoji.php</a></li>
<li><a href="#trunktestsphpunittestsformattingEscAttrphp">trunk/tests/phpunit/tests/formatting/EscAttr.php</a></li>
<li><a href="#trunktestsphpunittestsformattingEscHtmlphp">trunk/tests/phpunit/tests/formatting/EscHtml.php</a></li>
<li><a href="#trunktestsphpunittestsformattingEscTextareaphp">trunk/tests/phpunit/tests/formatting/EscTextarea.php</a></li>
<li><a href="#trunktestsphpunittestsformattingEscUrlphp">trunk/tests/phpunit/tests/formatting/EscUrl.php</a></li>
<li><a href="#trunktestsphpunittestsformattingEscXmlphp">trunk/tests/phpunit/tests/formatting/EscXml.php</a></li>
<li><a href="#trunktestsphpunittestsformattingExcerptRemoveBlocksphp">trunk/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php</a></li>
<li><a href="#trunktestsphpunittestsformattingGetUrlInContentphp">trunk/tests/phpunit/tests/formatting/GetUrlInContent.php</a></li>
<li><a href="#trunktestsphpunittestsformattingHtmlExcerptphp">trunk/tests/phpunit/tests/formatting/HtmlExcerpt.php</a></li>
<li><a href="#trunktestsphpunittestsformattingHumanTimeDiffphp">trunk/tests/phpunit/tests/formatting/HumanTimeDiff.php</a></li>
<li><a href="#trunktestsphpunittestsformattingIsEmailphp">trunk/tests/phpunit/tests/formatting/IsEmail.php</a></li>
<li><a href="#trunktestsphpunittestsformattingJSEscapephp">trunk/tests/phpunit/tests/formatting/JSEscape.php</a></li>
<li><a href="#trunktestsphpunittestsformattingLikeEscapephp">trunk/tests/phpunit/tests/formatting/LikeEscape.php</a></li>
<li><a href="#trunktestsphpunittestsformattingLinksAddTargetphp">trunk/tests/phpunit/tests/formatting/LinksAddTarget.php</a></li>
<li><a href="#trunktestsphpunittestsformattingMakeClickablephp">trunk/tests/phpunit/tests/formatting/MakeClickable.php</a></li>
<li><a href="#trunktestsphpunittestsformattingMapDeepphp">trunk/tests/phpunit/tests/formatting/MapDeep.php</a></li>
<li><a href="#trunktestsphpunittestsformattingNormalizeWhitespacephp">trunk/tests/phpunit/tests/formatting/NormalizeWhitespace.php</a></li>
<li><a href="#trunktestsphpunittestsformattingRemoveAccentsphp">trunk/tests/phpunit/tests/formatting/RemoveAccents.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSanitizeFileNamephp">trunk/tests/phpunit/tests/formatting/SanitizeFileName.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSanitizeMimeTypephp">trunk/tests/phpunit/tests/formatting/SanitizeMimeType.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSanitizeOrderbyphp">trunk/tests/phpunit/tests/formatting/SanitizeOrderby.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSanitizePostphp">trunk/tests/phpunit/tests/formatting/SanitizePost.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSanitizeTextFieldphp">trunk/tests/phpunit/tests/formatting/SanitizeTextField.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSanitizeTitlephp">trunk/tests/phpunit/tests/formatting/SanitizeTitle.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSanitizeTitleWithDashesphp">trunk/tests/phpunit/tests/formatting/SanitizeTitleWithDashes.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSanitizeTrackbackUrlsphp">trunk/tests/phpunit/tests/formatting/SanitizeTrackbackUrls.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSanitizeUserphp">trunk/tests/phpunit/tests/formatting/SanitizeUser.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSeemsUtf8php">trunk/tests/phpunit/tests/formatting/SeemsUtf8.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSlashitphp">trunk/tests/phpunit/tests/formatting/Slashit.php</a></li>
<li><a href="#trunktestsphpunittestsformattingSmiliesphp">trunk/tests/phpunit/tests/formatting/Smilies.php</a></li>
<li><a href="#trunktestsphpunittestsformattingStripSlashesDeepphp">trunk/tests/phpunit/tests/formatting/StripSlashesDeep.php</a></li>
<li><a href="#trunktestsphpunittestsformattingURLShortenphp">trunk/tests/phpunit/tests/formatting/URLShorten.php</a></li>
<li><a href="#trunktestsphpunittestsformattingUrlencodeDeepphp">trunk/tests/phpunit/tests/formatting/UrlencodeDeep.php</a></li>
<li><a href="#trunktestsphpunittestsformattingUtf8UriEncodephp">trunk/tests/phpunit/tests/formatting/Utf8UriEncode.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWPBasenamephp">trunk/tests/phpunit/tests/formatting/WPBasename.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWPMakeLinkRelativephp">trunk/tests/phpunit/tests/formatting/WPMakeLinkRelative.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWPRelNoFollowphp">trunk/tests/phpunit/tests/formatting/WPRelNoFollow.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWPRelUgcphp">trunk/tests/phpunit/tests/formatting/WPRelUgc.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWPSlashphp">trunk/tests/phpunit/tests/formatting/WPSlash.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWPSpecialcharsphp">trunk/tests/phpunit/tests/formatting/WPSpecialchars.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWPStripAllTagsphp">trunk/tests/phpunit/tests/formatting/WPStripAllTags.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWPTargetedLinkRelphp">trunk/tests/phpunit/tests/formatting/WPTargetedLinkRel.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWPTexturizephp">trunk/tests/phpunit/tests/formatting/WPTexturize.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWPTrimWordsphp">trunk/tests/phpunit/tests/formatting/WPTrimWords.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWpHtmlEditPrephp">trunk/tests/phpunit/tests/formatting/WpHtmlEditPre.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWpHtmlSplitphp">trunk/tests/phpunit/tests/formatting/WpHtmlSplit.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWpReplaceInHtmlTagsphp">trunk/tests/phpunit/tests/formatting/WpReplaceInHtmlTags.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWpRichEditPrephp">trunk/tests/phpunit/tests/formatting/WpRichEditPre.php</a></li>
<li><a href="#trunktestsphpunittestsformattingWpTrimExcerptphp">trunk/tests/phpunit/tests/formatting/WpTrimExcerpt.php</a></li>
<li><a href="#trunktestsphpunittestsformattingZeroisephp">trunk/tests/phpunit/tests/formatting/Zeroise.php</a></li>
<li><a href="#trunktestsphpunittestsformattingisoDescramblerphp">trunk/tests/phpunit/tests/formatting/isoDescrambler.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunittestsformattingAutopphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/Autop.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/Autop.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/Autop.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,608 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_Autop extends WP_UnitTestCase {
-
-       /**
-        * @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; 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; 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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( "<p>$str</p>", trim( wpautop( $str ) ) );
-       }
-
-       /**
-        * wpautop() Should not add <p> and <br/> around <source> and <track>
-        *
-        * @ticket 26864
-        */
-       public function test_source_track_elements() {
-               $content = "Paragraph one.\n\n" .
-                       '<video class="wp-video-shortcode" id="video-0-1" width="640" height="360" preload="metadata" controls="controls">
-                               <source type="video/mp4" src="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4" />
-                               <!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
-                               <source type="video/webm" src="myvideo.webm" />
-                               <!-- Ogg/Vorbis for older Firefox and Opera versions -->
-                               <source type="video/ogg" src="myvideo.ogv" />
-                               <!-- Optional: Add subtitles for each language -->
-                               <track kind="subtitles" src="subtitles.srt" srclang="en" />
-                               <!-- Optional: Add chapters -->
-                               <track kind="chapters" src="chapters.srt" srclang="en" />
-                               <a href="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4">http://domain.tld/wp-content/uploads/2013/12/xyz.mp4</a>
-                       </video>' .
-                       "\n\nParagraph two.";
-
-               $content2 = "Paragraph one.\n\n" .
-                       '<video class="wp-video-shortcode" id="video-0-1" width="640" height="360" preload="metadata" controls="controls">
-
-                       <source type="video/mp4" src="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4" />
-
-                       <!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
-                       <source type="video/webm" src="myvideo.webm" />
-
-                       <!-- Ogg/Vorbis for older Firefox and Opera versions -->
-                       <source type="video/ogg" src="myvideo.ogv" />
-
-                       <!-- Optional: Add subtitles for each language -->
-                       <track kind="subtitles" src="subtitles.srt" srclang="en" />
-
-                       <!-- Optional: Add chapters -->
-                       <track kind="chapters" src="chapters.srt" srclang="en" />
-
-                       <a href="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4">http://domain.tld/wp-content/uploads/2013/12/xyz.mp4</a>
-
-                       </video>' .
-                       "\n\nParagraph two.";
-
-               $expected = "<p>Paragraph one.</p>\n" . // Line breaks only after <p>.
-                       '<p><video class="wp-video-shortcode" id="video-0-1" width="640" height="360" preload="metadata" controls="controls">' .
-                       '<source type="video/mp4" src="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4" />' .
-                       '<!-- WebM/VP8 for Firefox4, Opera, and Chrome -->' .
-                       '<source type="video/webm" src="myvideo.webm" />' .
-                       '<!-- Ogg/Vorbis for older Firefox and Opera versions -->' .
-                       '<source type="video/ogg" src="myvideo.ogv" />' .
-                       '<!-- Optional: Add subtitles for each language -->' .
-                       '<track kind="subtitles" src="subtitles.srt" srclang="en" />' .
-                       '<!-- Optional: Add chapters -->' .
-                       '<track kind="chapters" src="chapters.srt" srclang="en" />' .
-                       '<a href="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4">' .
-                       "http://domain.tld/wp-content/uploads/2013/12/xyz.mp4</a></video></p>\n" .
-                       '<p>Paragraph two.</p>';
-
-               // When running the content through wpautop() from wp_richedit_pre().
-               $shortcode_content = "Paragraph one.\n\n" .
-                       '[video width="720" height="480" mp4="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4"]
-                       <!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
-                       <source type="video/webm" src="myvideo.webm" />
-                       <!-- Ogg/Vorbis for older Firefox and Opera versions -->
-                       <source type="video/ogg" src="myvideo.ogv" />
-                       <!-- Optional: Add subtitles for each language -->
-                       <track kind="subtitles" src="subtitles.srt" srclang="en" />
-                       <!-- Optional: Add chapters -->
-                       <track kind="chapters" src="chapters.srt" srclang="en" />
-                       [/video]' .
-                       "\n\nParagraph two.";
-
-               $shortcode_expected = "<p>Paragraph one.</p>\n" . // Line breaks only after <p>.
-                       '<p>[video width="720" height="480" mp4="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4"]' .
-                       '<!-- WebM/VP8 for Firefox4, Opera, and Chrome --><source type="video/webm" src="myvideo.webm" />' .
-                       '<!-- Ogg/Vorbis for older Firefox and Opera versions --><source type="video/ogg" src="myvideo.ogv" />' .
-                       '<!-- Optional: Add subtitles for each language --><track kind="subtitles" src="subtitles.srt" srclang="en" />' .
-                       '<!-- Optional: Add chapters --><track kind="chapters" src="chapters.srt" srclang="en" />' .
-                       "[/video]</p>\n" .
-                       '<p>Paragraph two.</p>';
-
-               $this->assertSame( $expected, trim( wpautop( $content ) ) );
-               $this->assertSame( $expected, trim( wpautop( $content2 ) ) );
-               $this->assertSame( $shortcode_expected, trim( wpautop( $shortcode_content ) ) );
-       }
-
-       /**
-        * wpautop() Should not add <p> and <br/> around <param> and <embed>
-        *
-        * @ticket 26864
-        */
-       public function test_param_embed_elements() {
-               $content1 = '
-Paragraph one.
-
-<object width="400" height="224" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
-       <param name="src" value="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" />
-       <param name="allowfullscreen" value="true" />
-       <param name="allowscriptaccess" value="always" />
-       <param name="overstretch" value="true" />
-       <param name="flashvars" value="isDynamicSeeking=true" />
-
-       <embed width="400" height="224" type="application/x-shockwave-flash" src="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" wmode="direct" seamlesstabbing="true" allowfullscreen="true" overstretch="true" flashvars="isDynamicSeeking=true" />
-</object>
-
-Paragraph two.';
-
-               $expected1 = "<p>Paragraph one.</p>\n" . // Line breaks only after <p>.
-                       '<p><object width="400" height="224" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">' .
-                       '<param name="src" value="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" />' .
-                       '<param name="allowfullscreen" value="true" />' .
-                       '<param name="allowscriptaccess" value="always" />' .
-                       '<param name="overstretch" value="true" />' .
-                       '<param name="flashvars" value="isDynamicSeeking=true" />' .
-                       '<embed width="400" height="224" type="application/x-shockwave-flash" src="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" wmode="direct" seamlesstabbing="true" allowfullscreen="true" overstretch="true" flashvars="isDynamicSeeking=true" />' .
-                       "</object></p>\n" .
-                       '<p>Paragraph two.</p>';
-
-               $content2 = '
-Paragraph one.
-
-<div class="video-player" id="x-video-0">
-<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="640" height="360" id="video-0" standby="Standby text">
-  <param name="movie" value="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" />
-  <param name="quality" value="best" />
-
-  <param name="seamlesstabbing" value="true" />
-  <param name="allowfullscreen" value="true" />
-  <param name="allowscriptaccess" value="always" />
-  <param name="overstretch" value="true" />
-
-  <!--[if !IE]--><object type="application/x-shockwave-flash" data="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" width="640" height="360" standby="Standby text">
-    <param name="quality" value="best" />
-
-    <param name="seamlesstabbing" value="true" />
-    <param name="allowfullscreen" value="true" />
-    <param name="allowscriptaccess" value="always" />
-    <param name="overstretch" value="true" />
-  </object><!--<![endif]-->
-</object></div>
-
-Paragraph two.';
-
-               $expected2 = "<p>Paragraph one.</p>\n" . // Line breaks only after block tags.
-                       '<div class="video-player" id="x-video-0">' . "\n" .
-                       '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="640" height="360" id="video-0" standby="Standby text">' .
-                       '<param name="movie" value="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" />' .
-                       '<param name="quality" value="best" />' .
-                       '<param name="seamlesstabbing" value="true" />' .
-                       '<param name="allowfullscreen" value="true" />' .
-                       '<param name="allowscriptaccess" value="always" />' .
-                       '<param name="overstretch" value="true" />' .
-                       '<!--[if !IE]--><object type="application/x-shockwave-flash" data="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" width="640" height="360" standby="Standby text">' .
-                       '<param name="quality" value="best" />' .
-                       '<param name="seamlesstabbing" value="true" />' .
-                       '<param name="allowfullscreen" value="true" />' .
-                       '<param name="allowscriptaccess" value="always" />' .
-                       '<param name="overstretch" value="true" /></object><!--<![endif]-->' .
-                       "</object></div>\n" .
-                       '<p>Paragraph two.</p>';
-
-               $this->assertSame( $expected1, trim( wpautop( $content1 ) ) );
-               $this->assertSame( $expected2, trim( wpautop( $content2 ) ) );
-       }
-
-       /**
-        * wpautop() Should not add <br/> to "<select>" or "<option>" elements
-        *
-        * @ticket 22230
-        */
-       public function test_skip_select_option_elements() {
-               $str = 'Country: <select id="state" name="state"><option value="1">Alabama</option><option value="2">Alaska</option><option value="3">Arizona</option><option value="4">Arkansas</option><option value="5">California</option></select>';
-               $this->assertSame( "<p>$str</p>", trim( wpautop( $str ) ) );
-       }
-
-       /**
-        * wpautop() should treat block level HTML elements as blocks.
-        *
-        * @ticket 27268
-        */
-       function test_that_wpautop_treats_block_level_elements_as_blocks() {
-               $blocks = array(
-                       'table',
-                       'thead',
-                       'tfoot',
-                       'caption',
-                       'col',
-                       'colgroup',
-                       'tbody',
-                       'tr',
-                       'td',
-                       'th',
-                       'div',
-                       'dl',
-                       'dd',
-                       'dt',
-                       'ul',
-                       'ol',
-                       'li',
-                       'pre',
-                       'form',
-                       'map',
-                       'area',
-                       'address',
-                       'math',
-                       'style',
-                       'p',
-                       'h1',
-                       'h2',
-                       'h3',
-                       'h4',
-                       'h5',
-                       'h6',
-                       'fieldset',
-                       'legend',
-                       'section',
-                       'article',
-                       'aside',
-                       'hgroup',
-                       'header',
-                       'footer',
-                       'nav',
-                       'figure',
-                       'details',
-                       'menu',
-                       'summary',
-               );
-
-               // Check whitespace normalization.
-               $content = array();
-
-               foreach ( $blocks as $block ) {
-                       $content[] = "<$block>foo</$block>";
-               }
-
-               $expected = implode( "\n", $content );
-               $input    = implode( "\n\n", $content ); // Whitespace difference.
-
-               $this->assertSame( $expected, trim( wpautop( $input ) ) );
-
-               $input = implode( '', $content ); // Whitespace difference.
-
-               $this->assertSame( $expected, trim( wpautop( $input ) ) );
-
-               // Check whitespace addition.
-               $content = array();
-
-               foreach ( $blocks as $block ) {
-                       $content[] = "<$block/>";
-               }
-
-               $expected = implode( "\n", $content );
-               $input    = implode( '', $content );
-
-               $this->assertSame( $expected, trim( wpautop( $input ) ) );
-
-               // Check whitespace addition with attributes.
-               $content = array();
-
-               foreach ( $blocks as $block ) {
-                       $content[] = "<$block attr='value'>foo</$block>";
-               }
-
-               $expected = implode( "\n", $content );
-               $input    = implode( '', $content );
-
-               $this->assertSame( $expected, trim( wpautop( $input ) ) );
-       }
-
-       /**
-        * wpautop() should autop a blockquote's contents but not the blockquote itself
-        *
-        * @ticket 27268
-        */
-       function test_that_wpautop_does_not_wrap_blockquotes_but_does_autop_their_contents() {
-               $content  = '<blockquote>foo</blockquote>';
-               $expected = '<blockquote><p>foo</p></blockquote>';
-
-               $this->assertSame( $expected, trim( wpautop( $content ) ) );
-       }
-
-       /**
-        * wpautop() should treat inline HTML elements as inline.
-        *
-        * @ticket 27268
-        */
-       function test_that_wpautop_treats_inline_elements_as_inline() {
-               $inlines = array(
-                       'a',
-                       'em',
-                       'strong',
-                       'small',
-                       's',
-                       'cite',
-                       'q',
-                       'dfn',
-                       'abbr',
-                       'data',
-                       'time',
-                       'code',
-                       'var',
-                       'samp',
-                       'kbd',
-                       'sub',
-                       'sup',
-                       'i',
-                       'b',
-                       'u',
-                       'mark',
-                       'span',
-                       'del',
-                       'ins',
-                       'noscript',
-                       'select',
-               );
-
-               $content  = array();
-               $expected = array();
-
-               foreach ( $inlines as $inline ) {
-                       $content[]  = "<$inline>foo</$inline>";
-                       $expected[] = "<p><$inline>foo</$inline></p>";
-               }
-
-               $content  = implode( "\n\n", $content );
-               $expected = implode( "\n", $expected );
-
-               $this->assertSame( $expected, trim( wpautop( $content ) ) );
-       }
-
-       /**
-        * Do not allow newlines within HTML elements to become mangled.
-        *
-        * @ticket 33106
-        * @dataProvider data_element_sanity
-        */
-       function test_element_sanity( $input, $output ) {
-               return $this->assertSame( $output, wpautop( $input ) );
-       }
-
-       function data_element_sanity() {
-               return array(
-                       array(
-                               "Hello <a\nhref='world'>",
-                               "<p>Hello <a\nhref='world'></p>\n",
-                       ),
-                       array(
-                               "Hello <!-- a\nhref='world' -->",
-                               "<p>Hello <!-- a\nhref='world' --></p>\n",
-                       ),
-                       array(
-                               "Hello <!-- <object>\n<param>\n<param>\n<embed>\n</embed>\n</object>\n -->",
-                               "<p>Hello <!-- <object>\n<param>\n<param>\n<embed>\n</embed>\n</object>\n --></p>\n",
-                       ),
-                       array(
-                               "Hello <!-- <object>\n<param/>\n<param/>\n<embed>\n</embed>\n</object>\n -->",
-                               "<p>Hello <!-- <object>\n<param/>\n<param/>\n<embed>\n</embed>\n</object>\n --></p>\n",
-                       ),
-                       /* Block elements inside comments will fail this test in all versions, it's not a regression.
-                               array(
-                                       "Hello <!-- <hr> a\nhref='world' -->",
-                                       "<p>Hello <!-- <hr> a\nhref='world' --></p>\n",
-                               ),
-                               array(
-                                       "Hello <![CDATA[ <hr> a\nhttps://youtu.be/jgz0uSaOZbE\n ]]>",
-                                       "<p>Hello <![CDATA[ <hr> a\nhttps://youtu.be/jgz0uSaOZbE\n ]]></p>\n",
-                               ),
-                       */
-                               array(
-                                       "Hello <![CDATA[ a\nhttps://youtu.be/jgz0uSaOZbE\n ]]>",
-                                       "<p>Hello <![CDATA[ a\nhttps://youtu.be/jgz0uSaOZbE\n ]]></p>\n",
-                               ),
-                       array(
-                               "Hello <![CDATA[ <!-- a\nhttps://youtu.be/jgz0uSaOZbE\n a\n9 ]]> -->",
-                               "<p>Hello <![CDATA[ <!-- a\nhttps://youtu.be/jgz0uSaOZbE\n a\n9 ]]> --></p>\n",
-                       ),
-                       array(
-                               "Hello <![CDATA[ <!-- a\nhttps://youtu.be/jgz0uSaOZbE\n a\n9 --> a\n9 ]]>",
-                               "<p>Hello <![CDATA[ <!-- a\nhttps://youtu.be/jgz0uSaOZbE\n a\n9 --> a\n9 ]]></p>\n",
-                       ),
-               );
-       }
-
-       /**
-        * wpautop() should not convert line breaks after <br /> tags
-        *
-        * @ticket 33377
-        */
-       function test_that_wpautop_skips_line_breaks_after_br() {
-               $content = '
-line 1<br>
-line 2<br/>
-line 3<br />
-line 4
-line 5
-';
-
-               $expected = '<p>line 1<br />
-line 2<br />
-line 3<br />
-line 4<br />
-line 5</p>';
-
-               $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
-       }
-
-       /**
-        * wpautop() should convert multiple line breaks into a paragraph regarless of <br /> format
-        *
-        * @ticket 33377
-        */
-       function test_that_wpautop_adds_a_paragraph_after_multiple_br() {
-               $content = '
-line 1<br>
-<br/>
-line 2<br/>
-<br />
-';
-
-               $expected = '<p>line 1</p>
-<p>line 2</p>';
-
-               $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
-       }
-
-
-       /**
-        * @ticket 4857
-        */
-       function test_that_text_before_blocks_is_peed() {
-               $content  = 'a<div>b</div>';
-               $expected = "<p>a</p>\n<div>b</div>";
-
-               $this->assertSame( $expected, trim( wpautop( $content ) ) );
-       }
-
-       /**
-        * wpautop() should not add extra </p> before <figcaption>
-        *
-        * @covers ::wpautop
-        * @uses ::trim
-        *
-        * @ticket 39307
-        */
-       function test_that_wpautop_does_not_add_extra_closing_p_in_figure() {
-               $content1  = '<figure><img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
-               $expected1 = $content1;
-
-               $content2 = '<figure>
-<img src="example.jpg" />
-<figcaption>Caption</figcaption>
-</figure>';
-
-               $expected2 = '<figure>
-<img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
-
-               $this->assertSame( $expected1, trim( wpautop( $content1 ) ) );
-               $this->assertSameIgnoreEOL( $expected2, trim( wpautop( $content2 ) ) );
-       }
-
-       /**
-        * @ticket 14674
-        */
-       function test_the_hr_is_not_peed() {
-               $content  = 'paragraph1<hr>paragraph2';
-               $expected = "<p>paragraph1</p>\n<hr>\n<p>paragraph2</p>";
-
-               $this->assertSame( $expected, trim( wpautop( $content ) ) );
-       }
-
-       /**
-        * wpautop() should ignore inline SVG graphics
-        *
-        * @ticket 9437
-        */
-       function test_that_wpautop_ignores_inline_svgs() {
-               $content =
-                       '<svg xmlns="http://www.w3.org/2000/svg">
-                               <circle cx="50" cy="50" r="30" fill="blue">
-                                       <animateTransform attributeName="transform" type="scale" to="1.5" dur="2s" fill="freeze"/>
-                               </circle>
-                       </svg>';
-
-               $expected = '<p>' . $content . '</p>';
-
-               $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
-       }
-
-       /**
-        * wpautop() should ignore inline scripts
-        *
-        * @ticket 9437
-        */
-       function test_that_wpautop_ignores_inline_scripts() {
-               $content =
-                       '<script type="text/javascript">
-                               var dummy = 1;
-                       </script>';
-
-               $expected = '<p>' . $content . '</p>';
-
-               $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingBlogInfophp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/BlogInfo.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/BlogInfo.php 2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/BlogInfo.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,74 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_BlogInfo extends WP_UnitTestCase {
-
-       /**
-        * @dataProvider locales
-        * @ticket 28303
-        */
-       function test_get_bloginfo_language( $test_locale, $expected ) {
-               global $locale;
-
-               $old_locale = $locale;
-
-               $locale = $test_locale;
-               $this->assertSame( $expected, get_bloginfo( 'language' ) );
-
-               $locale = $old_locale;
-       }
-
-       function locales() {
-               return array(
-                       // Locale, language code.
-                       array( 'en_US', 'en-US' ),
-                       array( 'ar', 'ar' ),
-                       array( 'de_DE', 'de-DE' ),
-                       array( 'de_DE_formal', 'de-DE-formal' ),
-                       array( 'oci', 'oci' ),
-                       array( 'pt_PT_ao1990', 'pt-PT-ao1990' ),
-                       array( 'ja_JP', 'ja-JP' ),
-               );
-       }
-
-       /**
-        * @ticket 27942
-        */
-       function test_bloginfo_sanitize_option() {
-               $old_values = array(
-                       'blogname'        => get_option( 'blogname' ),
-                       'blogdescription' => get_option( 'blogdescription' ),
-               );
-
-               $values = array(
-                       'foo'                  => 'foo',
-                       '<em>foo</em>'         => '&lt;em&gt;foo&lt;/em&gt;',
-                       '<script>foo</script>' => '&lt;script&gt;foo&lt;/script&gt;',
-                       '&lt;foo&gt;'          => '&lt;foo&gt;',
-                       '<foo'                 => '&lt;foo',
-               );
-
-               foreach ( $values as $value => $expected ) {
-                       $sanitized_value = sanitize_option( 'blogname', $value );
-                       update_option( 'blogname', $sanitized_value );
-
-                       $this->assertSame( $expected, $sanitized_value );
-                       $this->assertSame( $expected, get_bloginfo( 'name' ) );
-                       $this->assertSame( $expected, get_bloginfo( 'name', 'display' ) );
-
-                       $sanitized_value = sanitize_option( 'blogdescription', $value );
-                       update_option( 'blogdescription', $sanitized_value );
-
-                       $this->assertSame( $expected, $sanitized_value );
-                       $this->assertSame( $expected, get_bloginfo( 'description' ) );
-                       $this->assertSame( $expected, get_bloginfo( 'description', 'display' ) );
-               }
-
-               // Restore old values.
-               foreach ( $old_values as $option_name => $value ) {
-                       update_option( $option_name, $value );
-               }
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingCapitalPDangitphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/CapitalPDangit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/CapitalPDangit.php   2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/CapitalPDangit.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,20 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-// phpcs:disable WordPress.WP.CapitalPDangit.Misspelled -- 🙃
-
-/**
- * @group formatting
- */
-class Tests_Formatting_CapitalPDangit extends WP_UnitTestCase {
-       function test_esc_attr_quotes() {
-               global $wp_current_filter;
-               $this->assertSame( 'Something about WordPress', capital_P_dangit( 'Something about Wordpress' ) );
-               $this->assertSame( 'Something about (WordPress', capital_P_dangit( 'Something about (Wordpress' ) );
-               $this->assertSame( 'Something about &#8216;WordPress', capital_P_dangit( 'Something about &#8216;Wordpress' ) );
-               $this->assertSame( 'Something about &#8220;WordPress', capital_P_dangit( 'Something about &#8220;Wordpress' ) );
-               $this->assertSame( 'Something about >WordPress', capital_P_dangit( 'Something about >Wordpress' ) );
-               $this->assertSame( 'Wordpress', capital_P_dangit( 'Wordpress' ) );
-
-               $wp_current_filter = array( 'the_title' );
-               $this->assertSame( 'WordPress', capital_P_dangit( 'Wordpress' ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingCleanPrephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/CleanPre.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/CleanPre.php 2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/CleanPre.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,40 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * The clean_pre() removes pararaph and line break
- * tags within `<pre>` elements as part of wpautop().
- *
- * @group formatting
- * @expectedDeprecated clean_pre
- */
-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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( $res, clean_pre( $source ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingConvertInvalidEntriesphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/ConvertInvalidEntries.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/ConvertInvalidEntries.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/ConvertInvalidEntries.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,25 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_ConvertInvalidEntities 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->assertSame( $output, convert_invalid_entities( $input ) );
-       }
-
-       /**
-        * @ticket 20503
-        */
-       function test_replaces_latin_letter_z_with_caron() {
-               $input  = '&#142;&#158;';
-               $output = '&#381;&#382;';
-               $this->assertSame( $output, convert_invalid_entities( $input ) );
-       }
-
-       function test_escapes_lone_ampersands() {
-               $this->assertSame( 'at&#038;t', convert_chars( 'at&t' ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingEmojiphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/Emoji.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/Emoji.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/Emoji.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,155 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @group emoji
- */
-class Tests_Formatting_Emoji extends WP_UnitTestCase {
-
-       private $png_cdn = 'https://s.w.org/images/core/emoji/13.1.0/72x72/';
-       private $svn_cdn = 'https://s.w.org/images/core/emoji/13.1.0/svg/';
-
-       /**
-        * @ticket 36525
-        */
-       public function test_unfiltered_emoji_cdns() {
-               // `_print_emoji_detection_script()` assumes `wp-includes/js/wp-emoji-loader.js` is present:
-               self::touch( ABSPATH . WPINC . '/js/wp-emoji-loader.js' );
-               $output = get_echo( '_print_emoji_detection_script' );
-
-               $this->assertStringContainsString( wp_json_encode( $this->png_cdn ), $output );
-               $this->assertStringContainsString( wp_json_encode( $this->svn_cdn ), $output );
-       }
-
-       public function _filtered_emoji_svn_cdn( $cdn = '' ) {
-               return 'https://s.wordpress.org/images/core/emoji/svg/';
-       }
-
-       /**
-        * @ticket 36525
-        */
-       public function test_filtered_emoji_svn_cdn() {
-               $filtered_svn_cdn = $this->_filtered_emoji_svn_cdn();
-
-               add_filter( 'emoji_svg_url', array( $this, '_filtered_emoji_svn_cdn' ) );
-
-               // `_print_emoji_detection_script()` assumes `wp-includes/js/wp-emoji-loader.js` is present:
-               self::touch( ABSPATH . WPINC . '/js/wp-emoji-loader.js' );
-               $output = get_echo( '_print_emoji_detection_script' );
-
-               $this->assertStringContainsString( wp_json_encode( $this->png_cdn ), $output );
-               $this->assertStringNotContainsString( wp_json_encode( $this->svn_cdn ), $output );
-               $this->assertStringContainsString( wp_json_encode( $filtered_svn_cdn ), $output );
-
-               remove_filter( 'emoji_svg_url', array( $this, '_filtered_emoji_svn_cdn' ) );
-       }
-
-       public function _filtered_emoji_png_cdn( $cdn = '' ) {
-               return 'https://s.wordpress.org/images/core/emoji/png_cdn/';
-       }
-
-       /**
-        * @ticket 36525
-        */
-       public function test_filtered_emoji_png_cdn() {
-               $filtered_png_cdn = $this->_filtered_emoji_png_cdn();
-
-               add_filter( 'emoji_url', array( $this, '_filtered_emoji_png_cdn' ) );
-
-               // `_print_emoji_detection_script()` assumes `wp-includes/js/wp-emoji-loader.js` is present:
-               self::touch( ABSPATH . WPINC . '/js/wp-emoji-loader.js' );
-               $output = get_echo( '_print_emoji_detection_script' );
-
-               $this->assertStringContainsString( wp_json_encode( $filtered_png_cdn ), $output );
-               $this->assertStringNotContainsString( wp_json_encode( $this->png_cdn ), $output );
-               $this->assertStringContainsString( wp_json_encode( $this->svn_cdn ), $output );
-
-               remove_filter( 'emoji_url', array( $this, '_filtered_emoji_png_cdn' ) );
-       }
-
-       /**
-        * @ticket 41501
-        */
-       public function test_wp_emoji_list_returns_data() {
-               $default = _wp_emoji_list();
-               $this->assertNotEmpty( $default );
-
-               $entities = _wp_emoji_list( 'entities' );
-               $this->assertNotEmpty( $entities );
-
-               $this->assertSame( $default, $entities );
-
-               $partials = _wp_emoji_list( 'partials' );
-               $this->assertNotEmpty( $partials );
-
-               $this->assertNotSame( $default, $partials );
-       }
-
-       public function data_wp_encode_emoji() {
-               return array(
-                       array(
-                               // Not emoji.
-                               '’',
-                               '’',
-                       ),
-                       array(
-                               // Simple emoji.
-                               '🙂',
-                               '&#x1f642;',
-                       ),
-                       array(
-                               // Skin tone, gender, ZWJ, emoji selector.
-                               '👮🏼‍♀️',
-                               '&#x1f46e;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;',
-                       ),
-                       array(
-                               // Unicode 10.
-                               '🧚',
-                               '&#x1f9da;',
-                       ),
-               );
-       }
-
-       /**
-        * @ticket 35293
-        * @dataProvider data_wp_encode_emoji
-        */
-       public function test_wp_encode_emoji( $emoji, $expected ) {
-               $this->assertSame( $expected, wp_encode_emoji( $emoji ) );
-       }
-
-       public function data_wp_staticize_emoji() {
-               $data = array(
-                       array(
-                               // Not emoji.
-                               '’',
-                               '’',
-                       ),
-                       array(
-                               // Simple emoji.
-                               '🙂',
-                               '<img src="' . $this->png_cdn . '1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
-                       ),
-                       array(
-                               // Skin tone, gender, ZWJ, emoji selector.
-                               '👮🏼‍♀️',
-                               '<img src="' . $this->png_cdn . '1f46e-1f3fc-200d-2640-fe0f.png" alt="👮🏼‍♀️" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
-                       ),
-                       array(
-                               // Unicode 10.
-                               '🧚',
-                               '<img src="' . $this->png_cdn . '1f9da.png" alt="🧚" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
-                       ),
-               );
-
-               return $data;
-       }
-
-       /**
-        * @ticket 35293
-        * @dataProvider data_wp_staticize_emoji
-        */
-       public function test_wp_staticize_emoji( $emoji, $expected ) {
-               $this->assertSame( $expected, wp_staticize_emoji( $emoji ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingEscAttrphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/EscAttr.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/EscAttr.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/EscAttr.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,32 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_EscAttr extends WP_UnitTestCase {
-       function test_esc_attr_quotes() {
-               $attr = '"double quotes"';
-               $this->assertSame( '&quot;double quotes&quot;', esc_attr( $attr ) );
-
-               $attr = "'single quotes'";
-               $this->assertSame( '&#039;single quotes&#039;', esc_attr( $attr ) );
-
-               $attr = "'mixed' " . '"quotes"';
-               $this->assertSame( '&#039;mixed&#039; &quot;quotes&quot;', esc_attr( $attr ) );
-
-               // Handles double encoding?
-               $attr = '"double quotes"';
-               $this->assertSame( '&quot;double quotes&quot;', esc_attr( esc_attr( $attr ) ) );
-
-               $attr = "'single quotes'";
-               $this->assertSame( '&#039;single quotes&#039;', esc_attr( esc_attr( $attr ) ) );
-
-               $attr = "'mixed' " . '"quotes"';
-               $this->assertSame( '&#039;mixed&#039; &quot;quotes&quot;', esc_attr( esc_attr( $attr ) ) );
-       }
-
-       function test_esc_attr_amp() {
-               $out = esc_attr( 'foo & bar &baz; &nbsp;' );
-               $this->assertSame( 'foo &amp; bar &amp;baz; &nbsp;', $out );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingEscHtmlphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/EscHtml.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/EscHtml.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/EscHtml.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,40 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_EscHtml extends WP_UnitTestCase {
-       function test_esc_html_basics() {
-               // Simple string.
-               $html = 'The quick brown fox.';
-               $this->assertSame( $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->assertSame( $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->assertSame( $escaped, esc_html( $html ) );
-       }
-
-       function test_escapes_ampersands() {
-               $source = 'penn & teller & at&t';
-               $res    = 'penn &amp; teller &amp; at&amp;t';
-               $this->assertSame( $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->assertSame( $res, esc_html( $source ) );
-       }
-
-       function test_ignores_existing_entities() {
-               $source = '&#038; &#x00A3; &#x22; &amp;';
-               $res    = '&#038; &#xA3; &#x22; &amp;';
-               $this->assertSame( $res, esc_html( $source ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingEscTextareaphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/EscTextarea.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/EscTextarea.php      2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/EscTextarea.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,36 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?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->assertSame( $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->assertSame( $utf8, esc_textarea( $utf8 ) );
-               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingEscUrlphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/EscUrl.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/EscUrl.php   2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/EscUrl.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,265 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_EscUrl extends WP_UnitTestCase {
-
-       /**
-        * @ticket 23605
-        */
-       function test_spaces() {
-               $this->assertSame( 'http://example.com/Mr%20WordPress', esc_url( 'http://example.com/Mr WordPress' ) );
-               $this->assertSame( 'http://example.com/Mr%20WordPress', esc_url( 'http://example.com/Mr%20WordPress' ) );
-               $this->assertSame( 'http://example.com/Mr%20%20WordPress', esc_url( 'http://example.com/Mr%20%20WordPress' ) );
-               $this->assertSame( 'http://example.com/Mr+WordPress', esc_url( 'http://example.com/Mr+WordPress' ) );
-               $this->assertSame( 'http://example.com/Mr+WordPress', esc_url( ' http://example.com/Mr+WordPress' ) );
-
-               $this->assertSame( 'http://example.com/?foo=one%20two%20three&#038;bar=four', esc_url( 'http://example.com/?foo=one two three&bar=four' ) );
-               $this->assertSame( 'http://example.com/?foo=one%20two%20three&#038;bar=four', esc_url( 'http://example.com/?foo=one%20two%20three&bar=four' ) );
-       }
-
-       function test_bad_characters() {
-               $this->assertSame( 'http://example.com/watchthelinefeedgo', esc_url( 'http://example.com/watchthelinefeed%0Ago' ) );
-               $this->assertSame( 'http://example.com/watchthelinefeedgo', esc_url( 'http://example.com/watchthelinefeed%0ago' ) );
-               $this->assertSame( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0Dgo' ) );
-               $this->assertSame( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0dgo' ) );
-               // Nesting checks.
-               $this->assertSame( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0%0ddgo' ) );
-               $this->assertSame( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0%0DDgo' ) );
-               $this->assertSame( 'http://example.com/', esc_url( 'http://example.com/%0%0%0DAD' ) );
-               $this->assertSame( 'http://example.com/', esc_url( 'http://example.com/%0%0%0ADA' ) );
-               $this->assertSame( 'http://example.com/', esc_url( 'http://example.com/%0%0%0DAd' ) );
-               $this->assertSame( 'http://example.com/', esc_url( 'http://example.com/%0%0%0ADa' ) );
-       }
-
-       function test_relative() {
-               $this->assertSame( '/example.php', esc_url( '/example.php' ) );
-               $this->assertSame( 'example.php', esc_url( 'example.php' ) );
-               $this->assertSame( '#fragment', esc_url( '#fragment' ) );
-               $this->assertSame( '?foo=bar', esc_url( '?foo=bar' ) );
-       }
-
-       function test_all_url_parts() {
-               $url = 'https://user:pass@host.example.com:1234/path;p=1?query=2&r[]=3#fragment';
-
-               $this->assertSame(
-                       array(
-                               'scheme'   => 'https',
-                               'host'     => 'host.example.com',
-                               'port'     => 1234,
-                               'user'     => 'user',
-                               'pass'     => 'pass',
-                               'path'     => '/path;p=1',
-                               'query'    => 'query=2&r[]=3',
-                               'fragment' => 'fragment',
-                       ),
-                       parse_url( $url )
-               );
-               $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', esc_url_raw( $url ) );
-               $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&#038;r%5B%5D=3#fragment', esc_url( $url ) );
-       }
-
-       function test_bare() {
-               $this->assertSame( 'http://example.com?foo', esc_url( 'example.com?foo' ) );
-               $this->assertSame( 'http://example.com', esc_url( 'example.com' ) );
-               $this->assertSame( 'http://localhost', esc_url( 'localhost' ) );
-               $this->assertSame( 'http://example.com/foo', esc_url( 'example.com/foo' ) );
-               $this->assertSame( 'http://баба.org/баба', esc_url( 'баба.org/баба' ) );
-       }
-
-       function test_encoding() {
-               $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );
-               $this->assertSame( 'http://example.com?foo=1&amp;bar=2', esc_url_raw( 'http://example.com?foo=1&amp;bar=2' ) );
-               $this->assertSame( 'http://example.com?foo=1&#038;bar=2', esc_url_raw( 'http://example.com?foo=1&#038;bar=2' ) );
-
-               $this->assertSame( 'http://example.com?foo=1&#038;bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) );
-               $this->assertSame( 'http://example.com?foo=1&#038;bar=2', esc_url( 'http://example.com?foo=1&amp;bar=2' ) );
-               $this->assertSame( 'http://example.com?foo=1&#038;bar=2', esc_url( 'http://example.com?foo=1&#038;bar=2' ) );
-
-               $param = urlencode( 'http://example.com/?one=1&two=2' );
-               $this->assertSame( "http://example.com?url={$param}", esc_url( "http://example.com?url={$param}" ) );
-       }
-
-       function test_protocol() {
-               $this->assertSame( 'http://example.com', esc_url( 'http://example.com' ) );
-               $this->assertSame( '', esc_url( 'nasty://example.com/' ) );
-               $this->assertSame(
-                       '',
-                       esc_url(
-                               'example.com',
-                               array(
-                                       'https',
-                               )
-                       )
-               );
-               $this->assertSame(
-                       '',
-                       esc_url(
-                               'http://example.com',
-                               array(
-                                       'https',
-                               )
-                       )
-               );
-               $this->assertSame(
-                       'https://example.com',
-                       esc_url(
-                               'https://example.com',
-                               array(
-                                       'http',
-                                       'https',
-                               )
-                       )
-               );
-
-               foreach ( wp_allowed_protocols() as $scheme ) {
-                       $this->assertSame( "{$scheme}://example.com", esc_url( "{$scheme}://example.com" ), $scheme );
-                       $this->assertSame(
-                               "{$scheme}://example.com",
-                               esc_url(
-                                       "{$scheme}://example.com",
-                                       array(
-                                               $scheme,
-                                       )
-                               ),
-                               $scheme
-                       );
-               }
-
-               $this->assertNotContains( 'data', wp_allowed_protocols() );
-               $this->assertSame( '', esc_url( 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D' ) );
-
-               $this->assertNotContains( 'foo', wp_allowed_protocols() );
-               $this->assertSame(
-                       'foo://example.com',
-                       esc_url(
-                               'foo://example.com',
-                               array(
-                                       'foo',
-                               )
-                       )
-               );
-
-       }
-
-       /**
-        * @ticket 23187
-        */
-       function test_protocol_case() {
-               $this->assertSame( 'http://example.com', esc_url( 'HTTP://example.com' ) );
-               $this->assertSame( 'http://example.com', esc_url( 'Http://example.com' ) );
-       }
-
-       function test_display_extras() {
-               $this->assertSame( 'http://example.com/&#039;quoted&#039;', esc_url( 'http://example.com/\'quoted\'' ) );
-               $this->assertSame( 'http://example.com/\'quoted\'', esc_url( 'http://example.com/\'quoted\'', null, 'notdisplay' ) );
-       }
-
-       function test_non_ascii() {
-               $this->assertSame( 'http://example.org/баба', esc_url( 'http://example.org/баба' ) );
-               $this->assertSame( 'http://баба.org/баба', esc_url( 'http://баба.org/баба' ) );
-               $this->assertSame( 'http://müller.com/', esc_url( 'http://müller.com/' ) );
-       }
-
-       function test_feed() {
-               $this->assertSame( '', esc_url( 'feed:javascript:alert(1)' ) );
-               $this->assertSame( '', esc_url( 'feed:javascript:feed:alert(1)' ) );
-               $this->assertSame( '', esc_url( 'feed:feed:javascript:alert(1)' ) );
-               $this->assertSame( 'feed:feed:alert(1)', esc_url( 'feed:feed:alert(1)' ) );
-               $this->assertSame( 'feed:http://wordpress.org/feed/', esc_url( 'feed:http://wordpress.org/feed/' ) );
-       }
-
-       /**
-        * @ticket 16859
-        */
-       function test_square_brackets() {
-               $this->assertSame( '/example.php?one%5B%5D=two', esc_url( '/example.php?one[]=two' ) );
-               $this->assertSame( '?foo%5Bbar%5D=baz', esc_url( '?foo[bar]=baz' ) );
-               $this->assertSame( '//example.com/?foo%5Bbar%5D=baz', esc_url( '//example.com/?foo[bar]=baz' ) );
-               $this->assertSame( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'example.com/?foo[bar]=baz' ) );
-               $this->assertSame( 'http://localhost?foo%5Bbar%5D=baz', esc_url( 'localhost?foo[bar]=baz' ) );
-               $this->assertSame( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'http://example.com/?foo[bar]=baz' ) );
-               $this->assertSame( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'http://example.com/?foo%5Bbar%5D=baz' ) );
-               $this->assertSame( 'http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&foo[bar]=baz' ) );
-               $this->assertSame( 'http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz' ) );
-       }
-
-       /**
-        * Courtesy of http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding
-        */
-       function test_reserved_characters() {
-               $url = "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$%27()*+,;=/?:@-._~!$%27()*+,;==#/?:@-._~!$&'()*+,;=";
-               $this->assertSame( $url, esc_url_raw( $url ) );
-       }
-
-       /**
-        * @ticket 21974
-        */
-       function test_protocol_relative_with_colon() {
-               $this->assertSame( '//example.com/foo?foo=abc:def', esc_url( '//example.com/foo?foo=abc:def' ) );
-       }
-
-       /**
-        * @ticket 31632
-        */
-       function test_mailto_with_newline() {
-               $body       = <<<EOT
-Hi there,
-
-I thought you might want to sign up for this newsletter
-EOT;
-               $body       = str_replace( "\r\n", "\n", $body );
-               $email_link = 'mailto:?body=' . rawurlencode( $body );
-               $email_link = esc_url( $email_link );
-               $this->assertSame( 'mailto:?body=Hi%20there%2C%0A%0AI%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
-       }
-
-       /**
-        * @ticket 31632
-        */
-       function test_mailto_in_http_url_with_newline() {
-               $body       = <<<EOT
-Hi there,
-
-I thought you might want to sign up for this newsletter
-EOT;
-               $body       = str_replace( "\r\n", "\n", $body );
-               $email_link = 'http://example.com/mailto:?body=' . rawurlencode( $body );
-               $email_link = esc_url( $email_link );
-               $this->assertSame( 'http://example.com/mailto:?body=Hi%20there%2CI%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
-       }
-
-       /**
-        * @ticket 23605
-        */
-       function test_mailto_with_spaces() {
-               $body = 'Hi there, I thought you might want to sign up for this newsletter';
-
-               $email_link = 'mailto:?body=' . $body;
-               $email_link = esc_url( $email_link );
-               $this->assertSame( 'mailto:?body=Hi%20there,%20I%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
-       }
-
-       /**
-        * @ticket 28015
-        */
-       function test_invalid_charaters() {
-               $this->assertEmpty( esc_url_raw( '"^<>{}`' ) );
-       }
-
-       /**
-        * @ticket 34202
-        */
-       function test_ipv6_hosts() {
-               $this->assertSame( '//[::127.0.0.1]', esc_url( '//[::127.0.0.1]' ) );
-               $this->assertSame( 'http://[::FFFF::127.0.0.1]', esc_url( 'http://[::FFFF::127.0.0.1]' ) );
-               $this->assertSame( 'http://[::127.0.0.1]', esc_url( 'http://[::127.0.0.1]' ) );
-               $this->assertSame( 'http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]', esc_url( 'http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]' ) );
-
-               // IPv6 with square brackets in the query? Why not.
-               $this->assertSame( '//[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url( '//[::FFFF::127.0.0.1]/?foo[bar]=baz' ) );
-               $this->assertSame( 'http://[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url( 'http://[::FFFF::127.0.0.1]/?foo[bar]=baz' ) );
-       }
-
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingEscXmlphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/EscXml.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/EscXml.php   2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/EscXml.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,135 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_EscXml extends WP_UnitTestCase {
-       /**
-        * Test basic escaping
-        *
-        * @dataProvider _test_esc_xml_basics_dataprovider
-        *
-        * @param string $source   The source string to be escaped.
-        * @param string $expected The expected escaped value of `$source`.
-        */
-       public function test_esc_xml_basics( $source, $expected ) {
-               $actual = esc_xml( $source );
-               $this->assertSame( $expected, $actual );
-       }
-
-       /**
-        * Data provider for `test_esc_xml_basics()`.
-        *
-        * @return array {
-        *     @type string $source   The source string to be escaped.
-        *     @type string $expected The expected escaped value of `$source`.
-        * }
-        */
-       public function _test_esc_xml_basics_dataprovider() {
-               return array(
-                       // Simple string.
-                       array(
-                               'The quick brown fox.',
-                               'The quick brown fox.',
-                       ),
-                       // URL with &.
-                       array(
-                               'http://localhost/trunk/wp-login.php?action=logout&_wpnonce=cd57d75985',
-                               'http://localhost/trunk/wp-login.php?action=logout&amp;_wpnonce=cd57d75985',
-                       ),
-                       // SQL query w/ single quotes.
-                       array(
-                               "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",
-                               'SELECT meta_key, meta_value FROM wp_trunk_sitemeta WHERE meta_key IN (&apos;site_name&apos;, &apos;siteurl&apos;, &apos;active_sitewide_plugins&apos;, &apos;_site_transient_timeout_theme_roots&apos;, &apos;_site_transient_theme_roots&apos;, &apos;site_admins&apos;, &apos;can_compress_scripts&apos;, &apos;global_terms_enabled&apos;) AND site_id = 1',
-                       ),
-               );
-       }
-
-       public function test_escapes_ampersands() {
-               $source   = 'penn & teller & at&t';
-               $expected = 'penn &amp; teller &amp; at&amp;t';
-               $actual   = esc_xml( $source );
-               $this->assertSame( $expected, $actual );
-       }
-
-       public function test_escapes_greater_and_less_than() {
-               $source   = 'this > that < that <randomhtml />';
-               $expected = 'this &gt; that &lt; that &lt;randomhtml /&gt;';
-               $actual   = esc_xml( $source );
-               $this->assertSame( $expected, $actual );
-       }
-
-       public function test_escapes_html_named_entities() {
-               $source   = 'this &amp; is a &hellip; followed by &rsaquo; and more and a &nonexistent; entity';
-               $expected = 'this &amp; is a … followed by › and more and a &amp;nonexistent; entity';
-               $actual   = esc_xml( $source );
-               $this->assertSame( $expected, $actual );
-       }
-
-       public function test_ignores_existing_entities() {
-               $source = '&#038; &#x00A3; &#x22; &amp;';
-               // note that _wp_specialchars() strips leading 0's from numeric character references.
-               $expected = '&#038; &#xA3; &#x22; &amp;';
-               $actual   = esc_xml( $source );
-               $this->assertSame( $expected, $actual );
-       }
-
-       /**
-        * Test that CDATA Sections are not escaped.
-        *
-        * @dataProvider _test_ignores_cdata_sections_dataprovider
-        *
-        * @param string $source   The source string to be escaped.
-        * @param string $expected The expected escaped value of `$source`.
-        */
-       public function test_ignores_cdata_sections( $source, $expected ) {
-               $actual = esc_xml( $source );
-               $this->assertSame( $expected, $actual );
-       }
-
-       /**
-        * Data provider for `test_ignores_cdata_sections()`.
-        *
-        * @return array {
-        *     @type string $source   The source string to be escaped.
-        *     @type string $expected The expected escaped value of `$source`.
-        * }
-        */
-       public function _test_ignores_cdata_sections_dataprovider() {
-               return array(
-                       // basic CDATA Section containing chars that would otherwise be escaped if not in a CDATA Section
-                       // not to mention the CDATA Section markup itself :-)
-                       // $source contains embedded newlines to test that the regex that ignores CDATA Sections
-                       // correctly handles that case.
-                       array(
-                               "This is\na<![CDATA[test of\nthe <emergency>]]>\nbroadcast system",
-                               "This is\na<![CDATA[test of\nthe <emergency>]]>\nbroadcast system",
-                       ),
-                       // string with chars that should be escaped as well as a CDATA Section that should be not be.
-                       array(
-                               'This is &hellip; a <![CDATA[test of the <emergency>]]> broadcast <system />',
-                               'This is … a <![CDATA[test of the <emergency>]]> broadcast &lt;system /&gt;',
-                       ),
-                       // Same as above, but with the CDATA Section at the start of the string.
-                       array(
-                               '<![CDATA[test of the <emergency>]]> This is &hellip; a broadcast <system />',
-                               '<![CDATA[test of the <emergency>]]> This is … a broadcast &lt;system /&gt;',
-                       ),
-                       // Same as above, but with the CDATA Section at the end of the string.
-                       array(
-                               'This is &hellip; a broadcast <system /><![CDATA[test of the <emergency>]]>',
-                               'This is … a broadcast &lt;system /&gt;<![CDATA[test of the <emergency>]]>',
-                       ),
-                       // Multiple CDATA Sections.
-                       array(
-                               'This is &hellip; a <![CDATA[test of the <emergency>]]> &broadcast; <![CDATA[<system />]]>',
-                               'This is … a <![CDATA[test of the <emergency>]]> &amp;broadcast; <![CDATA[<system />]]>',
-                       ),
-                       // Ensure that ']]>' that does not mark the end of a CDATA Section is escaped.
-                       array(
-                               '<![CDATA[<&]]>]]>',
-                               '<![CDATA[<&]]>]]&gt;',
-                       ),
-               );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingExcerptRemoveBlocksphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php      2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,129 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @covers ::excerpt_remove_blocks
- * @ticket 46133
- */
-class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase {
-
-       public static $post_id;
-
-       public $content = '
-<!-- wp:paragraph -->
-<p>paragraph</p>
-<!-- /wp:paragraph -->
-<!-- wp:latest-posts {"postsToShow":3,"displayPostDate":true,"order":"asc","orderBy":"title"} /-->
-<!-- wp:spacer -->
-<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
-<!-- /wp:spacer -->
-<!-- wp:columns {"columns":1} -->
-<div class="wp-block-columns has-1-columns">
-       <!-- wp:column -->
-       <div class="wp-block-column">
-               <!-- wp:archives {"displayAsDropdown":false,"showPostCounts":false} /-->
-               
-               <!-- wp:paragraph -->
-               <p>paragraph inside column</p>
-               <!-- /wp:paragraph -->
-       </div>
-       <!-- /wp:column -->
-</div>
-<!-- /wp:columns -->
-';
-
-       public $filtered_content = '
-
-<p>paragraph</p>
-
-
-
-
-               <p>paragraph inside column</p>
-               
-';
-
-       /**
-        * Fake block rendering function.
-        *
-        * @since 5.2.0
-        *
-        * @return string Block output.
-        */
-       function render_fake_block() {
-               return get_the_excerpt( self::$post_id );
-       }
-
-       /**
-        * Set up.
-        *
-        * @since 5.2.0
-        */
-       function set_up() {
-               parent::set_up();
-               self::$post_id = $this->factory()->post->create(
-                       array(
-                               'post_excerpt' => '', // Empty excerpt, so it has to be generated.
-                               'post_content' => '<!-- wp:core/fake /-->',
-                       )
-               );
-               register_block_type(
-                       'core/fake',
-                       array(
-                               'render_callback' => array( $this, 'render_fake_block' ),
-                       )
-               );
-       }
-
-       /**
-        * Tear down.
-        *
-        * @since 5.2.0
-        */
-       function tear_down() {
-               $registry = WP_Block_Type_Registry::get_instance();
-               $registry->unregister( 'core/fake' );
-
-               parent::tear_down();
-       }
-
-       /**
-        * Tests excerpt_remove_blocks().
-        *
-        * @ticket 46133
-        */
-       function test_excerpt_remove_blocks() {
-               // Simple dynamic block..
-               $content = '<!-- wp:core/block /-->';
-
-               $this->assertEmpty( excerpt_remove_blocks( $content ) );
-
-               // Dynamic block with options, embedded in other content.
-               $this->assertSame( $this->filtered_content, excerpt_remove_blocks( $this->content ) );
-       }
-
-       /**
-        * Tests that dynamic blocks don't cause an out-of-memory error.
-        *
-        * When dynamic blocks happen to generate an excerpt, they can cause an
-        * infinite loop if that block is part of the post's content.
-        *
-        * `wp_trim_excerpt()` applies the `the_content` filter, which has
-        * `do_blocks` attached to it, trying to render the block which again will
-        * attempt to return an excerpt of that post.
-        *
-        * This infinite loop can be avoided by stripping dynamic blocks before
-        * `the_content` gets applied, just like shortcodes.
-        *
-        * @ticket 46133
-        */
-       function test_excerpt_infinite_loop() {
-               $query = new WP_Query(
-                       array(
-                               'post__in' => array( self::$post_id ),
-                       )
-               );
-               $query->the_post();
-               $this->assertEmpty( do_blocks( '<!-- wp:core/fake /-->' ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingGetUrlInContentphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/GetUrlInContent.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/GetUrlInContent.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/GetUrlInContent.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,50 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_GetUrlInContent extends WP_UnitTestCase {
-
-       /**
-        * URL Content Data Provider
-        *
-        * array ( input_txt, converted_output_txt )
-        */
-       public function get_input_output() {
-               return array(
-                       array( // Empty content.
-                               '',
-                               false,
-                       ),
-                       array( // No URLs.
-                               '<div>NO URL CONTENT</div>',
-                               false,
-                       ),
-                       array( // Ignore none link elements.
-                               '<div href="/relative.php">NO URL CONTENT</div>',
-                               false,
-                       ),
-                       array( // Single link.
-                               'ABC<div><a href="/relative.php">LINK</a> CONTENT</div>',
-                               '/relative.php',
-                       ),
-                       array( // Multiple links.
-                               'ABC<div><a href="/relative.php">LINK</a> CONTENT <a href="/suppress.php">LINK</a></div>',
-                               '/relative.php',
-                       ),
-                       array( // Escape link.
-                               'ABC<div><a href="http://example.com/Mr%20WordPress 2">LINK</a> CONTENT </div>',
-                               'http://example.com/Mr%20WordPress%202',
-                       ),
-               );
-       }
-
-       /**
-        * Validate the get_url_in_content function
-        *
-        * @dataProvider get_input_output
-        */
-       function test_get_url_in_content( $in_str, $exp_str ) {
-               $this->assertSame( $exp_str, get_url_in_content( $in_str ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingHtmlExcerptphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/HtmlExcerpt.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/HtmlExcerpt.php      2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/HtmlExcerpt.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,19 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_HtmlExcerpt extends WP_UnitTestCase {
-       function test_simple() {
-               $this->assertSame( 'Baba', wp_html_excerpt( 'Baba told me not to come', 4 ) );
-       }
-       function test_html() {
-               $this->assertSame( 'Baba', wp_html_excerpt( "<a href='http://baba.net/'>Baba</a> told me not to come", 4 ) );
-       }
-       function test_entities() {
-               $this->assertSame( 'Baba', wp_html_excerpt( 'Baba &amp; Dyado', 8 ) );
-               $this->assertSame( 'Baba', wp_html_excerpt( 'Baba &#038; Dyado', 8 ) );
-               $this->assertSame( 'Baba &amp; D', wp_html_excerpt( 'Baba &amp; Dyado', 12 ) );
-               $this->assertSame( 'Baba &amp; Dyado', wp_html_excerpt( 'Baba &amp; Dyado', 100 ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingHumanTimeDiffphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/HumanTimeDiff.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/HumanTimeDiff.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/HumanTimeDiff.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,74 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @ticket 38773
- */
-class Tests_Formatting_HumanTimeDiff extends WP_UnitTestCase {
-
-       /**
-        * @group formatting
-        * @ticket 38773
-        * @dataProvider data_test_human_time_diff
-        */
-       function test_human_time_diff( $expected, $stopdate, $message ) {
-               $startdate = new DateTime( '2016-01-01 12:00:00' );
-               $this->assertSame( $expected, human_time_diff( $startdate->format( 'U' ), $stopdate->format( 'U' ) ), $message );
-       }
-
-       // Data for test_human_time_diff.
-       function data_test_human_time_diff() {
-               return array(
-                       array(
-                               '37 seconds',
-                               new DateTime( '2016-01-01 12:00:37' ),
-                               'Test a difference of 37 seconds.',
-                       ),
-                       array(
-                               '5 mins',
-                               new DateTime( '2016-01-01 12:05:00' ),
-                               'Test a difference of 5 minutes.',
-                       ),
-                       array(
-                               '1 hour',
-                               new DateTime( '2016-01-01 13:00:00' ),
-                               'Test a difference of 1 hour.',
-                       ),
-                       array(
-                               '2 days',
-                               new DateTime( '2016-01-03 12:00:00' ),
-                               'Test a difference of 2 days.',
-                       ),
-                       array(
-                               '2 hours',
-                               new DateTime( '2016-01-01 14:29:59' ),
-                               'Test a difference of 2 hours, 29 minutes and 59 seconds  - should round down to 2 hours.',
-                       ),
-                       array(
-                               '3 hours',
-                               new DateTime( '2016-01-01 14:30:00' ),
-                               'Test a difference of 2 hours and 30 minutes - should round up to 3 hours.',
-                       ),
-                       array(
-                               '2 months',
-                               new DateTime( '2016-02-15 12:00:00' ),
-                               'Test a difference of 1 month and 15 days - should round up to 2 months.',
-                       ),
-                       array(
-                               '1 month',
-                               new DateTime( '2016-02-14 12:00:00' ),
-                               'Test a difference of 1 month and 14 days - should round down to 1 month.',
-                       ),
-                       array(
-                               '3 years',
-                               new DateTime( '2018-07-02 12:00:00' ),
-                               'Test a difference of 2 years 6 months and 1 day, should round up to 3 years.',
-                       ),
-                       array(
-                               '2 years',
-                               new DateTime( '2018-07-01 12:00:00' ),
-                               'Test a difference of 2 years 6 months, should round down to 2 years.',
-                       ),
-               );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingIsEmailphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/IsEmail.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/IsEmail.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/IsEmail.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,34 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_IsEmail extends WP_UnitTestCase {
-       function test_returns_the_email_address_if_it_is_valid() {
-               $data = array(
-                       'bob@example.com',
-                       'phil@example.info',
-                       'ace@204.32.222.14',
-                       'kevin@many.subdomains.make.a.happy.man.edu',
-                       'a@b.co',
-                       'bill+ted@example.com',
-               );
-               foreach ( $data as $datum ) {
-                       $this->assertSame( $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',
-                       'a@b.c',
-               );
-               foreach ( $data as $datum ) {
-                       $this->assertFalse( is_email( $datum ), $datum );
-               }
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingJSEscapephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/JSEscape.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/JSEscape.php 2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/JSEscape.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,46 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_JSEscape extends WP_UnitTestCase {
-       function test_js_escape_simple() {
-               $out = esc_js( 'foo bar baz();' );
-               $this->assertSame( '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->assertSame( "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->assertSame( 'foo t bar ' . $bs . $bs . ' baz', $out );
-       }
-
-       function test_js_escape_amp() {
-               $out = esc_js( 'foo & bar &baz; &nbsp;' );
-               $this->assertSame( 'foo &amp; bar &amp;baz; &nbsp;', $out );
-       }
-
-       function test_js_escape_quote_entity() {
-               $out = esc_js( 'foo &#x27; bar &#39; baz &#x26;' );
-               $this->assertSame( "foo \\' bar \\' baz &#x26;", $out );
-       }
-
-       function test_js_no_carriage_return() {
-               $out = esc_js( "foo\rbar\nbaz\r" );
-               // \r is stripped.
-               $this->assertSame( "foobar\\nbaz", $out );
-       }
-
-       function test_js_escape_rn() {
-               $out = esc_js( "foo\r\nbar\nbaz\r\n" );
-               // \r is stripped.
-               $this->assertSame( "foo\\nbar\\nbaz\\n", $out );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingLikeEscapephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/LikeEscape.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/LikeEscape.php       2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/LikeEscape.php 2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,30 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_LikeEscape extends WP_UnitTestCase {
-       /**
-        * @ticket 10041
-        * @expectedDeprecated like_escape
-        */
-       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->assertSame( $expected[ $key ], like_escape( $input ) );
-               }
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingLinksAddTargetphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/LinksAddTarget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/LinksAddTarget.php   2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/LinksAddTarget.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,108 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-/**
- * @group formatting
- */
-class Tests_Formatting_LinksAddTarget extends WP_UnitTestCase {
-       /**
-        * Test Content DataProvider
-        *
-        * array ( input_txt, converted_output_txt)
-        */
-       public function get_input_output() {
-               return array(
-                       array(
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> END TEXT',
-                               null,
-                               null,
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC" target="_blank">LINK</a> HERE </div> END TEXT',
-                       ),
-                       array(
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <A href="XYZ" src="ABC">LINK</A> HERE </div> END TEXT',
-                               null,
-                               null,
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <A href="XYZ" src="ABC" target="_blank">LINK</A> HERE </div> END TEXT',
-                       ),
-                       array(
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <a href="XYZ"  >LINK</a>END TEXT',
-                               null,
-                               null,
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC" target="_blank">LINK</a> HERE </div> <a href="XYZ"   target="_blank">LINK</a>END TEXT',
-                       ),
-                       array(
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span>END TEXT</span>',
-                               '_top',
-                               null,
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC" target="_top">LINK</a> HERE </div> <span>END TEXT</span>',
-                       ),
-                       array(
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span>END TEXT</span>',
-                               '_top',
-                               array( 'span' ),
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="_top">END TEXT</span>',
-                       ),
-                       array(
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span>END TEXT</span>',
-                               '_top',
-                               array( 'SPAN' ),
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="_top">END TEXT</span>',
-                       ),
-                       array(
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="_top">END TEXT</span>',
-                               '_top',
-                               array( 'span', 'div' ),
-                               'MY CONTENT <div target="_top"> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="_top">END TEXT</span>',
-                       ),
-                       array(
-                               'MY CONTENT <div target=\'ABC\'> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="xyz">END TEXT</span>',
-                               '_top',
-                               array( 'span', 'div' ),
-                               'MY CONTENT <div target="_top"> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="_top">END TEXT</span>',
-                       ),
-                       array(
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="xyz" src="ABC">END TEXT</span>',
-                               '_top',
-                               array( 'span' ),
-                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span src="ABC" target="_top">END TEXT</span>',
-                       ),
-                       array(
-                               'MY CONTENT <aside> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </aside> END TEXT',
-                               null,
-                               null,
-                               'MY CONTENT <aside> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC" target="_blank">LINK</a> HERE </aside> END TEXT',
-                       ),
-                       array(
-                               'MY CONTENT <aside class="_blank"> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </aside> END TEXT',
-                               null,
-                               null,
-                               'MY CONTENT <aside class="_blank"> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC" target="_blank">LINK</a> HERE </aside> END TEXT',
-                       ),
-                       array(
-                               'MY CONTENT <blockquote>SOME</blockquote> ADDITIONAL TEXT <b>LINK</b> HERE END TEXT',
-                               '_blank',
-                               array( 'b' ),
-                               'MY CONTENT <blockquote>SOME</blockquote> ADDITIONAL TEXT <b target="_blank">LINK</b> HERE END TEXT',
-                       ),
-                       array(
-                               'MY CONTENT <blockquote target="_self">SOME</blockquote> ADDITIONAL TEXT <b>LINK</b> HERE END TEXT',
-                               '_blank',
-                               array( 'b' ),
-                               'MY CONTENT <blockquote target="_self">SOME</blockquote> ADDITIONAL TEXT <b target="_blank">LINK</b> HERE END TEXT',
-                       ),
-               );
-       }
-
-       /**
-        * Validate the normalize_whitespace function
-        *
-        * @dataProvider get_input_output
-        */
-       function test_normalize_whitespace( $content, $target, $tags, $exp_str ) {
-               if ( true === is_null( $target ) ) {
-                       $this->assertSame( $exp_str, links_add_target( $content ) );
-               } elseif ( true === is_null( $tags ) ) {
-                       $this->assertSame( $exp_str, links_add_target( $content, $target ) );
-               } else {
-                       $this->assertSame( $exp_str, links_add_target( $content, $target, $tags ) );
-               }
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingMakeClickablephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/MakeClickable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/MakeClickable.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/MakeClickable.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,451 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?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->assertSame( $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->assertSame( '<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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
-               }
-       }
-
-       /**
-        * @ticket 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->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
-               }
-       }
-
-       /**
-        * @ticket 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->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
-               }
-       }
-
-       /**
-        * Based on real comments which were incorrectly linked.
-        *
-        * @ticket 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->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
-               }
-       }
-
-       /**
-        * @ticket 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->assertSame( $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->assertSame( $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->assertSame( $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='https://www.youtube.com/watch?v=72xdCU__XCk&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' /> <param name='allowfullscreen' value='true' /> <param name='wmode' value='opaque' /> <embed src='https://www.youtube.com/watch?v=72xdCU__XCk&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='https://www.youtube.com/watch?v=72xdCU__XCk&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' /> <param name='allowfullscreen' value='true' /> <param name='wmode' value='opaque' /> <embed src='https://www.youtube.com/watch?v=72xdCU__XCk&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->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
-               }
-       }
-
-       /**
-        * @ticket 23756
-        */
-       function test_no_links_inside_pre_or_code() {
-               $before = array(
-                       '<pre>http://wordpress.org</pre>',
-                       '<code>http://wordpress.org</code>',
-                       '<pre class="foobar" id="foo">http://wordpress.org</pre>',
-                       '<code class="foobar" id="foo">http://wordpress.org</code>',
-                       '<precustomtag>http://wordpress.org</precustomtag>',
-                       '<codecustomtag>http://wordpress.org</codecustomtag>',
-                       'URL before pre http://wordpress.org<pre>http://wordpress.org</pre>',
-                       'URL before code http://wordpress.org<code>http://wordpress.org</code>',
-                       'URL after pre <PRE>http://wordpress.org</PRE>http://wordpress.org',
-                       'URL after code <code>http://wordpress.org</code>http://wordpress.org',
-                       'URL before and after pre http://wordpress.org<pre>http://wordpress.org</pre>http://wordpress.org',
-                       'URL before and after code http://wordpress.org<code>http://wordpress.org</code>http://wordpress.org',
-                       'code inside pre <pre>http://wordpress.org <code>http://wordpress.org</code> http://wordpress.org</pre>',
-               );
-
-               $expected = array(
-                       '<pre>http://wordpress.org</pre>',
-                       '<code>http://wordpress.org</code>',
-                       '<pre class="foobar" id="foo">http://wordpress.org</pre>',
-                       '<code class="foobar" id="foo">http://wordpress.org</code>',
-                       '<precustomtag><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a></precustomtag>',
-                       '<codecustomtag><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a></codecustomtag>',
-                       'URL before pre <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><pre>http://wordpress.org</pre>',
-                       'URL before code <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><code>http://wordpress.org</code>',
-                       'URL after pre <PRE>http://wordpress.org</PRE><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>',
-                       'URL after code <code>http://wordpress.org</code><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>',
-                       'URL before and after pre <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><pre>http://wordpress.org</pre><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>',
-                       'URL before and after code <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><code>http://wordpress.org</code><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>',
-                       'code inside pre <pre>http://wordpress.org <code>http://wordpress.org</code> http://wordpress.org</pre>',
-               );
-
-               foreach ( $before as $key => $url ) {
-                       $this->assertSame( $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->assertSame( $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->assertSame( $text, make_clickable( $text ) );
-               }
-       }
-
-       /**
-        * @ticket 16892
-        */
-       function test_no_segfault() {
-               $in  = str_repeat( 'http://example.com/2011/03/18/post-title/', 256 );
-               $out = make_clickable( $in );
-               $this->assertSame( $in, $out );
-       }
-
-       /**
-        * @ticket 19028
-        */
-       function test_line_break_in_existing_clickable_link() {
-               $html = "<a
-                                 href='mailto:someone@example.com'>someone@example.com</a>";
-               $this->assertSame( $html, make_clickable( $html ) );
-       }
-
-       /**
-        * @ticket 30162
-        * @dataProvider data_script_and_style_tags
-        */
-       public function test_dont_link_script_and_style_tags( $tag ) {
-               $this->assertSame( $tag, make_clickable( $tag ) );
-       }
-
-       public function data_script_and_style_tags() {
-               return array(
-                       array(
-                               '<script>http://wordpress.org</script>',
-                       ),
-                       array(
-                               '<style>http://wordpress.org</style>',
-                       ),
-                       array(
-                               '<script type="text/javascript">http://wordpress.org</script>',
-                       ),
-                       array(
-                               '<style type="text/css">http://wordpress.org</style>',
-                       ),
-               );
-       }
-
-       /**
-        * @ticket 48022
-        * @dataProvider data_add_rel_ugc_in_comments
-        */
-       public function test_add_rel_ugc_in_comments( $content, $expected ) {
-               $comment_id = self::factory()->comment->create(
-                       array(
-                               'comment_content' => $content,
-                       )
-               );
-
-               ob_start();
-               comment_text( $comment_id );
-               $comment_text = ob_get_clean();
-
-               $this->assertStringContainsString( $expected, make_clickable( $comment_text ) );
-       }
-
-       public function data_add_rel_ugc_in_comments() {
-               return array(
-                       array(
-                               'http://wordpress.org',
-                               '<a href="http://wordpress.org" rel="nofollow ugc">http://wordpress.org</a>',
-                       ),
-                       array(
-                               'www.wordpress.org',
-                               '<p><a href="http://www.wordpress.org" rel="nofollow ugc">http://www.wordpress.org</a>',
-                       ),
-               );
-       }
-
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingMapDeepphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/MapDeep.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/MapDeep.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/MapDeep.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,173 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @ticket 22300
- */
-class Tests_Formatting_MapDeep extends WP_UnitTestCase {
-
-       public function test_map_deep_with_any_function_over_empty_array_should_return_empty_array() {
-               $this->assertSame( array(), map_deep( array(), array( $this, 'append_baba' ) ) );
-       }
-
-       public function test_map_deep_should_map_each_element_of_array_one_level_deep() {
-               $this->assertSame(
-                       array(
-                               'ababa',
-                               'xbaba',
-                       ),
-                       map_deep(
-                               array(
-                                       'a',
-                                       'x',
-                               ),
-                               array( $this, 'append_baba' )
-                       )
-               );
-       }
-
-       public function test_map_deep_should_map_each_element_of_array_two_levels_deep() {
-               $this->assertSame(
-                       array(
-                               'ababa',
-                               array(
-                                       'xbaba',
-                               ),
-                       ),
-                       map_deep(
-                               array(
-                                       'a',
-                                       array(
-                                               'x',
-                                       ),
-                               ),
-                               array( $this, 'append_baba' )
-                       )
-               );
-       }
-
-       public function test_map_deep_should_map_each_object_element_of_an_array() {
-               $this->assertEquals(
-                       array(
-                               'var0' => 'ababa',
-                               'var1' => (object) array(
-                                       'var0' => 'xbaba',
-                               ),
-                       ),
-                       map_deep(
-                               array(
-                                       'var0' => 'a',
-                                       'var1' => (object) array(
-                                               'var0' => 'x',
-                                       ),
-                               ),
-                               array( $this, 'append_baba' )
-                       )
-               );
-       }
-
-       public function test_map_deep_should_apply_the_function_to_a_string() {
-               $this->assertSame( 'xbaba', map_deep( 'x', array( $this, 'append_baba' ) ) );
-       }
-
-       public function test_map_deep_should_apply_the_function_to_an_integer() {
-               $this->assertSame( '5baba', map_deep( 5, array( $this, 'append_baba' ) ) );
-       }
-
-       public function test_map_deep_should_map_each_property_of_an_object() {
-               $this->assertEquals(
-                       (object) array(
-                               'var0' => 'ababa',
-                               'var1' => 'xbaba',
-                       ),
-                       map_deep(
-                               (object) array(
-                                       'var0' => 'a',
-                                       'var1' => 'x',
-                               ),
-                               array( $this, 'append_baba' )
-                       )
-               );
-       }
-
-       public function test_map_deep_should_map_each_array_property_of_an_object() {
-               $this->assertEquals(
-                       (object) array(
-                               'var0' => 'ababa',
-                               'var1' => array(
-                                       'xbaba',
-                               ),
-                       ),
-                       map_deep(
-                               (object) array(
-                                       'var0' => 'a',
-                                       'var1' => array(
-                                               'x',
-                                       ),
-                               ),
-                               array( $this, 'append_baba' )
-                       )
-               );
-       }
-
-       public function test_map_deep_should_map_each_object_property_of_an_object() {
-               $this->assertEquals(
-                       (object) array(
-                               'var0' => 'ababa',
-                               'var1' => (object) array(
-                                       'var0' => 'xbaba',
-                               ),
-                       ),
-                       map_deep(
-                               (object) array(
-                                       'var0' => 'a',
-                                       'var1' => (object) array(
-                                               'var0' => 'x',
-                                       ),
-                               ),
-                               array( $this, 'append_baba' )
-                       )
-               );
-       }
-
-       /**
-        * @ticket 35058
-        */
-       public function test_map_deep_should_map_object_properties_passed_by_reference() {
-               $object_a = (object) array( 'var0' => 'a' );
-               $object_b = (object) array(
-                       'var0' => &$object_a->var0,
-                       'var1' => 'x',
-               );
-               $this->assertEquals(
-                       (object) array(
-                               'var0' => 'ababa',
-                               'var1' => 'xbaba',
-                       ),
-                       map_deep( $object_b, array( $this, 'append_baba' ) )
-               );
-       }
-
-       /**
-        * @ticket 35058
-        */
-       public function test_map_deep_should_map_array_elements_passed_by_reference() {
-               $array_a = array( 'var0' => 'a' );
-               $array_b = array(
-                       'var0' => &$array_a['var0'],
-                       'var1' => 'x',
-               );
-               $this->assertSame(
-                       array(
-                               'var0' => 'ababa',
-                               'var1' => 'xbaba',
-                       ),
-                       map_deep( $array_b, array( $this, 'append_baba' ) )
-               );
-       }
-
-       public function append_baba( $value ) {
-               return $value . 'baba';
-       }
-
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingNormalizeWhitespacephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/NormalizeWhitespace.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/NormalizeWhitespace.php      2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/NormalizeWhitespace.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,52 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-/**
- * @group formatting
- */
-class Tests_Formatting_NormalizeWhitespace extends WP_UnitTestCase {
-       /**
-        * WhitespaceTest Content DataProvider
-        *
-        * array( input_txt, converted_output_txt)
-        */
-       public function get_input_output() {
-               return array(
-                       array(
-                               '               ',
-                               '',
-                       ),
-                       array(
-                               "\rTEST\r",
-                               'TEST',
-                       ),
-                       array(
-                               "\r\nMY TEST CONTENT\r\n",
-                               'MY TEST CONTENT',
-                       ),
-                       array(
-                               "MY\r\nTEST\r\nCONTENT ",
-                               "MY\nTEST\nCONTENT",
-                       ),
-                       array(
-                               "\tMY\rTEST\rCONTENT ",
-                               "MY\nTEST\nCONTENT",
-                       ),
-                       array(
-                               "\tMY\t\t\tTEST\r\t\t\rCONTENT ",
-                               "MY TEST\n \nCONTENT",
-                       ),
-                       array(
-                               "\tMY TEST \t\t\t CONTENT ",
-                               'MY TEST CONTENT',
-                       ),
-               );
-       }
-
-       /**
-        * Validate the normalize_whitespace function
-        *
-        * @dataProvider get_input_output
-        */
-       function test_normalize_whitespace( $in_str, $exp_str ) {
-               $this->assertSame( $exp_str, normalize_whitespace( $in_str ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingRemoveAccentsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/RemoveAccents.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/RemoveAccents.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/RemoveAccents.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,146 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_RemoveAccents extends WP_UnitTestCase {
-       public function test_remove_accents_simple() {
-               $this->assertSame( 'abcdefghijkl', remove_accents( 'abcdefghijkl' ) );
-       }
-
-       /**
-        * @ticket 9591
-        */
-       public function test_remove_accents_latin1_supplement() {
-               $input  = 'ªºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ';
-               $output = 'aoAAAAAAAECEEEEIIIIDNOOOOOOUUUUYTHsaaaaaaaeceeeeiiiidnoooooouuuuythy';
-
-               $this->assertSame( $output, remove_accents( $input ), 'remove_accents replaces Latin-1 Supplement' );
-       }
-
-       public function test_remove_accents_latin_extended_a() {
-               $input  = 'ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſ';
-               $output = 'AaAaAaCcCcCcCcDdDdEeEeEeEeEeGgGgGgGgHhHhIiIiIiIiIiIJijJjKkkLlLlLlLlLlNnNnNnnNnOoOoOoOEoeRrRrRrSsSsSsSsTtTtTtUuUuUuUuUuUuWwYyYZzZzZzs';
-
-               $this->assertSame( $output, remove_accents( $input ), 'remove_accents replaces Latin Extended A' );
-       }
-
-       public function test_remove_accents_latin_extended_b() {
-               $this->assertSame( 'SsTt', remove_accents( 'ȘșȚț' ), 'remove_accents replaces Latin Extended B' );
-       }
-
-       public function test_remove_accents_euro_pound_signs() {
-               $this->assertSame( 'E', remove_accents( '€' ), 'remove_accents replaces euro sign' );
-               $this->assertSame( '', 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->assertSame( $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->assertSame( 'OoUu', remove_accents( 'ƠơƯư' ) );
-               // Grave accent.
-               $this->assertSame( 'AaAaEeOoOoUuYy', remove_accents( 'ẦầẰằỀềỒồỜờỪừỲỳ' ) );
-               // Hook.
-               $this->assertSame( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẢảẨẩẲẳẺẻỂểỈỉỎỏỔổỞởỦủỬửỶỷ' ) );
-               // Tilde.
-               $this->assertSame( 'AaAaEeEeOoOoUuYy', remove_accents( 'ẪẫẴẵẼẽỄễỖỗỠỡỮữỸỹ' ) );
-               // Acute accent.
-               $this->assertSame( 'AaAaEeOoOoUu', remove_accents( 'ẤấẮắẾếỐốỚớỨứ' ) );
-               // Dot below.
-               $this->assertSame( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẠạẬậẶặẸẹỆệỊịỌọỘộỢợỤụỰựỴỵ' ) );
-       }
-
-       /**
-        * @ticket 20772
-        */
-       public function test_remove_accents_hanyu_pinyin() {
-               // Vowels with diacritic (Chinese, Hanyu Pinyin).
-               // Macron.
-               $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'āēīōūǖĀĒĪŌŪǕ' ) );
-               // Acute accent.
-               $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'áéíóúǘÁÉÍÓÚǗ' ) );
-               // Caron.
-               $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'ǎěǐǒǔǚǍĚǏǑǓǙ' ) );
-               // Grave accent.
-               $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'àèìòùǜÀÈÌÒÙǛ' ) );
-               // Unmarked.
-               $this->assertSame( '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->assertSame( 'AeOeUeaeoeuess', remove_accents( 'ÄÖÜäöüß' ) );
-
-               remove_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) );
-       }
-
-       public function _set_locale_to_danish() {
-               return 'da_DK';
-       }
-
-       /**
-        * @ticket 23907
-        */
-       public function test_remove_danish_accents() {
-               add_filter( 'locale', array( $this, '_set_locale_to_danish' ) );
-
-               $this->assertSame( 'AeOeAaaeoeaa', remove_accents( 'ÆØÅæøå' ) );
-
-               remove_filter( 'locale', array( $this, '_set_locale_to_danish' ) );
-       }
-
-       public function _set_locale_to_catalan() {
-               return 'ca';
-       }
-
-       /**
-        * @ticket 37086
-        */
-       public function test_remove_catalan_middot() {
-               add_filter( 'locale', array( $this, '_set_locale_to_catalan' ) );
-
-               $this->assertSame( 'allallalla', remove_accents( 'al·lallaŀla' ) );
-
-               remove_filter( 'locale', array( $this, '_set_locale_to_catalan' ) );
-
-               $this->assertSame( 'al·lallalla', remove_accents( 'al·lallaŀla' ) );
-       }
-
-       public function _set_locale_to_serbian() {
-               return 'sr_RS';
-       }
-
-       /**
-        * @ticket 38078
-        */
-       public function test_transcribe_serbian_crossed_d() {
-               add_filter( 'locale', array( $this, '_set_locale_to_serbian' ) );
-
-               $this->assertSame( 'DJdj', remove_accents( 'Đđ' ) );
-
-               remove_filter( 'locale', array( $this, '_set_locale_to_serbian' ) );
-
-               $this->assertSame( 'Dd', remove_accents( 'Đđ' ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeFileNamephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/SanitizeFileName.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/SanitizeFileName.php 2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/SanitizeFileName.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,96 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_SanitizeFileName extends WP_UnitTestCase {
-       function test_munges_extensions() {
-               // r17990
-               $file_name = sanitize_file_name( 'test.phtml.txt' );
-               $this->assertSame( '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->assertSame( 'testtest', sanitize_file_name( $string ) );
-       }
-
-       /**
-        * @ticket 22363
-        */
-       function test_removes_accents() {
-               $in  = 'àáâãäåæçèéêëìíîïñòóôõöøùúûüýÿ';
-               $out = 'aaaaaaaeceeeeiiiinoooooouuuuyy';
-               $this->assertSame( $out, sanitize_file_name( $in ) );
-       }
-
-       /**
-        * Test that spaces are correctly replaced with dashes.
-        *
-        * @ticket 16330
-        */
-       function test_replaces_spaces() {
-               $urls = array(
-                       'unencoded space.png'  => 'unencoded-space.png',
-                       'encoded-space.jpg'    => 'encoded-space.jpg',
-                       'plus+space.jpg'       => 'plusspace.jpg',
-                       'multi %20 +space.png' => 'multi-20-space.png',
-               );
-
-               foreach ( $urls as $test => $expected ) {
-                       $this->assertSame( $expected, sanitize_file_name( $test ) );
-               }
-       }
-
-       function test_replaces_any_number_of_hyphens_with_one_hyphen() {
-               $this->assertSame( 'a-t-t', sanitize_file_name( 'a----t----t' ) );
-       }
-
-       function test_trims_trailing_hyphens() {
-               $this->assertSame( 'a-t-t', sanitize_file_name( 'a----t----t----' ) );
-       }
-
-       function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
-               $this->assertSame( 'a-t', sanitize_file_name( 'a          t' ) );
-               $this->assertSame( 'a-t', sanitize_file_name( "a    \n\n\nt" ) );
-       }
-
-       /**
-        * @ticket 16226
-        */
-       function test_replaces_percent_sign() {
-               $this->assertSame( 'a22b.jpg', sanitize_file_name( 'a%22b.jpg' ) );
-       }
-
-       function test_replaces_unnamed_file_extensions() {
-               // Test filenames with both supported and unsupported extensions.
-               $this->assertSame( 'unnamed-file.exe', sanitize_file_name( '_.exe' ) );
-               $this->assertSame( 'unnamed-file.jpg', sanitize_file_name( '_.jpg' ) );
-       }
-
-       function test_replaces_unnamed_file_extensionless() {
-               // Test a filenames that becomes extensionless.
-               $this->assertSame( 'no-extension', sanitize_file_name( '_.no-extension' ) );
-       }
-
-       /**
-        * @dataProvider data_wp_filenames
-        */
-       function test_replaces_invalid_utf8_characters( $input, $expected ) {
-               $this->assertSame( $expected, sanitize_file_name( $input ) );
-       }
-
-       function data_wp_filenames() {
-               return array(
-                       array( urldecode( '%B1myfile.png' ), 'myfile.png' ),
-                       array( urldecode( '%B1myfile' ), 'myfile' ),
-                       array( 'demo bar.png', 'demo-bar.png' ),
-                       array( 'demo' . json_decode( '"\u00a0"' ) . 'bar.png', 'demo-bar.png' ),
-               );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeMimeTypephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/SanitizeMimeType.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/SanitizeMimeType.php 2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/SanitizeMimeType.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,41 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_SanitizeMimeType extends WP_UnitTestCase {
-
-       /**
-        * @ticket 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->assertSame( $input, sanitize_mime_type( $input ) );
-               }
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeOrderbyphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/SanitizeOrderby.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/SanitizeOrderby.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/SanitizeOrderby.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,57 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group sanitize_sql_orderby
- */
-class Tests_Formatting_SanitizeOrderby extends WP_UnitTestCase {
-
-       /**
-        * @covers ::sanitize_sql_orderby
-        * @dataProvider valid_orderbys
-        */
-       function test_valid( $orderby ) {
-               $this->assertSame( $orderby, sanitize_sql_orderby( $orderby ) );
-       }
-       function valid_orderbys() {
-               return array(
-                       array( '1' ),
-                       array( '1 ASC' ),
-                       array( '1 ASC, 2' ),
-                       array( '1 ASC, 2 DESC' ),
-                       array( '1 ASC, 2 DESC, 3' ),
-                       array( '       1      DESC' ),
-                       array( 'field ASC' ),
-                       array( 'field1 ASC, field2' ),
-                       array( 'field_1 ASC, field_2 DESC' ),
-                       array( 'field1, field2 ASC' ),
-                       array( '`field1`' ),
-                       array( '`field1` ASC' ),
-                       array( '`field` ASC, `field2`' ),
-                       array( 'RAND()' ),
-                       array( '   RAND(  )   ' ),
-               );
-       }
-
-       /**
-        * @covers ::sanitize_sql_orderby
-        * @dataProvider invalid_orderbys
-        */
-       function test_invalid( $orderby ) {
-               $this->assertFalse( sanitize_sql_orderby( $orderby ) );
-       }
-       function invalid_orderbys() {
-               return array(
-                       array( '' ),
-                       array( '1 2' ),
-                       array( '1, 2 3' ),
-                       array( '1 DESC, ' ),
-                       array( 'field-1' ),
-                       array( 'field DESC,' ),
-                       array( 'field1 field2' ),
-                       array( 'field RAND()' ),
-                       array( 'RAND() ASC' ),
-                       array( '`field1` ASC, `field2' ),
-                       array( 'field, !@#$%^' ),
-               );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizePostphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/SanitizePost.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/SanitizePost.php     2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/SanitizePost.php       2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,32 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-/**
- * @group formatting
- * @group post
- */
-class Tests_Formatting_SanitizePost extends WP_UnitTestCase {
-
-       /**
-        * @ticket 22324
-        */
-       function test_int_fields() {
-               $post       = self::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 ) {
-                       switch ( $type ) {
-                               case 'integer':
-                                       $this->assertIsInt( $post->$field, "field $field" );
-                                       break;
-                               case 'string':
-                                       $this->assertIsString( $post->$field, "field $field" );
-                                       break;
-                       }
-               }
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeTextFieldphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/SanitizeTextField.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/SanitizeTextField.php        2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/SanitizeTextField.php  2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,143 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_SanitizeTextField extends WP_UnitTestCase {
-       function data_sanitize_text_field() {
-               return array(
-                       array(
-                               'оРангутанг', // Ensure UTF-8 text is safe. The Р is D0 A0 and A0 is the non-breaking space.
-                               'оРангутанг',
-                       ),
-                       array(
-                               'САПР',       // Ensure UTF-8 text is safe. the Р is D0 A0 and A0 is the non-breaking space.
-                               'САПР',
-                       ),
-                       array(
-                               'one is < two',
-                               'one is &lt; two',
-                       ),
-                       array(
-                               "one is <\n two",
-                               array(
-                                       'oneline'   => 'one is &lt; two',
-                                       'multiline' => "one is &lt;\n two",
-                               ),
-                       ),
-                       array(
-                               "foo <div\n> bar",
-                               array(
-                                       'oneline'   => 'foo bar',
-                                       'multiline' => 'foo  bar',
-                               ),
-                       ),
-                       array(
-                               "foo <\ndiv\n> bar",
-                               array(
-                                       'oneline'   => 'foo &lt; div > bar',
-                                       'multiline' => "foo &lt;\ndiv\n> bar",
-                               ),
-                       ),
-                       array(
-                               'tags <span>are</span> <em>not allowed</em> here',
-                               'tags are not allowed here',
-                       ),
-                       array(
-                               ' we should trim leading and trailing whitespace ',
-                               'we should trim leading and trailing whitespace',
-                       ),
-                       array(
-                               'we  trim  extra  internal  whitespace  only  in  single  line  texts',
-                               array(
-                                       'oneline'   => 'we trim extra internal whitespace only in single line texts',
-                                       'multiline' => 'we  trim  extra  internal  whitespace  only  in  single  line  texts',
-                               ),
-                       ),
-                       array(
-                               "tabs \tget removed in single line texts",
-                               array(
-                                       'oneline'   => 'tabs get removed in single line texts',
-                                       'multiline' => "tabs \tget removed in single line texts",
-                               ),
-                       ),
-                       array(
-                               "newlines are allowed only\n in multiline texts",
-                               array(
-                                       'oneline'   => 'newlines are allowed only in multiline texts',
-                                       'multiline' => "newlines are allowed only\n in multiline texts",
-                               ),
-                       ),
-                       array(
-                               'We also %AB remove %ab octets',
-                               'We also remove octets',
-                       ),
-                       array(
-                               'We don\'t need to wory about %A
-                               B removing %a
-                               b octets even when %a   B they are obscured by whitespace',
-                               array(
-                                       'oneline'   => 'We don\'t need to wory about %A B removing %a b octets even when %a B they are obscured by whitespace',
-                                       'multiline' => "We don't need to wory about %A\n                                B removing %a\n                         b octets even when %a   B they are obscured by whitespace",
-                               ),
-                       ),
-                       array(
-                               '%AB%BC%DE', // Just octets.
-                               '',          // Emtpy as we strip all the octets out.
-                       ),
-                       array(
-                               'Invalid octects remain %II',
-                               'Invalid octects remain %II',
-                       ),
-                       array(
-                               'Nested octects %%%ABABAB %A%A%ABBB',
-                               'Nested octects',
-                       ),
-                       array(
-                               array(),
-                               '',
-                       ),
-                       array(
-                               array( 1, 2, 'foo' ),
-                               '',
-                       ),
-                       array(
-                               new WP_Query,
-                               '',
-                       ),
-                       array(
-                               2,
-                               '2',
-                       ),
-                       array(
-                               false,
-                               '',
-                       ),
-                       array(
-                               true,
-                               '1',
-                       ),
-                       array(
-                               10.1,
-                               '10.1',
-                       ),
-               );
-       }
-
-       /**
-        * @ticket 32257
-        * @dataProvider data_sanitize_text_field
-        */
-       function test_sanitize_text_field( $string, $expected ) {
-               if ( is_array( $expected ) ) {
-                       $expected_oneline   = $expected['oneline'];
-                       $expected_multiline = $expected['multiline'];
-               } else {
-                       $expected_oneline   = $expected;
-                       $expected_multiline = $expected;
-               }
-               $this->assertSame( $expected_oneline, sanitize_text_field( $string ) );
-               $this->assertSameIgnoreEOL( $expected_multiline, sanitize_textarea_field( $string ) );
-
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeTitlephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/SanitizeTitle.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/SanitizeTitle.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/SanitizeTitle.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,18 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_SanitizeTitle extends WP_UnitTestCase {
-       function test_strips_html() {
-               $input    = 'Captain <strong>Awesome</strong>';
-               $expected = 'captain-awesome';
-               $this->assertSame( $expected, sanitize_title( $input ) );
-       }
-
-       function test_titles_sanitized_to_nothing_are_replaced_with_optional_fallback() {
-               $input    = '<strong></strong>';
-               $fallback = 'Captain Awesome';
-               $this->assertSame( $fallback, sanitize_title( $input, $fallback ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeTitleWithDashesphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/SanitizeTitleWithDashes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/SanitizeTitleWithDashes.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/SanitizeTitleWithDashes.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,150 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_SanitizeTitleWithDashes extends WP_UnitTestCase {
-       function test_strips_html() {
-               $input    = 'Captain <strong>Awesome</strong>';
-               $expected = 'captain-awesome';
-               $this->assertSame( $expected, sanitize_title_with_dashes( $input ) );
-       }
-
-       function test_strips_unencoded_percent_signs() {
-               $this->assertSame( 'fran%c3%a7ois', sanitize_title_with_dashes( 'fran%c3%a7%ois' ) );
-       }
-
-       function test_makes_title_lowercase() {
-               $this->assertSame( 'abc', sanitize_title_with_dashes( 'ABC' ) );
-       }
-
-       function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
-               $this->assertSame( 'a-t', sanitize_title_with_dashes( 'a          t' ) );
-               $this->assertSame( 'a-t', sanitize_title_with_dashes( "a    \n\n\nt" ) );
-       }
-
-       function test_replaces_any_number_of_hyphens_with_one_hyphen() {
-               $this->assertSame( 'a-t-t', sanitize_title_with_dashes( 'a----t----t' ) );
-       }
-
-       function test_trims_trailing_hyphens() {
-               $this->assertSame( 'a-t-t', sanitize_title_with_dashes( 'a----t----t----' ) );
-       }
-
-       function test_handles_non_entity_ampersands() {
-               $this->assertSame( 'penn-teller-bull', sanitize_title_with_dashes( 'penn & teller bull' ) );
-       }
-
-       public function test_strips_nbsp_ndash_and_amp() {
-               $this->assertSame( 'no-entities-here', sanitize_title_with_dashes( 'No &nbsp; Entities &ndash; Here &amp;' ) );
-       }
-
-       public function test_strips_encoded_ampersand() {
-               $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One &amp; Two', '', 'save' ) );
-       }
-
-       public function test_strips_url_encoded_ampersand() {
-               $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One &#123; Two;', '', 'save' ) );
-       }
-
-       public function test_strips_trademark_symbol() {
-               $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One Two™;', '', 'save' ) );
-       }
-
-       public function test_strips_unencoded_ampersand_followed_by_encoded_ampersand() {
-               $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One &&amp; Two;', '', 'save' ) );
-       }
-
-       public function test_strips_unencoded_ampersand_when_not_surrounded_by_spaces() {
-               $this->assertSame( 'onetwo', sanitize_title_with_dashes( 'One&Two', '', 'save' ) );
-       }
-
-       function test_replaces_nbsp() {
-               $this->assertSame( 'dont-break-the-space', sanitize_title_with_dashes( "don't break the space", '', 'save' ) );
-       }
-
-       /**
-        * @ticket 31790
-        */
-       function test_replaces_nbsp_entities() {
-               $this->assertSame( 'dont-break-the-space', sanitize_title_with_dashes( "don't&nbsp;break&#160;the&nbsp;space", '', 'save' ) );
-       }
-
-       function test_replaces_ndash_mdash() {
-               $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do – the Dash', '', 'save' ) );
-               $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do the — Dash', '', 'save' ) );
-       }
-
-       /**
-        * @ticket 31790
-        */
-       function test_replaces_ndash_mdash_entities() {
-               $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do &ndash; the &#8211; Dash', '', 'save' ) );
-               $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do &mdash; the &#8212; Dash', '', 'save' ) );
-       }
-
-       function test_replaces_iexcel_iquest() {
-               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just ¡a Slug', '', 'save' ) );
-               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just a Slug¿', '', 'save' ) );
-       }
-
-       function test_replaces_angle_quotes() {
-               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( '‹Just a Slug›', '', 'save' ) );
-               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( '«Just a Slug»', '', 'save' ) );
-       }
-
-       function test_replaces_curly_quotes() {
-               $this->assertSame( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its “Curly Joe”', '', 'save' ) );
-               $this->assertSame( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its ‘Curly Joe’', '', 'save' ) );
-               $this->assertSame( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its „Curly Joe“', '', 'save' ) );
-               $this->assertSame( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its ‚Curly Joe‛', '', 'save' ) );
-               $this->assertSame( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its „Curly Joe‟', '', 'save' ) );
-       }
-
-       /**
-        * @ticket 49791
-        */
-       function test_replaces_bullet() {
-               $this->assertSame( 'fancy-title-amazing', sanitize_title_with_dashes( 'Fancy Title • Amazing', '', 'save' ) );
-       }
-
-       function test_replaces_copy_reg_deg_trade() {
-               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just © a Slug', '', 'save' ) );
-               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( '® Just a Slug', '', 'save' ) );
-               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just a ° Slug', '', 'save' ) );
-               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just ™ a Slug', '', 'save' ) );
-       }
-
-       /**
-        * @ticket 10792
-        */
-       function test_replaces_forward_slash() {
-               $this->assertSame( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon/McCartney', '', 'save' ) );
-               $this->assertSame( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon//McCartney', '', 'save' ) );
-               $this->assertSame( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon///McCartney', '', 'save' ) );
-               $this->assertSame( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon/-McCartney', '', 'save' ) );
-               $this->assertSame( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( '//songs by Lennon/McCartney', '', 'save' ) );
-       }
-
-       /**
-        * @ticket 19820
-        */
-       function test_replaces_multiply_sign() {
-               $this->assertSame( '6x7-is-42', sanitize_title_with_dashes( '6×7 is 42', '', 'save' ) );
-       }
-
-       /**
-        * @ticket 20772
-        */
-       function test_replaces_standalone_diacritic() {
-               $this->assertSame( 'aaaa', sanitize_title_with_dashes( 'āáǎà', '', 'save' ) );
-       }
-
-       /**
-        * @ticket 22395
-        */
-       function test_replaces_acute_accents() {
-               $this->assertSame( 'aaaa', sanitize_title_with_dashes( 'ááa´aˊ', '', 'save' ) );
-       }
-
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeTrackbackUrlsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/SanitizeTrackbackUrls.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/SanitizeTrackbackUrls.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/SanitizeTrackbackUrls.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,27 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_SanitizeTrackbackUrls extends WP_UnitTestCase {
-       /**
-        * @ticket 21624
-        * @dataProvider breaks
-        */
-       function test_sanitize_trackback_urls_with_multiple_urls( $break ) {
-               $this->assertSame( "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" ),
-               );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSanitizeUserphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/SanitizeUser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/SanitizeUser.php     2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/SanitizeUser.php       2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,42 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?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->assertSame( $expected, sanitize_user( $input ) );
-       }
-
-       public function test_strips_encoded_ampersand() {
-               $expected = 'ATT';
-
-               // Multisite forces user logins to lowercase.
-               if ( is_multisite() ) {
-                       $expected = strtolower( $expected );
-               }
-
-               $this->assertSame( $expected, sanitize_user( 'AT&amp;T' ) );
-       }
-
-       public function test_strips_encoded_ampersand_when_followed_by_semicolon() {
-               $expected = 'ATT Test;';
-
-               // Multisite forces user logins to lowercase.
-               if ( is_multisite() ) {
-                       $expected = strtolower( $expected );
-               }
-
-               $this->assertSame( $expected, sanitize_user( 'AT&amp;T Test;' ) );
-       }
-
-       function test_strips_percent_encoded_octets() {
-               $expected = is_multisite() ? 'franois' : 'Franois';
-               $this->assertSame( $expected, sanitize_user( 'Fran%c3%a7ois' ) );
-       }
-       function test_optional_strict_mode_reduces_to_safe_ascii_subset() {
-               $this->assertSame( 'abc', sanitize_user( '()~ab~ˆcˆ!', true ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSeemsUtf8php"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/SeemsUtf8.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/SeemsUtf8.php        2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/SeemsUtf8.php  2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,44 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?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( $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->assertFalse( seems_utf8( $big5_string ) );
-       }
-
-       function big5_strings() {
-               // Get data from formatting/big5.txt.
-               $big5_strings = file( DIR_TESTDATA . '/formatting/big5.txt' );
-               foreach ( $big5_strings as &$string ) {
-                       $string = (array) trim( $string );
-               }
-               unset( $string );
-               return $big5_strings;
-       }
-}
-
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSlashitphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/Slashit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/Slashit.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/Slashit.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,54 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_Slashit extends WP_UnitTestCase {
-       function test_backslashes_middle_numbers() {
-               $this->assertSame( "\\a-!9\\a943\\b\\c", backslashit( 'a-!9a943bc' ) );
-       }
-
-       function test_backslashes_alphas() {
-               $this->assertSame( "\\a943\\b\\c", backslashit( 'a943bc' ) );
-       }
-
-       function test_double_backslashes_leading_numbers() {
-               $this->assertSame( '\\\\95', backslashit( '95' ) );
-       }
-
-       function test_removes_trailing_slashes() {
-               $this->assertSame( 'a', untrailingslashit( 'a/' ) );
-               $this->assertSame( 'a', untrailingslashit( 'a////' ) );
-       }
-
-       /**
-        * @ticket 22267
-        */
-       function test_removes_trailing_backslashes() {
-               $this->assertSame( 'a', untrailingslashit( 'a\\' ) );
-               $this->assertSame( 'a', untrailingslashit( 'a\\\\\\\\' ) );
-       }
-
-       /**
-        * @ticket 22267
-        */
-       function test_removes_trailing_mixed_slashes() {
-               $this->assertSame( 'a', untrailingslashit( 'a/\\' ) );
-               $this->assertSame( 'a', untrailingslashit( 'a\\/\\///\\\\//' ) );
-       }
-
-       function test_adds_trailing_slash() {
-               $this->assertSame( 'a/', trailingslashit( 'a' ) );
-       }
-
-       function test_does_not_add_trailing_slash_if_one_exists() {
-               $this->assertSame( 'a/', trailingslashit( 'a/' ) );
-       }
-
-       /**
-        * @ticket 22267
-        */
-       function test_converts_trailing_backslash_to_slash_if_one_exists() {
-               $this->assertSame( 'a/', trailingslashit( 'a\\' ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingSmiliesphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/Smilies.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/Smilies.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/Smilies.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,355 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @group emoji
- */
-class Tests_Formatting_Smilies extends WP_UnitTestCase {
-
-       /**
-        * Basic Test Content DataProvider
-        *
-        * array ( input_txt, converted_output_txt)
-        */
-       public function get_smilies_input_output() {
-               $includes_path = includes_url( 'images/smilies/' );
-
-               return array(
-                       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 :?:',
-                               "Lorem ipsum dolor sit amet mauris \xf0\x9f\x98\x89 Praesent gravida sodales. \xf0\x9f\x98\x86 Vivamus nec diam in faucibus eu, bibendum varius nec, imperdiet purus est, at augue at lacus malesuada elit dapibus a, \xf0\x9f\x98\xae mauris. Cras mauris viverra elit. Nam laoreet viverra. Pellentesque tortor. Nam libero ante, porta urna ut turpis. Nullam wisi magna, <img src=\"${includes_path}mrgreen.png\" alt=\":mrgreen:\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" /> 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 \xe2\x9d\x93",
-                       ),
-                       array(
-                               '<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>Welcome to the jungle!</strong> We got fun n games! \xf0\x9f\x99\x82 We got everything you want \xf0\x9f\x98\x8e <em>Honey we know the names \xf0\x9f\x99\x82</em>",
-                       ),
-                       array(
-                               "<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;)>a little bit of this\na little bit:other: of that \xf0\x9f\x98\x80\n\xf0\x9f\x98\x80 a little bit of good\nyeah with a little bit of bad8O",
-                       ),
-                       array(
-                               '<strong style="here comes the sun :-D">and I say it\'s allright:D:D',
-                               '<strong style="here comes the sun :-D">and I say it\'s allright:D:D',
-                       ),
-                       array(
-                               '<!-- Woo-hoo, I\'m a comment, baby! :x > -->',
-                               '<!-- Woo-hoo, I\'m a comment, baby! :x > -->',
-                       ),
-                       array(
-                               ':?:P:?::-x:mrgreen:::',
-                               ':?:P:?::-x:mrgreen:::',
-                       ),
-               );
-       }
-
-       /**
-        * @dataProvider get_smilies_input_output
-        *
-        * Basic Validation Test to confirm that smilies are converted to image
-        * when use_smilies = 1 and not when use_smilies = 0
-        */
-       function test_convert_standard_smilies( $in_txt, $converted_txt ) {
-               // Standard smilies, use_smilies: ON.
-               update_option( 'use_smilies', 1 );
-
-               smilies_init();
-
-               $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
-
-               // Standard smilies, use_smilies: OFF.
-               update_option( 'use_smilies', 0 );
-
-               $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
-       }
-
-       /**
-        * Custom Smilies Test Content DataProvider
-        *
-        * array ( input_txt, converted_output_txt)
-        */
-       public function get_custom_smilies_input_output() {
-               $includes_path = includes_url( 'images/smilies/' );
-
-               return array(
-                       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:',
-                               '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=":monkey:" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
-                       ),
-                       array(
-                               '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:',
-                               'Star Wars Jedi Knight <img src="' . $includes_path . 'icon_arrow.gif" alt=":arrow:" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 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=":nervou:" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
-                       ),
-                       array(
-                               ':arrow: monkey: Lorem ipsum dolor sit amet enim. Etiam ullam :PP <br />corper. Suspendisse a pellentesque dui, non felis.<a> :arrow: :arrow</a>',
-                               '<img src="' . $includes_path . 'icon_arrow.gif" alt=":arrow:" class="wp-smiley" style="height: 1em; max-height: 1em;" /> monkey: Lorem ipsum dolor sit amet enim. Etiam ullam <img src="' . $includes_path . 'icon_tongue.gif" alt=":PP" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <br />corper. Suspendisse a pellentesque dui, non felis.<a> <img src="' . $includes_path . 'icon_arrow.gif" alt=":arrow:" class="wp-smiley" style="height: 1em; max-height: 1em;" /> :arrow</a>',
-                       ),
-               );
-       }
-
-       /**
-        * @dataProvider get_custom_smilies_input_output
-        *
-        * Validate Custom Smilies are converted to images when use_smilies = 1
-        */
-       function test_convert_custom_smilies( $in_txt, $converted_txt ) {
-               global $wpsmiliestrans;
-
-               // Custom smilies, use_smilies: ON.
-               update_option( 'use_smilies', 1 );
-
-               if ( ! isset( $wpsmiliestrans ) ) {
-                       smilies_init();
-               }
-
-               $trans_orig = $wpsmiliestrans; // Save original translations array.
-
-               $wpsmiliestrans = array(
-                       ':PP'      => 'icon_tongue.gif',
-                       ':arrow:'  => 'icon_arrow.gif',
-                       ':monkey:' => 'icon_shock_the_monkey.gif',
-                       ':nervou:' => 'icon_nervou.gif',
-               );
-
-               smilies_init();
-
-               $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
-
-               // Standard smilies, use_smilies: OFF.
-               update_option( 'use_smilies', 0 );
-
-               $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
-
-               $wpsmiliestrans = $trans_orig; // Reset original translations array.
-       }
-
-
-       /**
-        * DataProvider of HTML elements/tags that smilie matches should be ignored in
-        */
-       public function get_smilies_ignore_tags() {
-               return array(
-                       array( 'pre' ),
-                       array( 'code' ),
-                       array( 'script' ),
-                       array( 'style' ),
-                       array( 'textarea' ),
-               );
-       }
-
-       /**
-        * Validate Conversion of Smilies is ignored in pre-determined tags
-        * pre, code, script, style
-        *
-        * @ticket 16448
-        * @dataProvider get_smilies_ignore_tags
-        */
-       public function test_ignore_smilies_in_tags( $element ) {
-               $includes_path = includes_url( 'images/smilies/' );
-
-               $in_str  = 'Do we ingore smilies ;-) in ' . $element . ' tags <' . $element . ' class="foo">My Content Here :?: </' . $element . '>';
-               $exp_str = "Do we ingore smilies \xf0\x9f\x98\x89 in $element tags <$element class=\"foo\">My Content Here :?: </$element>";
-
-               // Standard smilies, use_smilies: ON.
-               update_option( 'use_smilies', 1 );
-               smilies_init();
-
-               $this->assertSame( $exp_str, convert_smilies( $in_str ) );
-
-               // Standard smilies, use_smilies: OFF.
-               update_option( 'use_smilies', 0 );
-       }
-
-       /**
-        * DataProvider of Smilie Combinations
-        */
-       public function get_smilies_combinations() {
-               $includes_path = includes_url( 'images/smilies/' );
-
-               return array(
-                       array(
-                               '8-O :-(',
-                               "\xf0\x9f\x98\xaf \xf0\x9f\x99\x81",
-                       ),
-                       array(
-                               '8-) 8-O',
-                               "\xf0\x9f\x98\x8e \xf0\x9f\x98\xaf",
-                       ),
-                       array(
-                               '8-) 8O',
-                               "\xf0\x9f\x98\x8e \xf0\x9f\x98\xaf",
-                       ),
-                       array(
-                               '8-) :-(',
-                               "\xf0\x9f\x98\x8e \xf0\x9f\x99\x81",
-                       ),
-                       array(
-                               '8-) :twisted:',
-                               "\xf0\x9f\x98\x8e \xf0\x9f\x98\x88",
-                       ),
-                       array(
-                               '8O :twisted: :( :? :roll: :mrgreen:',
-                               "\xf0\x9f\x98\xaf \xf0\x9f\x98\x88 \xf0\x9f\x99\x81 \xf0\x9f\x98\x95 \xf0\x9f\x99\x84 <img src=\"{$includes_path}mrgreen.png\" alt=\":mrgreen:\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" />",
-                       ),
-               );
-       }
-
-       /**
-        * Validate Combinations of Smilies separated by single space
-        * are converted correctly
-        *
-        * @ticket 20124
-        * @dataProvider get_smilies_combinations
-        */
-       public function test_smilies_combinations( $in_txt, $converted_txt ) {
-               // Custom smilies, use_smilies: ON.
-               update_option( 'use_smilies', 1 );
-               smilies_init();
-
-               $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
-
-               // Custom smilies, use_smilies: OFF.
-               update_option( 'use_smilies', 0 );
-
-               $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
-       }
-
-       /**
-        * DataProvider of Single Smilies input and converted output
-        */
-       public function get_single_smilies_input_output() {
-               $includes_path = includes_url( 'images/smilies/' );
-
-               return array(
-                       array(
-                               '8-O :-(',
-                               '8-O :-(',
-                       ),
-                       array(
-                               '8O :) additional text here :)',
-                               '8O <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" /> additional text here <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
-                       ),
-                       array(
-                               ':) :) :) :)',
-                               '<img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
-                       ),
-               );
-       }
-
-       /**
-        * Validate Smilies are converted for single smilie in
-        * the $wpsmiliestrans global array
-        *
-        * @ticket 25303
-        * @dataProvider get_single_smilies_input_output
-        */
-       public function test_single_smilies_in_wpsmiliestrans( $in_txt, $converted_txt ) {
-               global $wpsmiliestrans;
-
-               // Standard smilies, use_smilies: ON.
-               update_option( 'use_smilies', 1 );
-
-               if ( ! isset( $wpsmiliestrans ) ) {
-                       smilies_init();
-               }
-
-               $orig_trans = $wpsmiliestrans; // Save original tranlations array.
-
-               $wpsmiliestrans = array(
-                       ':)' => 'simple-smile.png',
-               );
-
-               smilies_init();
-
-               $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
-
-               // Standard smilies, use_smilies: OFF.
-               update_option( 'use_smilies', 0 );
-
-               $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
-
-               $wpsmiliestrans = $orig_trans; // Reset original translations array.
-       }
-
-       public function get_spaces_around_smilies() {
-               $nbsp = "\xC2\xA0";
-
-               return array(
-                       array(
-                               'test :) smile',
-                               "test \xf0\x9f\x99\x82 smile",
-                       ),
-                       array(
-                               'test &nbsp;:)&nbsp;smile',
-                               "test &nbsp;\xf0\x9f\x99\x82&nbsp;smile",
-                       ),
-                       array(
-                               "test {$nbsp}:){$nbsp}smile",
-                               "test {$nbsp}\xf0\x9f\x99\x82{$nbsp}smile",
-                       ),
-               );
-       }
-
-       /**
-        * Check that $wp_smiliessearch pattern will match smilies
-        * between spaces, but never capture those spaces.
-        *
-        * Further check that spaces aren't randomly deleted
-        * or added when replacing the text with an image.
-        *
-        * @ticket 22692
-        * @dataProvider get_spaces_around_smilies
-        */
-       function test_spaces_around_smilies( $in_txt, $converted_txt ) {
-               // Standard smilies, use_smilies: ON.
-               update_option( 'use_smilies', 1 );
-
-               smilies_init();
-
-               $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
-
-               // Standard smilies, use_smilies: OFF.
-               update_option( 'use_smilies', 0 );
-       }
-
-       /**
-        * Test to ensure smilies can be removed with a filter
-        *
-        * @ticket 35905
-        */
-       public function test_smilies_filter_removes_smilies() {
-               add_filter( 'smilies', array( $this, '_filter_remove_smilies' ) );
-               smilies_init();
-               remove_filter( 'smilies', array( $this, '_filter_remove_smilies' ) );
-
-               $txt = ':oops: I did it again';
-
-               $this->assertSame( $txt, convert_smilies( $txt ) );
-       }
-
-       /**
-        * Test to ensure smilies can be added with a filter
-        *
-        * @ticket 35905
-        */
-       public function test_smilies_filter_adds_smilies() {
-               add_filter( 'smilies', array( $this, '_filter_add_smilies' ) );
-               smilies_init();
-               remove_filter( 'smilies', array( $this, '_filter_add_smilies' ) );
-
-               $txt          = 'You played with my <3';
-               $expected_txt = 'You played with my \xe2\x9d\xa4';
-
-               $this->assertSame( $expected_txt, convert_smilies( $txt ) );
-       }
-
-
-       public function _filter_remove_smilies( $wpsmiliestrans ) {
-               unset( $wpsmiliestrans[':oops:'] );
-               return $wpsmiliestrans;
-       }
-
-       public function _filter_add_smilies( $wpsmiliestrans ) {
-               $wpsmiliestrans['<3'] = '\xe2\x9d\xa4';
-               return $wpsmiliestrans;
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingStripSlashesDeepphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/StripSlashesDeep.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/StripSlashesDeep.php 2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/StripSlashesDeep.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,54 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @group slashes
- */
-class Tests_Formatting_StripSlashesDeep extends WP_UnitTestCase {
-       /**
-        * @ticket 18026
-        */
-       function test_preserves_original_datatype() {
-
-               $this->assertTrue( stripslashes_deep( true ) );
-               $this->assertFalse( stripslashes_deep( false ) );
-               $this->assertSame( 4, stripslashes_deep( 4 ) );
-               $this->assertSame( 'foo', stripslashes_deep( 'foo' ) );
-               $arr      = array(
-                       'a' => true,
-                       'b' => false,
-                       'c' => 4,
-                       'd' => 'foo',
-               );
-               $arr['e'] = $arr; // Add a sub-array.
-               $this->assertSame( $arr, stripslashes_deep( $arr ) ); // Keyed array.
-               $this->assertSame( array_values( $arr ), stripslashes_deep( array_values( $arr ) ) ); // Non-keyed.
-
-               $obj = new stdClass;
-               foreach ( $arr as $k => $v ) {
-                       $obj->$k = $v;
-               }
-               $this->assertSame( $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->assertSame( $new, stripslashes_deep( $old ) );
-               $this->assertSame( $new, stripslashes_deep( "I can\\'t see, isn\\'t that it?" ) );
-               $this->assertSame( array( 'a' => $new ), stripslashes_deep( array( 'a' => $old ) ) ); // Keyed array.
-               $this->assertSame( 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->assertSame( $txt, stripslashes_deep( "I can\'t see, isn\\\'t that it?" ) );
-               $this->assertSame( $txt, stripslashes_deep( "I can\'t see, isn\\\\\'t that it?" ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingURLShortenphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/URLShorten.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/URLShorten.php       2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/URLShorten.php 2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,23 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_URLShorten 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->assertSame( $v, url_shorten( $k ) );
-               }
-
-               // Shorten to 31 if > 34 after cleaning.
-               $this->assertSame( 'wordpress.org/about/philosophy/#&hellip;', url_shorten( 'http://wordpress.org/about/philosophy/#decisions' ), 31 );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingUrlencodeDeepphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/UrlencodeDeep.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/UrlencodeDeep.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/UrlencodeDeep.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,46 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @ticket 22300
- */
-class Tests_Formatting_UrlencodeDeep extends WP_UnitTestCase {
-
-       /**
-        * Data Provider
-        */
-       public function data_test_values() {
-               return array(
-                       array( 'qwerty123456', 'qwerty123456' ),
-                       array( '|!"£$%&/()=?', '%7C%21%22%C2%A3%24%25%26%2F%28%29%3D%3F' ),
-                       array( '^é*ç°§;:_-.,', '%5E%C3%A9%2A%C3%A7%C2%B0%C2%A7%3B%3A_-.%2C' ),
-                       array( 'abc123 @#[]€', 'abc123+%40%23%5B%5D%E2%82%AC' ),
-                       array( 'abc123 @#[]€', urlencode( 'abc123 @#[]€' ) ),
-               );
-       }
-
-       /**
-        * Validate the urlencode_deep function pair by pair
-        *
-        * @dataProvider data_test_values
-        *
-        * @param string $actual
-        * @param string $expected
-        */
-       public function test_urlencode_deep_should_encode_individual_value( $actual, $expected ) {
-               $this->assertSame( $expected, urlencode_deep( $actual ) );
-       }
-
-       /**
-        * Test the whole array as input
-        */
-       public function test_urlencode_deep_should_encode_all_values_in_array() {
-               $data = $this->data_test_values();
-
-               $actual   = wp_list_pluck( $data, 0 );
-               $expected = wp_list_pluck( $data, 1 );
-
-               $this->assertSame( $expected, urlencode_deep( $actual ) );
-       }
-
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingUtf8UriEncodephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/Utf8UriEncode.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/Utf8UriEncode.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/Utf8UriEncode.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,36 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?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->assertSame( $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;
-       }
-}
-
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWPBasenamephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WPBasename.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WPBasename.php       2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WPBasename.php 2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,42 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_WP_Basename extends WP_UnitTestCase {
-
-       function test_wp_basename_unix() {
-               $this->assertSame(
-                       'file',
-                       wp_basename( '/home/test/file' )
-               );
-       }
-
-       function test_wp_basename_unix_utf8_support() {
-               $this->assertSame(
-                       'žluťoučký kůň.txt',
-                       wp_basename( '/test/žluťoučký kůň.txt' )
-               );
-       }
-
-       /**
-        * @ticket 22138
-        */
-       function test_wp_basename_windows() {
-               $this->assertSame(
-                       'file.txt',
-                       wp_basename( 'C:\Documents and Settings\User\file.txt' )
-               );
-       }
-
-       /**
-        * @ticket 22138
-        */
-       function test_wp_basename_windows_utf8_support() {
-               $this->assertSame(
-                       'щипцы.txt',
-                       wp_basename( 'C:\test\щипцы.txt' )
-               );
-       }
-
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWPMakeLinkRelativephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WPMakeLinkRelative.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WPMakeLinkRelative.php       2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WPMakeLinkRelative.php 2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,47 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_WPMakeLinkRelative extends WP_UnitTestCase {
-
-       public function test_wp_make_link_relative_with_http_scheme() {
-               $link          = 'http://example.com/this-is-a-test-http-url/';
-               $relative_link = wp_make_link_relative( $link );
-               $this->assertSame( '/this-is-a-test-http-url/', $relative_link );
-       }
-
-       public function test_wp_make_link_relative_with_https_scheme() {
-               $link          = 'https://example.com/this-is-a-test-https-url/';
-               $relative_link = wp_make_link_relative( $link );
-               $this->assertSame( '/this-is-a-test-https-url/', $relative_link );
-       }
-
-       /**
-        * @ticket 30373
-        */
-       public function test_wp_make_link_relative_with_no_scheme() {
-               $link          = '//example.com/this-is-a-test-schemeless-url/';
-               $relative_link = wp_make_link_relative( $link );
-               $this->assertSame( '/this-is-a-test-schemeless-url/', $relative_link );
-       }
-
-       /**
-        * @ticket 30373
-        */
-       public function test_wp_make_link_relative_should_retain_URL_param_that_is_also_a_URL() {
-               $link          = 'https://example.com/this-is-a-test/?redirect=https://example.org/a-different-test-post/';
-               $relative_link = wp_make_link_relative( $link );
-               $this->assertSame( '/this-is-a-test/?redirect=https://example.org/a-different-test-post/', $relative_link );
-       }
-
-       /**
-        * @ticket 26819
-        */
-       function test_wp_make_link_relative_with_no_path() {
-               $link          = 'http://example.com';
-               $relative_link = wp_make_link_relative( $link );
-               $this->assertSame( '', $relative_link );
-       }
-
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWPRelNoFollowphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WPRelNoFollow.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WPRelNoFollow.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WPRelNoFollow.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,83 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Rel_No_Follow extends WP_UnitTestCase {
-
-       /**
-        * @ticket 9959
-        */
-       public function test_add_no_follow() {
-               $content  = '<p>This is some cool <a href="/">Code</a></p>';
-               $expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow\">Code</a></p>';
-               $this->assertSame( $expected, wp_rel_nofollow( $content ) );
-       }
-
-       /**
-        * @ticket 9959
-        */
-       public function test_convert_no_follow() {
-               $content  = '<p>This is some cool <a href="/" rel="weird">Code</a></p>';
-               $expected = '<p>This is some cool <a href=\"/\" rel=\"weird nofollow\">Code</a></p>';
-               $this->assertSame( $expected, wp_rel_nofollow( $content ) );
-       }
-
-       /**
-        * @ticket 11360
-        * @dataProvider data_wp_rel_nofollow
-        */
-       public function test_wp_rel_nofollow( $input, $output ) {
-               return $this->assertSame( wp_slash( $output ), wp_rel_nofollow( $input ) );
-       }
-
-       public function data_wp_rel_nofollow() {
-               $home_url_http  = set_url_scheme( home_url(), 'http' );
-               $home_url_https = set_url_scheme( home_url(), 'https' );
-
-               return array(
-                       array(
-                               '<a href="">Double Quotes</a>',
-                               '<a href="" rel="nofollow">Double Quotes</a>',
-                       ),
-                       array(
-                               '<a href="https://wordpress.org">Double Quotes</a>',
-                               '<a href="https://wordpress.org" rel="nofollow">Double Quotes</a>',
-                       ),
-                       array(
-                               "<a href='https://wordpress.org'>Single Quotes</a>",
-                               "<a href='https://wordpress.org' rel=\"nofollow\">Single Quotes</a>",
-                       ),
-                       array(
-                               '<a href="https://wordpress.org" title="Title">Multiple attributes</a>',
-                               '<a href="https://wordpress.org" title="Title" rel="nofollow">Multiple attributes</a>',
-                       ),
-                       array(
-                               '<a title="Title" href="https://wordpress.org">Multiple attributes</a>',
-                               '<a title="Title" href="https://wordpress.org" rel="nofollow">Multiple attributes</a>',
-                       ),
-                       array(
-                               '<a data-someflag href="https://wordpress.org">Multiple attributes</a>',
-                               '<a data-someflag href="https://wordpress.org" rel="nofollow">Multiple attributes</a>',
-                       ),
-                       array(
-                               '<a  data-someflag  title="Title"  href="https://wordpress.org" onclick=""  >Everything at once</a>',
-                               '<a  data-someflag  title="Title"  href="https://wordpress.org" onclick=""   rel="nofollow">Everything at once</a>',
-                       ),
-                       array(
-                               '<a href="' . $home_url_http . '/some-url">Home URL (http)</a>',
-                               '<a href="' . $home_url_http . '/some-url">Home URL (http)</a>',
-                       ),
-                       array(
-                               '<a href="' . $home_url_https . '/some-url">Home URL (https)</a>',
-                               '<a href="' . $home_url_https . '/some-url">Home URL (https)</a>',
-                       ),
-               );
-       }
-
-       public function test_append_no_follow_with_valueless_attribute() {
-               $content  = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>';
-               $expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow\">Code</a></p>';
-               $this->assertSame( $expected, wp_rel_nofollow( $content ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWPRelUgcphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WPRelUgc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WPRelUgc.php 2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WPRelUgc.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,83 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Rel_Ugc extends WP_UnitTestCase {
-
-       /**
-        * @ticket 48022
-        */
-       public function test_add_ugc() {
-               $content  = '<p>This is some cool <a href="/">Code</a></p>';
-               $expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow ugc\">Code</a></p>';
-               $this->assertSame( $expected, wp_rel_ugc( $content ) );
-       }
-
-       /**
-        * @ticket 48022
-        */
-       public function test_convert_ugc() {
-               $content  = '<p>This is some cool <a href="/" rel="weird">Code</a></p>';
-               $expected = '<p>This is some cool <a href=\"/\" rel=\"weird nofollow ugc\">Code</a></p>';
-               $this->assertSame( $expected, wp_rel_ugc( $content ) );
-       }
-
-       /**
-        * @ticket 48022
-        * @dataProvider data_wp_rel_ugc
-        */
-       public function test_wp_rel_ugc( $input, $output ) {
-               return $this->assertSame( wp_slash( $output ), wp_rel_ugc( $input ) );
-       }
-
-       public function data_wp_rel_ugc() {
-               $home_url_http  = set_url_scheme( home_url(), 'http' );
-               $home_url_https = set_url_scheme( home_url(), 'https' );
-
-               return array(
-                       array(
-                               '<a href="">Double Quotes</a>',
-                               '<a href="" rel="nofollow ugc">Double Quotes</a>',
-                       ),
-                       array(
-                               '<a href="https://wordpress.org">Double Quotes</a>',
-                               '<a href="https://wordpress.org" rel="nofollow ugc">Double Quotes</a>',
-                       ),
-                       array(
-                               "<a href='https://wordpress.org'>Single Quotes</a>",
-                               "<a href='https://wordpress.org' rel=\"nofollow ugc\">Single Quotes</a>",
-                       ),
-                       array(
-                               '<a href="https://wordpress.org" title="Title">Multiple attributes</a>',
-                               '<a href="https://wordpress.org" title="Title" rel="nofollow ugc">Multiple attributes</a>',
-                       ),
-                       array(
-                               '<a title="Title" href="https://wordpress.org">Multiple attributes</a>',
-                               '<a title="Title" href="https://wordpress.org" rel="nofollow ugc">Multiple attributes</a>',
-                       ),
-                       array(
-                               '<a data-someflag href="https://wordpress.org">Multiple attributes</a>',
-                               '<a data-someflag href="https://wordpress.org" rel="nofollow ugc">Multiple attributes</a>',
-                       ),
-                       array(
-                               '<a  data-someflag  title="Title"  href="https://wordpress.org" onclick=""  >Everything at once</a>',
-                               '<a  data-someflag  title="Title"  href="https://wordpress.org" onclick=""   rel="nofollow ugc">Everything at once</a>',
-                       ),
-                       array(
-                               '<a href="' . $home_url_http . '/some-url">Home URL (http)</a>',
-                               '<a href="' . $home_url_http . '/some-url">Home URL (http)</a>',
-                       ),
-                       array(
-                               '<a href="' . $home_url_https . '/some-url">Home URL (https)</a>',
-                               '<a href="' . $home_url_https . '/some-url">Home URL (https)</a>',
-                       ),
-               );
-       }
-
-       public function test_append_ugc_with_valueless_attribute() {
-               $content  = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>';
-               $expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow ugc\">Code</a></p>';
-               $this->assertSame( $expected, wp_rel_ugc( $content ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWPSlashphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WPSlash.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WPSlash.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WPSlash.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,103 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_WPSlash extends WP_UnitTestCase {
-
-       /**
-        * @ticket 42195
-        *
-        * @dataProvider data_wp_slash
-        *
-        * @param string $value
-        * @param string $expected
-        */
-       public function test_wp_slash( $value, $expected ) {
-               $this->assertSame( $expected, wp_slash( $value ) );
-       }
-
-       /**
-        * Data provider for test_wp_slash().
-        *
-        * @return array {
-        *     @type array {
-        *         @type mixed  $value    The value passed to wp_slash().
-        *         @type string $expected The expected output of wp_slash().
-        *     }
-        * }
-        */
-       public function data_wp_slash() {
-               return array(
-                       array( 123, 123 ),
-                       array( 123.4, 123.4 ),
-                       array( true, true ),
-                       array( false, false ),
-                       array(
-                               array(
-                                       'hello',
-                                       null,
-                                       '"string"',
-                                       125.41,
-                               ),
-                               array(
-                                       'hello',
-                                       null,
-                                       '\"string\"',
-                                       125.41,
-                               ),
-                       ),
-                       array( "first level 'string'", "first level \'string\'" ),
-               );
-       }
-
-       /**
-        * @ticket 24106
-        */
-       function test_adds_slashes() {
-               $old = "I can't see, isn't that it?";
-               $new = "I can\'t see, isn\'t that it?";
-               $this->assertSame( $new, wp_slash( $old ) );
-               $this->assertSame( "I can\\\\\'t see, isn\\\\\'t that it?", wp_slash( $new ) );
-               $this->assertSame( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array.
-               $this->assertSame( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed.
-       }
-
-       /**
-        * @ticket 24106
-        */
-       function test_preserves_original_datatype() {
-
-               $this->assertTrue( wp_slash( true ) );
-               $this->assertFalse( wp_slash( false ) );
-               $this->assertSame( 4, wp_slash( 4 ) );
-               $this->assertSame( 'foo', wp_slash( 'foo' ) );
-               $arr      = array(
-                       'a' => true,
-                       'b' => false,
-                       'c' => 4,
-                       'd' => 'foo',
-               );
-               $arr['e'] = $arr; // Add a sub-array.
-               $this->assertSame( $arr, wp_slash( $arr ) ); // Keyed array.
-               $this->assertSame( array_values( $arr ), wp_slash( array_values( $arr ) ) ); // Non-keyed.
-
-               $obj = new stdClass;
-               foreach ( $arr as $k => $v ) {
-                       $obj->$k = $v;
-               }
-               $this->assertSame( $obj, wp_slash( $obj ) );
-       }
-
-       /**
-        * @ticket 24106
-        */
-       function test_add_even_more_slashes() {
-               $old = 'single\\slash double\\\\slash triple\\\\\\slash';
-               $new = 'single\\\\slash double\\\\\\\\slash triple\\\\\\\\\\\\slash';
-               $this->assertSame( $new, wp_slash( $old ) );
-               $this->assertSame( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array.
-               $this->assertSame( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed.
-       }
-
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWPSpecialcharsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WPSpecialchars.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WPSpecialchars.php   2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WPSpecialchars.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,100 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_WPSpecialchars extends WP_UnitTestCase {
-       function test_wp_specialchars_basics() {
-               $html = '&amp;&lt;hello world&gt;';
-               $this->assertSame( $html, _wp_specialchars( $html ) );
-
-               $double = '&amp;amp;&amp;lt;hello world&amp;gt;';
-               $this->assertSame( $double, _wp_specialchars( $html, ENT_NOQUOTES, false, true ) );
-       }
-
-       function test_allowed_entity_names() {
-               global $allowedentitynames;
-
-               // Allowed entities should be unchanged.
-               foreach ( $allowedentitynames as $ent ) {
-                       if ( 'apos' === $ent ) {
-                               // But for some reason, PHP doesn't allow &apos;
-                               continue;
-                       }
-                       $ent = '&' . $ent . ';';
-                       $this->assertSame( $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->assertSame( $escaped, _wp_specialchars( $ent ) );
-               }
-       }
-
-       function test_optionally_escapes_quotes() {
-               $source = "\"'hello!'\"";
-               $this->assertSame( '"&#039;hello!&#039;"', _wp_specialchars( $source, 'single' ) );
-               $this->assertSame( "&quot;'hello!'&quot;", _wp_specialchars( $source, 'double' ) );
-               $this->assertSame( '&quot;&#039;hello!&#039;&quot;', _wp_specialchars( $source, true ) );
-               $this->assertSame( $source, _wp_specialchars( $source ) );
-       }
-
-       /**
-        * Check some of the double-encoding features for entity references.
-        *
-        * @ticket 17780
-        * @dataProvider data_double_encoding
-        */
-       function test_double_encoding( $input, $output ) {
-               return $this->assertSame( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, true ) );
-       }
-
-       function data_double_encoding() {
-               return array(
-                       array(
-                               'This & that, this &amp; that, &#8212; &quot; &QUOT; &Uacute; &nbsp; &#34; &#034; &#0034; &#x00022; &#x22; &dollar; &times;',
-                               'This &amp; that, this &amp;amp; that, &amp;#8212; &amp;quot; &amp;QUOT; &amp;Uacute; &amp;nbsp; &amp;#34; &amp;#034; &amp;#0034; &amp;#x00022; &amp;#x22; &amp;dollar; &amp;times;',
-                       ),
-                       array(
-                               '&& &&amp; &amp;&amp; &amp;;',
-                               '&amp;&amp; &amp;&amp;amp; &amp;amp;&amp;amp; &amp;amp;;',
-                       ),
-                       array(
-                               '&garbage; &***; &aaaa; &0000; &####; &;;',
-                               '&amp;garbage; &amp;***; &amp;aaaa; &amp;0000; &amp;####; &amp;;;',
-                       ),
-               );
-       }
-
-       /**
-        * Check some of the double-encoding features for entity references.
-        *
-        * @ticket 17780
-        * @dataProvider data_no_double_encoding
-        */
-       function test_no_double_encoding( $input, $output ) {
-               return $this->assertSame( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, false ) );
-       }
-
-       function data_no_double_encoding() {
-               return array(
-                       array(
-                               'This & that, this &amp; that, &#8212; &quot; &QUOT; &Uacute; &nbsp; &#34; &#034; &#0034; &#x00022; &#x22; &dollar; &times;',
-                               'This &amp; that, this &amp; that, &#8212; &quot; &amp;QUOT; &Uacute; &nbsp; &#034; &#034; &#034; &#x22; &#x22; &amp;dollar; &times;',
-                       ),
-                       array(
-                               '&& &&amp; &amp;&amp; &amp;;',
-                               '&amp;&amp; &amp;&amp; &amp;&amp; &amp;;',
-                       ),
-                       array(
-                               '&garbage; &***; &aaaa; &0000; &####; &;;',
-                               '&amp;garbage; &amp;***; &amp;aaaa; &amp;0000; &amp;####; &amp;;;',
-                       ),
-               );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWPStripAllTagsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WPStripAllTags.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WPStripAllTags.php   2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WPStripAllTags.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,33 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-/**
- * Test wp_strip_all_tags()
- *
- * @group formatting
- */
-class Tests_Formatting_WPStripAllTags extends WP_UnitTestCase {
-
-       function test_wp_strip_all_tags() {
-
-               $text = 'lorem<br />ipsum';
-               $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
-
-               $text = "lorem<br />\nipsum";
-               $this->assertSame( "lorem\nipsum", wp_strip_all_tags( $text ) );
-
-               // Test removing breaks is working.
-               $text = 'lorem<br />ipsum';
-               $this->assertSame( 'loremipsum', wp_strip_all_tags( $text, true ) );
-
-               // Test script / style tag's contents is removed.
-               $text = 'lorem<script>alert(document.cookie)</script>ipsum';
-               $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
-
-               $text = "lorem<style>* { display: 'none' }</style>ipsum";
-               $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
-
-               // Test "marlformed" markup of contents.
-               $text = "lorem<style>* { display: 'none' }<script>alert( document.cookie )</script></style>ipsum";
-               $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
-       }
-}
-
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWPTargetedLinkRelphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WPTargetedLinkRel.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WPTargetedLinkRel.php        2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WPTargetedLinkRel.php  2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,138 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @ticket 43187
- */
-class Tests_Targeted_Link_Rel extends WP_UnitTestCase {
-
-       public function test_add_to_links_with_target_blank() {
-               $content  = '<p>Links: <a href="/" target="_blank">No rel</a></p>';
-               $expected = '<p>Links: <a href="/" target="_blank" rel="noopener">No rel</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       public function test_add_to_links_with_target_foo() {
-               $content  = '<p>Links: <a href="/" target="foo">No rel</a></p>';
-               $expected = '<p>Links: <a href="/" target="foo" rel="noopener">No rel</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       public function test_target_as_first_attribute() {
-               $content  = '<p>Links: <a target="_blank" href="#">No rel</a></p>';
-               $expected = '<p>Links: <a target="_blank" href="#" rel="noopener">No rel</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       public function test_add_to_existing_rel() {
-               $content  = '<p>Links: <a href="/" rel="existing values" target="_blank">Existing rel</a></p>';
-               $expected = '<p>Links: <a href="/" rel="existing values noopener" target="_blank">Existing rel</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       public function test_no_duplicate_values_added() {
-               $content  = '<p>Links: <a href="/" rel="existing noopener values" target="_blank">Existing rel</a></p>';
-               $expected = '<p>Links: <a href="/" rel="existing noopener values" target="_blank">Existing rel</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       public function test_rel_with_single_quote_delimiter() {
-               $content  = '<p>Links: <a href="/" rel=\'existing values\' target="_blank">Existing rel</a></p>';
-               $expected = '<p>Links: <a href="/" rel="existing values noopener" target="_blank">Existing rel</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       public function test_rel_with_no_delimiter() {
-               $content  = '<p>Links: <a href="/" rel=existing target="_blank">Existing rel</a></p>';
-               $expected = '<p>Links: <a href="/" rel="existing noopener" target="_blank">Existing rel</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       public function test_rel_value_spaced_and_no_delimiter() {
-               $content  = '<p>Links: <a href="/" rel = existing target="_blank">Existing rel</a></p>';
-               $expected = '<p>Links: <a href="/" rel="existing noopener" target="_blank">Existing rel</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       public function test_escaped_quotes() {
-               $content  = '<p>Links: <a href=\"/\" rel=\"existing values\" target=\"_blank\">Existing rel</a></p>';
-               $expected = '<p>Links: <a href=\"/\" rel=\"existing values noopener\" target=\"_blank\">Existing rel</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       public function test_ignore_links_with_no_target() {
-               $content  = '<p>Links: <a href="/" target="_blank">Change me</a> <a href="/">Do not change me</a></p>';
-               $expected = '<p>Links: <a href="/" target="_blank" rel="noopener">Change me</a> <a href="/">Do not change me</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       /**
-        * Ensure empty rel attributes are not added.
-        *
-        * @ticket 45352
-        */
-       public function test_ignore_if_wp_targeted_link_rel_nulled() {
-               add_filter( 'wp_targeted_link_rel', '__return_empty_string' );
-               $content  = '<p>Links: <a href="/" target="_blank">Do not change me</a></p>';
-               $expected = '<p>Links: <a href="/" target="_blank">Do not change me</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       /**
-        * Ensure default content filters are added.
-        *
-        * @ticket 45292
-        */
-       public function test_wp_targeted_link_rel_filters_run() {
-               $content  = '<p>Links: <a href="/" target="_blank">No rel</a></p>';
-               $expected = '<p>Links: <a href="/" target="_blank" rel="noopener">No rel</a></p>';
-
-               $post = $this->factory()->post->create_and_get(
-                       array(
-                               'post_content' => $content,
-                       )
-               );
-
-               $this->assertSame( $expected, $post->post_content );
-       }
-
-       /**
-        * Ensure JSON format is preserved when relation attribute (rel) is missing.
-        *
-        * @ticket 46316
-        */
-       public function test_wp_targeted_link_rel_should_preserve_json() {
-               $content  = '<p>Links: <a href=\"\/\" target=\"_blank\">No rel<\/a><\/p>';
-               $expected = '<p>Links: <a href=\"\/\" target=\"_blank\" rel=\"noopener\">No rel<\/a><\/p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       /**
-        * Ensure the content of style and script tags are not processed
-        *
-        * @ticket 47244
-        */
-       public function test_wp_targeted_link_rel_skips_style_and_scripts() {
-               $content  = '<style><a href="/" target=a></style><p>Links: <script>console.log("<a href=\'/\' target=a>hi</a>");</script><script>alert(1);</script>here <a href="/" target=_blank>aq</a></p><script>console.log("<a href=\'last\' target=\'_blank\'")</script>';
-               $expected = '<style><a href="/" target=a></style><p>Links: <script>console.log("<a href=\'/\' target=a>hi</a>");</script><script>alert(1);</script>here <a href="/" target="_blank" rel="noopener">aq</a></p><script>console.log("<a href=\'last\' target=\'_blank\'")</script>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       /**
-        * Ensure entirely serialized content is ignored.
-        *
-        * @ticket 46402
-        */
-       public function test_ignore_entirely_serialized_content() {
-               $content  = 'a:1:{s:4:"html";s:52:"<p>Links: <a href="/" target="_blank">No Rel</a></p>";}';
-               $expected = 'a:1:{s:4:"html";s:52:"<p>Links: <a href="/" target="_blank">No Rel</a></p>";}';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-       public function test_wp_targeted_link_rel_tab_separated_values_are_split() {
-               $content  = "<p>Links: <a href=\"/\" target=\"_blank\" rel=\"ugc\t\tnoopener\t\">No rel</a></p>";
-               $expected = '<p>Links: <a href="/" target="_blank" rel="ugc noopener">No rel</a></p>';
-               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
-       }
-
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWPTexturizephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WPTexturize.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WPTexturize.php      2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WPTexturize.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,2113 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_WPTexturize extends WP_UnitTestCase {
-       function test_dashes() {
-               $this->assertSame( 'Hey &#8212; boo?', wptexturize( 'Hey -- boo?' ) );
-               $this->assertSame( '<a href="http://xx--xx">Hey &#8212; boo?</a>', wptexturize( '<a href="http://xx--xx">Hey -- boo?</a>' ) );
-       }
-
-       function test_disable() {
-               $this->assertSame( '<pre>---&</pre>', wptexturize( '<pre>---&</pre>' ) );
-               $this->assertSame( '<pre><code></code>--&</pre>', wptexturize( '<pre><code></code>--&</pre>' ) );
-
-               $this->assertSame( '<code>---&</code>', wptexturize( '<code>---&</code>' ) );
-               $this->assertSame( '<kbd>---&</kbd>', wptexturize( '<kbd>---&</kbd>' ) );
-               $this->assertSame( '<style>---&</style>', wptexturize( '<style>---&</style>' ) );
-               $this->assertSame( '<script>---&</script>', wptexturize( '<script>---&</script>' ) );
-               $this->assertSame( '<tt>---&</tt>', wptexturize( '<tt>---&</tt>' ) );
-
-               $this->assertSame( '<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->assertSame( $enabled_tags_inside_code, wptexturize( $enabled_tags_inside_code ) );
-
-               $double_nest = '<pre>"baba"<code>"baba"<pre></pre></code>"baba"</pre>';
-               $this->assertSame( $double_nest, wptexturize( $double_nest ) );
-
-               $invalid_nest = '<pre></code>"baba"</pre>';
-               $this->assertSame( $invalid_nest, wptexturize( $invalid_nest ) );
-
-       }
-
-       /**
-        * @ticket 1418
-        */
-       function test_bracketed_quotes_1418() {
-               $this->assertSame( '(&#8220;test&#8221;)', wptexturize( '("test")' ) );
-               $this->assertSame( '(&#8216;test&#8217;)', wptexturize( "('test')" ) );
-               $this->assertSame( '(&#8217;twas)', wptexturize( "('twas)" ) );
-       }
-
-       /**
-        * @ticket 3810
-        */
-       function test_bracketed_quotes_3810() {
-               $this->assertSame( 'A dog (&#8220;Hubertus&#8221;) was sent out.', wptexturize( 'A dog ("Hubertus") was sent out.' ) );
-       }
-
-       /**
-        * @ticket 4539
-        */
-       function test_basic_quotes() {
-               $this->assertSame( 'test&#8217;s', wptexturize( 'test\'s' ) );
-
-               $this->assertSame( '&#8216;quoted&#8217;', wptexturize( '\'quoted\'' ) );
-               $this->assertSame( '&#8220;quoted&#8221;', wptexturize( '"quoted"' ) );
-
-               $this->assertSame( 'space before &#8216;quoted&#8217; space after', wptexturize( 'space before \'quoted\' space after' ) );
-               $this->assertSame( 'space before &#8220;quoted&#8221; space after', wptexturize( 'space before "quoted" space after' ) );
-
-               $this->assertSame( '(&#8216;quoted&#8217;)', wptexturize( '(\'quoted\')' ) );
-               $this->assertSame( '{&#8220;quoted&#8221;}', wptexturize( '{"quoted"}' ) );
-
-               $this->assertSame( '&#8216;qu(ot)ed&#8217;', wptexturize( '\'qu(ot)ed\'' ) );
-               $this->assertSame( '&#8220;qu{ot}ed&#8221;', wptexturize( '"qu{ot}ed"' ) );
-
-               $this->assertSame( ' &#8216;test&#8217;s quoted&#8217; ', wptexturize( ' \'test\'s quoted\' ' ) );
-               $this->assertSame( ' &#8220;test&#8217;s quoted&#8221; ', wptexturize( ' "test\'s quoted" ' ) );
-       }
-
-       /**
-        * @ticket 4539
-        * @ticket 15241
-        */
-       function test_full_sentences_with_unmatched_single_quotes() {
-               $this->assertSame(
-                       '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->assertSame( '&#8220;Quoted String&#8221;', wptexturize( '"Quoted String"' ) );
-               // $this->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( 'A test with a finishing number, &#8220;like 23&#8221;.', wptexturize( 'A test with a finishing number, "like 23".' ) );
-               $this->assertSame( '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->assertSame( 'test&#8217;s', wptexturize( "test's" ) );
-               $this->assertSame( '&#8216;test&#8217;s', wptexturize( "'test's" ) );
-               $this->assertSame( '&#8216;test&#8217;s&#8217;', wptexturize( "'test's'" ) );
-               $this->assertSame( '&#8216;string&#8217;', wptexturize( "'string'" ) );
-               $this->assertSame( '&#8216;string&#8217;s&#8217;', wptexturize( "'string's'" ) );
-       }
-
-       /**
-        * @ticket 4539
-        */
-       function test_quotes_before_numbers() {
-               $this->assertSame( 'Class of &#8217;99', wptexturize( "Class of '99" ) );
-               $this->assertSame( 'Class of &#8217;99&#8217;s', wptexturize( "Class of '99's" ) );
-               $this->assertSame( '&#8216;Class of &#8217;99&#8217;', wptexturize( "'Class of '99'" ) );
-               $this->assertSame( '&#8216;Class of &#8217;99&#8217; ', wptexturize( "'Class of '99' " ) );
-               $this->assertSame( '&#8216;Class of &#8217;99&#8217;.', wptexturize( "'Class of '99'." ) );
-               $this->assertSame( '&#8216;Class of &#8217;99&#8217;, she said', wptexturize( "'Class of '99', she said" ) );
-               $this->assertSame( '&#8216;Class of &#8217;99&#8217;:', wptexturize( "'Class of '99':" ) );
-               $this->assertSame( '&#8216;Class of &#8217;99&#8217;;', wptexturize( "'Class of '99';" ) );
-               $this->assertSame( '&#8216;Class of &#8217;99&#8217;!', wptexturize( "'Class of '99'!" ) );
-               $this->assertSame( '&#8216;Class of &#8217;99&#8217;?', wptexturize( "'Class of '99'?" ) );
-               $this->assertSame( '&#8216;Class of &#8217;99&#8217;s&#8217;', wptexturize( "'Class of '99's'" ) );
-               $this->assertSame( '&#8216;Class of &#8217;99&#8217;s&#8217;', wptexturize( "'Class of '99&#8217;s'" ) );
-               $this->assertSame( '&#8220;Class of 99&#8221;', wptexturize( '"Class of 99"' ) );
-               $this->assertSame( '&#8220;Class of &#8217;99&#8221;', wptexturize( "\"Class of '99\"" ) );
-               $this->assertSame( '{&#8220;Class of &#8217;99&#8221;}', wptexturize( "{\"Class of '99\"}" ) );
-               $this->assertSame( ' &#8220;Class of &#8217;99&#8221; ', wptexturize( " \"Class of '99\" " ) );
-               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;.', wptexturize( " \"Class of '99\"." ) );
-               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;, she said', wptexturize( " \"Class of '99\", she said" ) );
-               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;:', wptexturize( " \"Class of '99\":" ) );
-               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;;', wptexturize( " \"Class of '99\";" ) );
-               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;!', wptexturize( " \"Class of '99\"!" ) );
-               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;?', wptexturize( " \"Class of '99\"?" ) );
-               // Not a quotation, may be between two other quotations.
-               $this->assertSame( '}&#8221;Class of &#8217;99&#8243;{', wptexturize( "}\"Class of '99\"{" ) );
-       }
-
-       function test_quotes_after_numbers() {
-               $this->assertSame( 'Class of &#8217;99', wptexturize( "Class of '99" ) );
-       }
-
-       /**
-        * @ticket 4539
-        * @ticket 15241
-        */
-       function test_other_html() {
-               $this->assertSame( '&#8216;<strong>', wptexturize( "'<strong>" ) );
-               // $this->assertSame( '&#8216;<strong>Quoted Text</strong>&#8217;,', wptexturize( "'<strong>Quoted Text</strong>'," ) );
-               // $this->assertSame( '&#8220;<strong>Quoted Text</strong>&#8221;,', wptexturize( '"<strong>Quoted Text</strong>",' ) );
-       }
-
-       function test_x() {
-               $this->assertSame( '14&#215;24', wptexturize( '14x24' ) );
-       }
-
-       function test_minutes_seconds() {
-               $this->assertSame( '9&#8242;', wptexturize( '9\'' ) );
-               $this->assertSame( '9&#8243;', wptexturize( '9"' ) );
-
-               $this->assertSame( 'a 9&#8242; b', wptexturize( 'a 9\' b' ) );
-               $this->assertSame( 'a 9&#8243; b', wptexturize( 'a 9" b' ) );
-
-               $this->assertSame( '&#8220;a 9&#8242; b&#8221;', wptexturize( '"a 9\' b"' ) );
-               $this->assertSame( '&#8216;a 9&#8243; b&#8217;', wptexturize( "'a 9\" b'" ) );
-       }
-
-       /**
-        * @ticket 8775
-        */
-       function test_wptexturize_quotes_around_numbers() {
-               $this->assertSame( '&#8220;12345&#8221;', wptexturize( '"12345"' ) );
-               $this->assertSame( '&#8216;12345&#8217;', wptexturize( '\'12345\'' ) );
-               $this->assertSame( '&#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->assertSame( '<p>&#8217;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->assertSame( '<!--[if !IE]>--><!--<![endif]-->', wptexturize( '<!--[if !IE]>--><!--<![endif]-->' ) );
-               $this->assertSame( '<!--[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->assertSame( '<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->assertSame( '&nbsp;&#8220;Testing&#8221;', wptexturize( '&nbsp;"Testing"' ) );
-               // $this->assertSame( '&#38;&#8220;Testing&#8221;', wptexturize( '&#38;"Testing"' ) );
-       }
-
-       /**
-        * @ticket 22823
-        */
-       function test_apostrophes_before_primes() {
-               $this->assertSame( 'WordPress 3.5&#8217;s release date', wptexturize( "WordPress 3.5's release date" ) );
-       }
-
-       /**
-        * @ticket 23185
-        */
-       function test_spaces_around_hyphens() {
-               $nbsp = "\xC2\xA0";
-
-               $this->assertSame( ' &#8211; ', wptexturize( ' - ' ) );
-               $this->assertSame( '&nbsp;&#8211;&nbsp;', wptexturize( '&nbsp;-&nbsp;' ) );
-               $this->assertSame( ' &#8211;&nbsp;', wptexturize( ' -&nbsp;' ) );
-               $this->assertSame( '&nbsp;&#8211; ', wptexturize( '&nbsp;- ' ) );
-               $this->assertSame( "$nbsp&#8211;$nbsp", wptexturize( "$nbsp-$nbsp" ) );
-               $this->assertSame( " &#8211;$nbsp", wptexturize( " -$nbsp" ) );
-               $this->assertSame( "$nbsp&#8211; ", wptexturize( "$nbsp- " ) );
-
-               $this->assertSame( ' &#8212; ', wptexturize( ' -- ' ) );
-               $this->assertSame( '&nbsp;&#8212;&nbsp;', wptexturize( '&nbsp;--&nbsp;' ) );
-               $this->assertSame( ' &#8212;&nbsp;', wptexturize( ' --&nbsp;' ) );
-               $this->assertSame( '&nbsp;&#8212; ', wptexturize( '&nbsp;-- ' ) );
-               $this->assertSame( "$nbsp&#8212;$nbsp", wptexturize( "$nbsp--$nbsp" ) );
-               $this->assertSame( " &#8212;$nbsp", wptexturize( " --$nbsp" ) );
-               $this->assertSame( "$nbsp&#8212; ", wptexturize( "$nbsp-- " ) );
-       }
-
-       /**
-        * @ticket 31030
-        */
-       function test_hyphens_at_start_and_end() {
-               $this->assertSame( '&#8211; ', wptexturize( '- ' ) );
-               $this->assertSame( '&#8211; &#8211;', wptexturize( '- -' ) );
-               $this->assertSame( ' &#8211;', wptexturize( ' -' ) );
-
-               $this->assertSame( '&#8212; ', wptexturize( '-- ' ) );
-               $this->assertSame( '&#8212; &#8212;', wptexturize( '-- --' ) );
-               $this->assertSame( ' &#8212;', wptexturize( ' --' ) );
-       }
-
-       /**
-        * Test spaces around quotes.
-        *
-        * These should never happen, even if the desired output changes some day.
-        *
-        * @ticket 22692
-        */
-       function test_spaces_around_quotes_never() {
-               $nbsp = "\xC2\xA0";
-
-               $problem_input  = "$nbsp\"A";
-               $problem_output = "$nbsp&#8221;A";
-
-               $this->assertNotEquals( $problem_output, wptexturize( $problem_input ) );
-       }
-
-       /**
-        * Test spaces around quotes.
-        *
-        * These are desirable outputs for the current design.
-        *
-        * @ticket 22692
-        * @dataProvider data_spaces_around_quotes
-        */
-       function test_spaces_around_quotes( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_spaces_around_quotes() {
-               $nbsp = "\xC2\xA0";
-               $pi   = "\xCE\xA0";
-
-               return array(
-                       array(
-                               "stop. $nbsp\"A quote after 2 spaces.\"",
-                               "stop. $nbsp&#8220;A quote after 2 spaces.&#8221;",
-                       ),
-                       array(
-                               "stop.$nbsp$nbsp\"A quote after 2 spaces.\"",
-                               "stop.$nbsp$nbsp&#8220;A quote after 2 spaces.&#8221;",
-                       ),
-                       array(
-                               "stop. $nbsp'A quote after 2 spaces.'",
-                               "stop. $nbsp&#8216;A quote after 2 spaces.&#8217;",
-                       ),
-                       array(
-                               "stop.$nbsp$nbsp'A quote after 2 spaces.'",
-                               "stop.$nbsp$nbsp&#8216;A quote after 2 spaces.&#8217;",
-                       ),
-                       array(
-                               'stop. &nbsp;"A quote after 2 spaces."',
-                               'stop. &nbsp;&#8220;A quote after 2 spaces.&#8221;',
-                       ),
-                       array(
-                               'stop.&nbsp;&nbsp;"A quote after 2 spaces."',
-                               'stop.&nbsp;&nbsp;&#8220;A quote after 2 spaces.&#8221;',
-                       ),
-                       array(
-                               "stop. &nbsp;'A quote after 2 spaces.'",
-                               'stop. &nbsp;&#8216;A quote after 2 spaces.&#8217;',
-                       ),
-                       array(
-                               "stop.&nbsp;&nbsp;'A quote after 2 spaces.'",
-                               'stop.&nbsp;&nbsp;&#8216;A quote after 2 spaces.&#8217;',
-                       ),
-                       array(
-                               "Contraction: $pi's",
-                               "Contraction: $pi&#8217;s",
-                       ),
-               );
-       }
-
-       /**
-        * Apostrophe before a number always becomes &#8217 (apos);
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_apos_before_digits
-        */
-       function test_apos_before_digits( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_apos_before_digits() {
-               return array(
-                       array(
-                               "word '99 word",
-                               'word &#8217;99 word',
-                       ),
-                       array(
-                               "word'99 word",
-                               'word&#8217;99 word',
-                       ),
-                       array(
-                               "word '99word",
-                               'word &#8217;99word',
-                       ),
-                       array(
-                               "word'99word",
-                               'word&#8217;99word',
-                       ),
-                       array(
-                               "word '99&#8217;s word", // Appears as a separate but logically superfluous pattern in 3.8.
-                               'word &#8217;99&#8217;s word',
-                       ),
-                       array(
-                               "according to our source, '33 students scored less than 50' on the test.", // Apostrophes and primes have priority over quotes.
-                               'according to our source, &#8217;33 students scored less than 50&#8242; on the test.',
-                       ),
-               );
-       }
-
-       /**
-        * Apostrophe after a space or ([{<" becomes &#8216; (opening_single_quote)
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_opening_single_quote
-        */
-       function test_opening_single_quote( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_opening_single_quote() {
-               return array(
-                       array(
-                               "word 'word word",
-                               'word &#8216;word word',
-                       ),
-                       array(
-                               "word ('word word",
-                               'word (&#8216;word word',
-                       ),
-                       array(
-                               "word ['word word",
-                               'word [&#8216;word word',
-                       ),
-                       array(
-                               "word <'word word",    // Invalid HTML.
-                               "word <'word word",
-                       ),
-                       array(
-                               "word &lt;'word word", // Valid HTML input makes curly quotes.
-                               'word &lt;&#8216;word word',
-                       ),
-                       array(
-                               "word {'word word",
-                               'word {&#8216;word word',
-                       ),
-                       array(
-                               "word \"'word word",
-                               'word &#8220;&#8216;word word', // Two opening quotes.
-                       ),
-                       array(
-                               "'word word",
-                               '&#8216;word word',
-                       ),
-                       array(
-                               "word('word word",
-                               'word(&#8216;word word',
-                       ),
-                       array(
-                               "word['word word",
-                               'word[&#8216;word word',
-                       ),
-                       array(
-                               "word<'word word",
-                               "word<'word word",
-                       ),
-                       array(
-                               "word&lt;'word word",
-                               'word&lt;&#8216;word word',
-                       ),
-                       array(
-                               "word{'word word",
-                               'word{&#8216;word word',
-                       ),
-                       array(
-                               "word\"'word word",
-                               'word&#8221;&#8216;word word', // Closing quote, then opening quote.
-                       ),
-                       array(
-                               "word ' word word",
-                               'word &#8216; word word',
-                       ),
-                       array(
-                               "word (' word word",
-                               'word (&#8216; word word',
-                       ),
-                       array(
-                               "word [' word word",
-                               'word [&#8216; word word',
-                       ),
-                       array(
-                               "word <' word word",
-                               "word <' word word",
-                       ),
-                       array(
-                               "word &lt;' word word",
-                               'word &lt;&#8216; word word',
-                       ),
-                       array(
-                               "word {' word word",
-                               'word {&#8216; word word',
-                       ),
-                       array(
-                               "word \"' word word",
-                               'word &#8220;&#8216; word word', // Two opening quotes.
-                       ),
-                       array(
-                               "' word word",
-                               '&#8216; word word',
-                       ),
-                       array(
-                               "word(' word word",
-                               'word(&#8216; word word',
-                       ),
-                       array(
-                               "word[' word word",
-                               'word[&#8216; word word',
-                       ),
-                       array(
-                               "word<' word word",
-                               "word<' word word",
-                       ),
-                       array(
-                               "word&lt;' word word",
-                               'word&lt;&#8216; word word',
-                       ),
-                       array(
-                               "word{' word word",
-                               'word{&#8216; word word',
-                       ),
-                       array(
-                               "word\"' word word",
-                               'word&#8221;&#8216; word word', // Closing quote, then opening quote.
-                       ),
-               );
-       }
-
-       /**
-        * Double quote after a number becomes &#8243; (double_prime)
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_double_prime
-        */
-       function test_double_prime( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_double_prime() {
-               return array(
-                       array(
-                               'word 99" word',
-                               'word 99&#8243; word',
-                       ),
-                       array(
-                               'word 99"word',
-                               'word 99&#8243;word',
-                       ),
-                       array(
-                               'word99" word',
-                               'word99&#8243; word',
-                       ),
-                       array(
-                               'word99"word',
-                               'word99&#8243;word',
-                       ),
-               );
-       }
-
-       /**
-        * Apostrophe after a number becomes &#8242; (prime)
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_single_prime
-        */
-       function test_single_prime( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_single_prime() {
-               return array(
-                       array(
-                               "word 99' word",
-                               'word 99&#8242; word',
-                       ),
-                       array(
-                               "word 99'word", // Not a prime anymore. Apostrophes get priority.
-                               'word 99&#8217;word',
-                       ),
-                       array(
-                               "word99' word",
-                               'word99&#8242; word',
-                       ),
-                       array(
-                               "word99'word",  // Not a prime anymore.
-                               'word99&#8217;word',
-                       ),
-               );
-       }
-
-       /**
-        * Apostrophe "in a word" becomes &#8217; (apos)
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_contractions
-        */
-       function test_contractions( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_contractions() {
-               return array(
-                       array(
-                               "word word's word",
-                               'word word&#8217;s word',
-                       ),
-                       array(
-                               "word'[ word", // Apostrophes are never followed by opening punctuation.
-                               "word'[ word",
-                       ),
-                       array(
-                               "word'( word",
-                               "word'( word",
-                       ),
-                       array(
-                               "word'{ word",
-                               "word'{ word",
-                       ),
-                       array(
-                               "word'&lt; word",
-                               "word'&lt; word",
-                       ),
-                       array(
-                               "word'< word", // Invalid HTML input does trigger the apos pattern.
-                               'word&#8217;< word',
-                       ),
-               );
-       }
-
-       /**
-        * Double quote after a space or ([-{< becomes &#8220; (opening_quote) if not followed by spaces
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_opening_quote
-        */
-       function test_opening_quote( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_opening_quote() {
-               return array(
-                       array(
-                               'word "word word',
-                               'word &#8220;word word',
-                       ),
-                       array(
-                               'word ("word word',
-                               'word (&#8220;word word',
-                       ),
-                       array(
-                               'word ["word word',
-                               'word [&#8220;word word',
-                       ),
-                       array(
-                               'word <"word word', // Invalid HTML.
-                               'word <"word word',
-                       ),
-                       array(
-                               'word &lt;"word word',
-                               'word &lt;&#8220;word word',
-                       ),
-                       array(
-                               'word {"word word',
-                               'word {&#8220;word word',
-                       ),
-                       array(
-                               'word -"word word',
-                               'word -&#8220;word word',
-                       ),
-                       array(
-                               'word-"word word',
-                               'word-&#8220;word word',
-                       ),
-                       array(
-                               '"word word',
-                               '&#8220;word word',
-                       ),
-                       array(
-                               'word("word word',
-                               'word(&#8220;word word',
-                       ),
-                       array(
-                               'word["word word',
-                               'word[&#8220;word word',
-                       ),
-                       array(
-                               'word<"word word',
-                               'word<"word word',
-                       ),
-                       array(
-                               'word&lt;"word word',
-                               'word&lt;&#8220;word word',
-                       ),
-                       array(
-                               'word{"word word',
-                               'word{&#8220;word word',
-                       ),
-                       array(
-                               'word "99 word',
-                               'word &#8220;99 word',
-                       ),
-               );
-       }
-
-       /**
-        * Double quote becomes &#8221; (closing_quote) unless it is already converted to double_prime or opening_quote.
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_closing_quote
-        */
-       function test_closing_quote( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_closing_quote() {
-               return array(
-                       array(
-                               'word word" word',
-                               'word word&#8221; word',
-                       ),
-                       array(
-                               'word word") word',
-                               'word word&#8221;) word',
-                       ),
-                       array(
-                               'word word"] word',
-                               'word word&#8221;] word',
-                       ),
-                       array(
-                               'word word"} word',
-                               'word word&#8221;} word',
-                       ),
-                       array(
-                               'word word"> word',    // Invalid HTML input?
-                               'word word&#8221;> word',
-                       ),
-                       array(
-                               'word word"&gt; word', // Valid HTML should work.
-                               'word word&#8221;&gt; word',
-                       ),
-                       array(
-                               'word word"',
-                               'word word&#8221;',
-                       ),
-                       array(
-                               'word word"word',
-                               'word word&#8221;word',
-                       ),
-                       array(
-                               'word"word"word',
-                               'word&#8221;word&#8221;word',
-                       ),
-                       array(
-                               'test sentence".',
-                               'test sentence&#8221;.',
-                       ),
-                       array(
-                               'test sentence",',
-                               'test sentence&#8221;,',
-                       ),
-                       array(
-                               'test sentence":',
-                               'test sentence&#8221;:',
-                       ),
-                       array(
-                               'test sentence";',
-                               'test sentence&#8221;;',
-                       ),
-                       array(
-                               'test sentence"!',
-                               'test sentence&#8221;!',
-                       ),
-                       array(
-                               'test sentence"?',
-                               'test sentence&#8221;?',
-                       ),
-                       array(
-                               'test sentence."',
-                               'test sentence.&#8221;',
-                       ),
-                       array(
-                               'test sentence". word',
-                               'test sentence&#8221;. word',
-                       ),
-                       array(
-                               'test sentence." word',
-                               'test sentence.&#8221; word',
-                       ),
-               );
-       }
-
-       /**
-        * Test that single quotes followed by a space or .,-)}]> become &#8217; (closing_single_quote)
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_closing_single_quote
-        */
-       function test_closing_single_quote( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_closing_single_quote() {
-               return array(
-                       array(
-                               "word word' word",
-                               'word word&#8217; word',
-                       ),
-                       array(
-                               "word word'. word",
-                               'word word&#8217;. word',
-                       ),
-                       array(
-                               "word word'.word",
-                               'word word&#8217;.word',
-                       ),
-                       array(
-                               "word word', she said",
-                               'word word&#8217;, she said',
-                       ),
-                       array(
-                               "word word': word",
-                               'word word&#8217;: word',
-                       ),
-                       array(
-                               "word word'; word",
-                               'word word&#8217;; word',
-                       ),
-                       array(
-                               "word word'! word",
-                               'word word&#8217;! word',
-                       ),
-                       array(
-                               "word word'? word",
-                               'word word&#8217;? word',
-                       ),
-                       array(
-                               "word word'- word",
-                               'word word&#8217;- word',
-                       ),
-                       array(
-                               "word word') word",
-                               'word word&#8217;) word',
-                       ),
-                       array(
-                               "word word'} word",
-                               'word word&#8217;} word',
-                       ),
-                       array(
-                               "word word'] word",
-                               'word word&#8217;] word',
-                       ),
-                       array(
-                               "word word'&gt; word",
-                               'word word&#8217;&gt; word',
-                       ),
-                       array(
-                               "word word'",
-                               'word word&#8217;',
-                       ),
-                       array(
-                               "test sentence'.",
-                               'test sentence&#8217;.',
-                       ),
-                       array(
-                               "test sentence.'",
-                               'test sentence.&#8217;',
-                       ),
-                       array(
-                               "test sentence'. word",
-                               'test sentence&#8217;. word',
-                       ),
-                       array(
-                               "test sentence.' word",
-                               'test sentence.&#8217; word',
-                       ),
-               );
-       }
-
-       /**
-        * Tests multiplication.
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @ticket 30445
-        * @dataProvider data_multiplication
-        */
-       function test_multiplication( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_multiplication() {
-               return array(
-                       array(
-                               '9x9',
-                               '9&#215;9',
-                       ),
-                       array(
-                               '12x34',
-                               '12&#215;34',
-                       ),
-                       array(
-                               '-123x1=-123',
-                               '-123&#215;1=-123',
-                       ),
-                       // @ticket 30445
-                       array(
-                               '-123x-1',
-                               '-123x-1',
-                       ),
-                       array(
-                               '0.675x1=0.675',
-                               '0.675&#215;1=0.675',
-                       ),
-                       array(
-                               '9 x 9',
-                               '9 x 9',
-                       ),
-                       array(
-                               '0x70',
-                               '0x70',
-                       ),
-                       array(
-                               '3x2x1x0',
-                               '3x2x1x0',
-                       ),
-               );
-       }
-
-       /**
-        * Test ampersands. & always becomes &#038; unless it is followed by # or ;
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_ampersand
-        */
-       function test_ampersand( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_ampersand() {
-               return array(
-                       array(
-                               'word & word',
-                               'word &#038; word',
-                       ),
-                       array(
-                               'word&word',
-                               'word&#038;word',
-                       ),
-                       array(
-                               'word &nbsp; word',
-                               'word &nbsp; word',
-                       ),
-                       array(
-                               'word &#038; word',
-                               'word &#038; word',
-                       ),
-                       array(
-                               'word &#xabc; word',
-                               'word &#xabc; word',
-                       ),
-                       array(
-                               'word &#X394; word',
-                               'word &#X394; word',
-                       ),
-                       array(
-                               'word &# word',
-                               'word &#038;# word',
-                       ),
-                       array(
-                               'word &44; word',
-                               'word &44; word',
-                       ),
-                       array(
-                               'word &&amp; word',
-                               'word &#038;&amp; word',
-                       ),
-                       array(
-                               'word &!amp; word',
-                               'word &#038;!amp; word',
-                       ),
-                       array(
-                               'word &#',
-                               'word &#038;#',
-                       ),
-                       array(
-                               'word &',
-                               'word &#038;',
-                       ),
-               );
-       }
-
-       /**
-        * Test "cockney" phrases, which begin with an apostrophe instead of an opening single quote.
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_cockney
-        */
-       function test_cockney( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_cockney() {
-               return array(
-                       array(
-                               "word 'tain't word",
-                               'word &#8217;tain&#8217;t word',
-                       ),
-                       array(
-                               "word 'twere word",
-                               'word &#8217;twere word',
-                       ),
-                       array(
-                               "word 'twas word",
-                               'word &#8217;twas word',
-                       ),
-                       array(
-                               "word 'tis word",
-                               'word &#8217;tis word',
-                       ),
-                       array(
-                               "word 'twill word",
-                               'word &#8217;twill word',
-                       ),
-                       array(
-                               "word 'til word",
-                               'word &#8217;til word',
-                       ),
-                       array(
-                               "word 'bout word",
-                               'word &#8217;bout word',
-                       ),
-                       array(
-                               "word 'nuff word",
-                               'word &#8217;nuff word',
-                       ),
-                       array(
-                               "word 'round word",
-                               'word &#8217;round word',
-                       ),
-                       array(
-                               "word 'cause word",
-                               'word &#8217;cause word',
-                       ),
-                       array(
-                               "word 'em word",
-                               'word &#8217;em word',
-                       ),
-               );
-       }
-
-       /**
-        * Test smart dashes.
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_smart_dashes
-        */
-       function test_smart_dashes( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_smart_dashes() {
-               return array(
-                       array(
-                               'word --- word',
-                               'word &#8212; word',
-                       ),
-                       array(
-                               'word---word',
-                               'word&#8212;word',
-                       ),
-                       array(
-                               'word -- word',
-                               'word &#8212; word',
-                       ),
-                       array(
-                               'word--word',
-                               'word&#8211;word',
-                       ),
-                       array(
-                               'word - word',
-                               'word &#8211; word',
-                       ),
-                       array(
-                               'word-word',
-                               'word-word',
-                       ),
-                       array(
-                               'word xn&#8211; word',
-                               'word xn&#8211; word',
-                       ),
-                       array(
-                               'wordxn&#8211;word',
-                               'wordxn&#8211;word',
-                       ),
-                       array(
-                               'wordxn--word',
-                               'wordxn--word',
-                       ),
-               );
-       }
-
-       /**
-        * Test miscellaneous static replacements.
-        *
-        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
-        *
-        * @ticket 22692
-        * @dataProvider data_misc_static_replacements
-        */
-       function test_misc_static_replacements( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_misc_static_replacements() {
-               return array(
-                       array(
-                               'word ... word',
-                               'word &#8230; word',
-                       ),
-                       array(
-                               'word...word',
-                               'word&#8230;word',
-                       ),
-                       array(
-                               'word `` word',
-                               'word &#8220; word',
-                       ),
-                       array(
-                               'word``word',
-                               'word&#8220;word',
-                       ),
-                       array(
-                               "word '' word",
-                               'word &#8221; word',
-                       ),
-                       array(
-                               "word''word",
-                               'word&#8221;word',
-                       ),
-                       array(
-                               'word (tm) word',
-                               'word &#8482; word',
-                       ),
-                       array(
-                               'word (tm)word',
-                               'word &#8482;word',
-                       ),
-                       array(
-                               'word(tm) word',
-                               'word(tm) word',
-                       ),
-                       array(
-                               'word(tm)word',
-                               'word(tm)word',
-                       ),
-               );
-       }
-
-       /**
-        * Numbers inside of matching quotes get curly quotes instead of apostrophes and primes.
-        *
-        * @ticket 8775
-        * @dataProvider data_quoted_numbers
-        */
-       function test_quoted_numbers( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_quoted_numbers() {
-               return array(
-                       array(
-                               'word "42.00" word',
-                               'word &#8220;42.00&#8221; word',
-                       ),
-                       array(
-                               'word "42.00"word',
-                               'word &#8220;42.00&#8221;word',
-                       ),
-                       array(
-                               "word '42.00' word",
-                               'word &#8216;42.00&#8217; word',
-                       ),
-                       array(
-                               "word '42.00'word",
-                               'word &#8216;42.00&#8217;word',
-                       ),
-                       array(
-                               'word "42" word',
-                               'word &#8220;42&#8221; word',
-                       ),
-                       array(
-                               'word "42,00" word',
-                               'word &#8220;42,00&#8221; word',
-                       ),
-                       array(
-                               'word "4,242.00" word',
-                               'word &#8220;4,242.00&#8221; word',
-                       ),
-                       array(
-                               "word '99's word",
-                               'word &#8217;99&#8217;s word',
-                       ),
-                       array(
-                               "word '99'samsonite",
-                               'word &#8217;99&#8217;samsonite',
-                       ),
-               );
-       }
-
-       /**
-        * Quotations should be allowed to have dashes around them.
-        *
-        * @ticket 20342
-        * @dataProvider data_quotes_and_dashes
-        */
-       function test_quotes_and_dashes( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_quotes_and_dashes() {
-               return array(
-                       array(
-                               'word---"quote"',
-                               'word&#8212;&#8220;quote&#8221;',
-                       ),
-                       array(
-                               'word--"quote"',
-                               'word&#8211;&#8220;quote&#8221;',
-                       ),
-                       array(
-                               'word-"quote"',
-                               'word-&#8220;quote&#8221;',
-                       ),
-                       array(
-                               "word---'quote'",
-                               'word&#8212;&#8216;quote&#8217;',
-                       ),
-                       array(
-                               "word--'quote'",
-                               'word&#8211;&#8216;quote&#8217;',
-                       ),
-                       array(
-                               "word-'quote'",
-                               'word-&#8216;quote&#8217;',
-                       ),
-                       array(
-                               '"quote"---word',
-                               '&#8220;quote&#8221;&#8212;word',
-                       ),
-                       array(
-                               '"quote"--word',
-                               '&#8220;quote&#8221;&#8211;word',
-                       ),
-                       array(
-                               '"quote"-word',
-                               '&#8220;quote&#8221;-word',
-                       ),
-                       array(
-                               "'quote'---word",
-                               '&#8216;quote&#8217;&#8212;word',
-                       ),
-                       array(
-                               "'quote'--word",
-                               '&#8216;quote&#8217;&#8211;word',
-                       ),
-                       array(
-                               "'quote'-word",
-                               '&#8216;quote&#8217;-word',
-                       ),
-               );
-       }
-
-       /**
-        * Test HTML and shortcode avoidance.
-        *
-        * @ticket 12690
-        * @dataProvider data_tag_avoidance
-        */
-       function test_tag_avoidance( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_tag_avoidance() {
-               return array(
-                       array(
-                               '[ ... ]',
-                               '[ &#8230; ]',
-                       ),
-                       array(
-                               '[ is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
-                               '[ is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
-                       ),
-                       array(
-                               '[is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
-                               '[is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
-                       ),
-                       array(
-                               '[caption - is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
-                               '[caption &#8211; is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
-                       ),
-                       array(
-                               '[ photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy & that guy </a> ]',
-                               '[ photos by <a href="http://example.com/?a[]=1&#038;a[]=2"> this guy &#038; that guy </a> ]',
-                       ),
-                       array(
-                               '[photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy & that guy </a>]',
-                               '[photos by <a href="http://example.com/?a[]=1&#038;a[]=2"> this guy &#038; that guy </a>]',
-                       ),
-                       array(
-                               '& <script>&&</script>',
-                               '&#038; <script>&&</script>',
-                       ),
-                       array(
-                               '[gallery ...]',
-                               '[gallery ...]',
-                       ),
-                       array(
-                               '[[gallery ...]', // This tag is still valid.
-                               '[[gallery ...]',
-                       ),
-                       array(
-                               '[gallery ...]]', // This tag is also valid.
-                               '[gallery ...]]',
-                       ),
-                       array(
-                               '[/gallery ...]', // This would actually be ignored by the shortcode system.
-                               '[/gallery ...]', // The decision to not texturize it is intentional, if not correct.
-                       ),
-                       array(
-                               '[[gallery]]...[[/gallery]]', // Shortcode parsing will ignore the inner ']...[' part and treat this as a single escaped shortcode.
-                               '[[gallery]]&#8230;[[/gallery]]',
-                       ),
-                       array(
-                               '[[[gallery]]]...[[[/gallery]]]', // Again, shortcode parsing matches, but only the '[[gallery]' and '[/gallery]]' parts.
-                               '[[[gallery]]]&#8230;[[[/gallery]]]',
-                       ),
-                       array(
-                               '[gallery ...',
-                               '[gallery &#8230;',
-                       ),
-                       array(
-                               '[gallery <br ... /> ...]', // This tag is still valid. Shortcode 'attributes' are not considered
-                               '[gallery <br ... /> ...]', // in the initial parsing of shortcodes, and HTML is allowed.
-                       ),
-                       array(
-                               '<br [gallery ...] ... />',
-                               '<br [gallery ...] ... />',
-                       ),
-                       array(
-                               '<br [gallery ...] ... /',
-                               '<br [gallery ...] ... /',
-                       ),
-                       array(
-                               '<br ... />',
-                               '<br ... />',
-                       ),
-                       array(
-                               '<br ... />...<br ... />',
-                               '<br ... />&#8230;<br ... />',
-                       ),
-                       array(
-                               '[gallery ...]...[gallery ...]',
-                               '[gallery ...]&#8230;[gallery ...]',
-                       ),
-                       array(
-                               '[[gallery ...]]',
-                               '[[gallery ...]]',
-                       ),
-                       array(
-                               '[[gallery ...]',
-                               '[[gallery ...]',
-                       ),
-                       array(
-                               '[gallery ...]]',
-                               '[gallery ...]]',
-                       ),
-                       array(
-                               '[/gallery ...]]',
-                               '[/gallery ...]]',
-                       ),
-                       array(
-                               '[[gallery <br ... /> ...]]', // This gets parsed as an escaped shortcode with embedded HTML. Brains may explode.
-                               '[[gallery <br ... /> ...]]',
-                       ),
-                       array(
-                               '<br [[gallery ...]] ... />',
-                               '<br [[gallery ...]] ... />',
-                       ),
-                       array(
-                               '<br [[gallery ...]] ... /',
-                               '<br [[gallery ...]] ... /',
-                       ),
-                       array(
-                               '[[gallery ...]]...[[gallery ...]]',
-                               '[[gallery ...]]&#8230;[[gallery ...]]',
-                       ),
-                       array(
-                               '[[gallery ...]...[/gallery]]',
-                               '[[gallery ...]&#8230;[/gallery]]',
-                       ),
-                       array(
-                               '<!-- ... -->',
-                               '<!-- ... -->',
-                       ),
-                       array(
-                               '<!--...-->',
-                               '<!--...-->',
-                       ),
-                       array(
-                               '<!-- ... -- > ...',
-                               '<!-- ... -- > ...',
-                       ),
-                       array(
-                               '<!-- ...', // An unclosed comment is still a comment.
-                               '<!-- ...',
-                       ),
-                       array(
-                               'a<!-->b', // Browsers seem to allow this.
-                               'a<!-->b',
-                       ),
-                       array(
-                               'a<!--->b',
-                               'a<!--->b',
-                       ),
-                       array(
-                               'a<!---->b',
-                               'a<!---->b',
-                       ),
-                       array(
-                               'a<!----->b',
-                               'a<!----->b',
-                       ),
-                       array(
-                               'a<!-- c --->b',
-                               'a<!-- c --->b',
-                       ),
-                       array(
-                               'a<!-- c -- d -->b',
-                               'a<!-- c -- d -->b',
-                       ),
-                       array(
-                               'a<!-- <!-- c --> -->b<!-- close -->',
-                               'a<!-- <!-- c --> &#8211;>b<!-- close -->',
-                       ),
-                       array(
-                               '<!-- <br /> [gallery] ... -->',
-                               '<!-- <br /> [gallery] ... -->',
-                       ),
-                       array(
-                               '...<!-- ... -->...',
-                               '&#8230;<!-- ... -->&#8230;',
-                       ),
-                       array(
-                               '[gallery ...]...<!-- ... -->...<br ... />',
-                               '[gallery ...]&#8230;<!-- ... -->&#8230;<br ... />',
-                       ),
-                       array(
-                               '<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>',
-                               '<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>',
-                       ),
-                       array(
-                               'word <img src="http://example.com/wp-content/uploads/2014/06/image-300x216.gif" /> word', // Ensure we are not corrupting image URLs.
-                               'word <img src="http://example.com/wp-content/uploads/2014/06/image-300x216.gif" /> word',
-                       ),
-                       array(
-                               '[ do texturize "[quote]" here ]',
-                               '[ do texturize &#8220;[quote]&#8221; here ]',
-                       ),
-                       array(
-                               '[ regex catches this <a href="[quote]">here</a> ]',
-                               '[ regex catches this <a href="[quote]">here</a> ]',
-                       ),
-                       array(
-                               '[ but also catches the <b>styled "[quote]" here</b> ]',
-                               '[ but also catches the <b>styled &#8220;[quote]&#8221; here</b> ]',
-                       ),
-                       array(
-                               '[Let\'s get crazy<input>[caption code="<a href=\'?a[]=100\'>hello</a>"]</input>world]', // [caption] shortcode is invalid here because it contains '[]' chars.
-                               '[Let&#8217;s get crazy<input>[caption code=&#8221;<a href=\'?a[]=100\'>hello</a>&#8220;]</input>world]',
-                       ),
-                       array(
-                               '<> ... <>',
-                               '<> &#8230; <>',
-                       ),
-                       array(
-                               '<> ... <> ... >',
-                               '<> &#8230; <> &#8230; >',
-                       ),
-                       array(
-                               '<> ... < ... > ... <>',
-                               '<> &#8230; < ... > &#8230; <>',
-                       ),
-               );
-       }
-
-       /**
-        * Year abbreviations consist of exactly two digits.
-        *
-        * @ticket 26850
-        * @dataProvider data_year_abbr
-        */
-       function test_year_abbr( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_year_abbr() {
-               return array(
-                       array(
-                               "word '99 word",
-                               'word &#8217;99 word',
-                       ),
-                       array(
-                               "word '99. word",
-                               'word &#8217;99. word',
-                       ),
-                       array(
-                               "word '99, word",
-                               'word &#8217;99, word',
-                       ),
-                       array(
-                               "word '99; word",
-                               'word &#8217;99; word',
-                       ),
-                       array(
-                               "word '99' word", // For this pattern, prime doesn't make sense. Should get apos and a closing quote.
-                               'word &#8217;99&#8217; word',
-                       ),
-                       array(
-                               "word '99'. word",
-                               'word &#8217;99&#8217;. word',
-                       ),
-                       array(
-                               "word '99', word",
-                               'word &#8217;99&#8217;, word',
-                       ),
-                       array(
-                               "word '99.' word",
-                               'word &#8217;99.&#8217; word',
-                       ),
-                       array(
-                               "word '99",
-                               'word &#8217;99',
-                       ),
-                       array(
-                               "'99 word",
-                               '&#8217;99 word',
-                       ),
-                       array(
-                               "word '999 word", // Does not match the apos pattern, should be opening quote.
-                               'word &#8216;999 word',
-                       ),
-                       array(
-                               "word '99% word",
-                               'word &#8216;99% word',
-                       ),
-                       array(
-                               "word '9 word",
-                               'word &#8216;9 word',
-                       ),
-                       array(
-                               "word '99.9 word",
-                               'word &#8216;99.9 word',
-                       ),
-                       array(
-                               "word '999",
-                               'word &#8216;999',
-                       ),
-                       array(
-                               "word '9",
-                               'word &#8216;9',
-                       ),
-                       array(
-                               "in '4 years, 3 months,' Obama cut the deficit",
-                               'in &#8216;4 years, 3 months,&#8217; Obama cut the deficit',
-                       ),
-                       array(
-                               "testing's '4' through 'quotes'",
-                               'testing&#8217;s &#8216;4&#8217; through &#8216;quotes&#8217;',
-                       ),
-               );
-       }
-
-       /**
-        * Make sure translation actually works.
-        *
-        * Also make sure apostrophes and closing quotes aren't being confused by default.
-        *
-        * @ticket 27426
-        * @dataProvider data_translate
-        */
-       function test_translate( $input, $output ) {
-               add_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 );
-
-               $result = wptexturize( $input, true );
-
-               remove_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 );
-               wptexturize( 'reset', true );
-
-               return $this->assertSame( $output, $result );
-       }
-
-       function filter_translate( $translations, $text, $context, $domain ) {
-               switch ( $text ) {
-                       case '&#8211;':
-                               return '!endash!';
-                       case '&#8212;':
-                               return '!emdash!';
-                       case '&#8216;':
-                               return '!openq1!';
-                       case '&#8217;':
-                               if ( 'apostrophe' === $context ) {
-                                       return '!apos!';
-                               } else {
-                                       return '!closeq1!';
-                               }
-                       case '&#8220;':
-                               return '!openq2!';
-                       case '&#8221;':
-                               return '!closeq2!';
-                       case '&#8242;':
-                               return '!prime1!';
-                       case '&#8243;':
-                               return '!prime2!';
-                       case '&#8217;tain&#8217;t,&#8217;twere,&#8217;twas,&#8217;tis,&#8217;twill,&#8217;til,&#8217;bout,&#8217;nuff,&#8217;round,&#8217;cause,&#8217;em':
-                               return '!apos!tain!apos!t,!apos!twere,!apos!twas,!apos!tis,!apos!twill,!apos!til,!apos!bout,!apos!nuff,!apos!round,!apos!cause,!apos!em';
-                       default:
-                               return $translations;
-               }
-       }
-
-       function data_translate() {
-               return array(
-                       array(
-                               "word '99 word",
-                               'word !apos!99 word',
-                       ),
-                       array(
-                               "word'99 word",
-                               'word!apos!99 word',
-                       ),
-                       array(
-                               "word 'test sentence' word",
-                               'word !openq1!test sentence!closeq1! word',
-                       ),
-                       array(
-                               "'test sentence'",
-                               '!openq1!test sentence!closeq1!',
-                       ),
-                       array(
-                               'word "test sentence" word',
-                               'word !openq2!test sentence!closeq2! word',
-                       ),
-                       array(
-                               '"test sentence"',
-                               '!openq2!test sentence!closeq2!',
-                       ),
-                       array(
-                               "word 'word word",
-                               'word !openq1!word word',
-                       ),
-                       array(
-                               "word ('word word",
-                               'word (!openq1!word word',
-                       ),
-                       array(
-                               "word ['word word",
-                               'word [!openq1!word word',
-                       ),
-                       array(
-                               'word 99" word',
-                               'word 99!prime2! word',
-                       ),
-                       array(
-                               'word 99"word',
-                               'word 99!prime2!word',
-                       ),
-                       array(
-                               'word99" word',
-                               'word99!prime2! word',
-                       ),
-                       array(
-                               'word99"word',
-                               'word99!prime2!word',
-                       ),
-                       array(
-                               "word 99' word",
-                               'word 99!prime1! word',
-                       ),
-                       array(
-                               "word99' word",
-                               'word99!prime1! word',
-                       ),
-                       array(
-                               "word word's word",
-                               'word word!apos!s word',
-                       ),
-                       array(
-                               "word word'. word",
-                               'word word!closeq1!. word',
-                       ),
-                       array(
-                               "word ]'. word",
-                               'word ]!closeq1!. word',
-                       ),
-                       array(
-                               'word "word word',
-                               'word !openq2!word word',
-                       ),
-                       array(
-                               'word ("word word',
-                               'word (!openq2!word word',
-                       ),
-                       array(
-                               'word ["word word',
-                               'word [!openq2!word word',
-                       ),
-                       array(
-                               'word word" word',
-                               'word word!closeq2! word',
-                       ),
-                       array(
-                               'word word") word',
-                               'word word!closeq2!) word',
-                       ),
-                       array(
-                               'word word"] word',
-                               'word word!closeq2!] word',
-                       ),
-                       array(
-                               'word word"',
-                               'word word!closeq2!',
-                       ),
-                       array(
-                               'word word"word',
-                               'word word!closeq2!word',
-                       ),
-                       array(
-                               'test sentence".',
-                               'test sentence!closeq2!.',
-                       ),
-                       array(
-                               'test sentence."',
-                               'test sentence.!closeq2!',
-                       ),
-                       array(
-                               'test sentence." word',
-                               'test sentence.!closeq2! word',
-                       ),
-                       array(
-                               "word word' word",
-                               'word word!closeq1! word',
-                       ),
-                       array(
-                               "word word'. word",
-                               'word word!closeq1!. word',
-                       ),
-                       array(
-                               "word word'.word",
-                               'word word!closeq1!.word',
-                       ),
-                       array(
-                               "word word'",
-                               'word word!closeq1!',
-                       ),
-                       array(
-                               "test sentence'.",
-                               'test sentence!closeq1!.',
-                       ),
-                       array(
-                               "test sentence.'",
-                               'test sentence.!closeq1!',
-                       ),
-                       array(
-                               "test sentence'. word",
-                               'test sentence!closeq1!. word',
-                       ),
-                       array(
-                               "test sentence.' word",
-                               'test sentence.!closeq1! word',
-                       ),
-                       array(
-                               "word 'tain't word",
-                               'word !apos!tain!apos!t word',
-                       ),
-                       array(
-                               "word 'twere word",
-                               'word !apos!twere word',
-                       ),
-                       array(
-                               'word "42.00" word',
-                               'word !openq2!42.00!closeq2! word',
-                       ),
-                       array(
-                               "word '42.00' word",
-                               'word !openq1!42.00!closeq1! word',
-                       ),
-                       array(
-                               "word word'. word",
-                               'word word!closeq1!. word',
-                       ),
-                       array(
-                               "word word'.word",
-                               'word word!closeq1!.word',
-                       ),
-                       array(
-                               "word word', she said",
-                               'word word!closeq1!, she said',
-                       ),
-               );
-       }
-
-       /**
-        * Extra sanity checks for _wptexturize_pushpop_element()
-        *
-        * @ticket 28483
-        * @dataProvider data_element_stack
-        */
-       function test_element_stack( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_element_stack() {
-               return array(
-                       array(
-                               '<span>hello</code>---</span>',
-                               '<span>hello</code>&#8212;</span>',
-                       ),
-                       array(
-                               '</code>hello<span>---</span>',
-                               '</code>hello<span>&#8212;</span>',
-                       ),
-                       array(
-                               '<code>hello</code>---</span>',
-                               '<code>hello</code>&#8212;</span>',
-                       ),
-                       array(
-                               '<span>hello</span>---<code>',
-                               '<span>hello</span>&#8212;<code>',
-                       ),
-                       array(
-                               '<span>hello<code>---</span>',
-                               '<span>hello<code>---</span>',
-                       ),
-                       array(
-                               '<code>hello<span>---</span>',
-                               '<code>hello<span>---</span>',
-                       ),
-                       array(
-                               '<code>hello</span>---</span>',
-                               '<code>hello</span>---</span>',
-                       ),
-                       array(
-                               '<span><code>hello</code>---</span>',
-                               '<span><code>hello</code>&#8212;</span>',
-                       ),
-                       array(
-                               '<code>hello</code>world<span>---</span>',
-                               '<code>hello</code>world<span>&#8212;</span>',
-                       ),
-               );
-       }
-
-       /**
-        * Test disabling shortcode texturization.
-        *
-        * @ticket 29557
-        * @dataProvider data_unregistered_shortcodes
-        */
-       function test_unregistered_shortcodes( $input, $output ) {
-               add_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 );
-
-               $output = $this->assertSame( $output, wptexturize( $input ) );
-
-               remove_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 );
-               return $output;
-       }
-
-       function filter_shortcodes( $disabled ) {
-               $disabled[] = 'audio';
-               return $disabled;
-       }
-
-       function data_unregistered_shortcodes() {
-               return array(
-                       array(
-                               '[a]a--b[audio]---[/audio]a--b[/a]',
-                               '[a]a&#8211;b[audio]---[/audio]a&#8211;b[/a]',
-                       ),
-                       array(
-                               '[code ...]...[/code]',   // '[code]' is not a registered shortcode.
-                               '[code &#8230;]&#8230;[/code]',
-                       ),
-                       array(
-                               '[hello ...]...[/hello]', // '[hello]' is not a registered shortcode.
-                               '[hello &#8230;]&#8230;[/hello]',
-                       ),
-                       array(
-                               '[...]...[/...]',         // These are potentially usable shortcodes.
-                               '[&#8230;]&#8230;[/&#8230;]',
-                       ),
-                       array(
-                               '[gal>ery ...]',
-                               '[gal>ery &#8230;]',
-                       ),
-                       array(
-                               '[randomthing param="test"]',
-                               '[randomthing param=&#8221;test&#8221;]',
-                       ),
-                       array(
-                               '[[audio]...[/audio]...',         // These are potentially usable shortcodes.
-                               '[[audio]&#8230;[/audio]&#8230;', // Unfortunately, the meaning of [[audio] is ambiguous unless we run the entire shortcode regexp.
-                       ),
-                       array(
-                               '[audio]...[/audio]]...', // These are potentially usable shortcodes.
-                               '[audio]...[/audio]]...', // Unfortunately, the meaning of [/audio]] is ambiguous unless we run the entire shortcode regexp.
-                       ),                            // This test would not pass in 3.9 because the extra brace was always ignored by texturize.
-                       array(
-                               '<span>hello[/audio]---</span>',
-                               '<span>hello[/audio]&#8212;</span>',
-                       ),
-                       array(
-                               '[/audio]hello<span>---</span>',
-                               '[/audio]hello<span>&#8212;</span>',
-                       ),
-                       array(
-                               '[audio]hello[/audio]---</span>',
-                               '[audio]hello[/audio]&#8212;</span>',
-                       ),
-                       array(
-                               '<span>hello</span>---[audio]',
-                               '<span>hello</span>&#8212;[audio]',
-                       ),
-                       array(
-                               '<span>hello[audio]---</span>',
-                               '<span>hello[audio]---</span>',
-                       ),
-                       array(
-                               '[audio]hello<span>---</span>',
-                               '[audio]hello<span>---</span>',
-                       ),
-                       array(
-                               '[audio]hello</span>---</span>',
-                               '[audio]hello</span>---</span>',
-                       ),
-               );
-       }
-
-       /**
-        * Ensure primes logic is not too greedy at the end of a quotation.
-        *
-        * @ticket 29256
-        * @dataProvider data_primes_vs_quotes
-        */
-       function test_primes_vs_quotes( $input, $output ) {
-               return $this->assertSame( $output, wptexturize( $input ) );
-       }
-
-       function data_primes_vs_quotes() {
-               return array(
-                       array(
-                               "George's porch is 99' long.",
-                               'George&#8217;s porch is 99&#8242; long.',
-                       ),
-                       array(
-                               'The best year "was that time in 2012" when everyone partied, he said.',
-                               'The best year &#8220;was that time in 2012&#8221; when everyone partied, he said.',
-                       ),
-                       array(
-                               "I need 4 x 20' = 80' of trim.", // Works only with a space before the '=' char.
-                               'I need 4 x 20&#8242; = 80&#8242; of trim.',
-                       ),
-                       array(
-                               '"Lorem ipsum dolor sit amet 1234"',
-                               '&#8220;Lorem ipsum dolor sit amet 1234&#8221;',
-                       ),
-                       array(
-                               "'Etiam eu egestas dui 1234'",
-                               '&#8216;Etiam eu egestas dui 1234&#8217;',
-                       ),
-                       array(
-                               'according to our source, "33% of all students scored less than 50" on the test.',
-                               'according to our source, &#8220;33% of all students scored less than 50&#8221; on the test.',
-                       ),
-                       array(
-                               "The doctor said, 'An average height is between 5' and 6' in study group 7'.  He then produced a 6' chart of averages.  A man of 7', incredibly, is very possible.",
-                               'The doctor said, &#8216;An average height is between 5&#8242; and 6&#8242; in study group 7&#8217;.  He then produced a 6&#8242; chart of averages.  A man of 7&#8242;, incredibly, is very possible.',
-                       ),
-                       array(
-                               'Pirates have voted on "The Expendables 3" with their clicks -- and it turns out the Sylvester Stallone-starrer hasn\'t been astoundingly popular among digital thieves, relatively speaking.
-
-As of Sunday, 5.12 million people worldwide had pirated "Expendables 3" since a high-quality copy hit torrent-sharing sites July 23, according to piracy-tracking firm Excipio.
-
-That likely contributed to the action movie\'s dismal box-office debut this weekend. But over the same July 23-Aug. 18 time period, the movie was No. 4 in downloads, after "Captain America: The Winter Soldier" (7.31 million), "Divergent" (6.29 million) and "The Amazing Spider-Man 2" (5.88 million). Moreover, that\'s despite "Expendables 3" becoming available more than three weeks prior to the film\'s U.S. theatrical debut.
-
-String with a number followed by a single quote \'Expendables 3\' vestibulum in arcu mi.',
-
-                               'Pirates have voted on &#8220;The Expendables 3&#8221; with their clicks &#8212; and it turns out the Sylvester Stallone-starrer hasn&#8217;t been astoundingly popular among digital thieves, relatively speaking.
-
-As of Sunday, 5.12 million people worldwide had pirated &#8220;Expendables 3&#8221; since a high-quality copy hit torrent-sharing sites July 23, according to piracy-tracking firm Excipio.
-
-That likely contributed to the action movie&#8217;s dismal box-office debut this weekend. But over the same July 23-Aug. 18 time period, the movie was No. 4 in downloads, after &#8220;Captain America: The Winter Soldier&#8221; (7.31 million), &#8220;Divergent&#8221; (6.29 million) and &#8220;The Amazing Spider-Man 2&#8221; (5.88 million). Moreover, that&#8217;s despite &#8220;Expendables 3&#8221; becoming available more than three weeks prior to the film&#8217;s U.S. theatrical debut.
-
-String with a number followed by a single quote &#8216;Expendables 3&#8217; vestibulum in arcu mi.',
-                       ),
-               );
-       }
-
-       /**
-        * Make sure translation actually works.
-        *
-        * Also make sure opening and closing quotes are allowed to be identical.
-        *
-        * @ticket 29256
-        * @dataProvider data_primes_quotes_translation
-        */
-       function test_primes_quotes_translation( $input, $output ) {
-               add_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 );
-
-               $result = wptexturize( $input, true );
-
-               remove_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 );
-               wptexturize( 'reset', true );
-
-               return $this->assertSame( $output, $result );
-       }
-
-       function filter_translate2( $translations, $text, $context, $domain ) {
-               switch ( $text ) {
-                       case '&#8211;':
-                               return '!endash!';
-                       case '&#8212;':
-                               return '!emdash!';
-                       case '&#8216;':
-                               return '!q1!';
-                       case '&#8217;':
-                               if ( 'apostrophe' === $context ) {
-                                       return '!apos!';
-                               } else {
-                                       return '!q1!';
-                               }
-                       case '&#8220;':
-                               return '!q2!';
-                       case '&#8221;':
-                               return '!q2!';
-                       case '&#8242;':
-                               return '!prime1!';
-                       case '&#8243;':
-                               return '!prime2!';
-                       default:
-                               return $translations;
-               }
-       }
-
-       function data_primes_quotes_translation() {
-               return array(
-                       array(
-                               "George's porch is 99' long.",
-                               'George!apos!s porch is 99!prime1! long.',
-                       ),
-                       array(
-                               'The best year "was that time in 2012" when everyone partied, he said.',
-                               'The best year !q2!was that time in 2012!q2! when everyone partied, he said.',
-                       ),
-                       array(
-                               "I need 4 x 20' = 80' of trim.", // Works only with a space before the '=' char.
-                               'I need 4 x 20!prime1! = 80!prime1! of trim.',
-                       ),
-                       array(
-                               '"Lorem ipsum dolor sit amet 1234"',
-                               '!q2!Lorem ipsum dolor sit amet 1234!q2!',
-                       ),
-                       array(
-                               "'Etiam eu egestas dui 1234'",
-                               '!q1!Etiam eu egestas dui 1234!q1!',
-                       ),
-                       array(
-                               'according to our source, "33% of all students scored less than 50" on the test.',
-                               'according to our source, !q2!33% of all students scored less than 50!q2! on the test.',
-                       ),
-                       array(
-                               "The doctor said, 'An average height is between 5' and 6' in study group 7'.  He then produced a 6' chart of averages.  A man of 7', incredibly, is very possible.",
-                               'The doctor said, !q1!An average height is between 5!prime1! and 6!prime1! in study group 7!q1!.  He then produced a 6!prime1! chart of averages.  A man of 7!prime1!, incredibly, is very possible.',
-                       ),
-                       array(
-                               'Pirates have voted on "The Expendables 3" with their clicks -- and it turns out the Sylvester Stallone-starrer hasn\'t been astoundingly popular among digital thieves, relatively speaking.
-
-As of Sunday, 5.12 million people worldwide had pirated "Expendables 3" since a high-quality copy hit torrent-sharing sites July 23, according to piracy-tracking firm Excipio.
-
-That likely contributed to the action movie\'s dismal box-office debut this weekend. But over the same July 23-Aug. 18 time period, the movie was No. 4 in downloads, after "Captain America: The Winter Soldier" (7.31 million), "Divergent" (6.29 million) and "The Amazing Spider-Man 2" (5.88 million). Moreover, that\'s despite "Expendables 3" becoming available more than three weeks prior to the film\'s U.S. theatrical debut.
-
-String with a number followed by a single quote \'Expendables 3\' vestibulum in arcu mi.',
-
-                               'Pirates have voted on !q2!The Expendables 3!q2! with their clicks !emdash! and it turns out the Sylvester Stallone-starrer hasn!apos!t been astoundingly popular among digital thieves, relatively speaking.
-
-As of Sunday, 5.12 million people worldwide had pirated !q2!Expendables 3!q2! since a high-quality copy hit torrent-sharing sites July 23, according to piracy-tracking firm Excipio.
-
-That likely contributed to the action movie!apos!s dismal box-office debut this weekend. But over the same July 23-Aug. 18 time period, the movie was No. 4 in downloads, after !q2!Captain America: The Winter Soldier!q2! (7.31 million), !q2!Divergent!q2! (6.29 million) and !q2!The Amazing Spider-Man 2!q2! (5.88 million). Moreover, that!apos!s despite !q2!Expendables 3!q2! becoming available more than three weeks prior to the film!apos!s U.S. theatrical debut.
-
-String with a number followed by a single quote !q1!Expendables 3!q1! vestibulum in arcu mi.',
-                       ),
-               );
-       }
-
-       /**
-        * Automated performance testing of the main regex.
-        *
-        * @dataProvider data_whole_posts
-        */
-       function test_pcre_performance( $input ) {
-               global $shortcode_tags;
-
-               // With shortcodes disabled.
-               $regex  = _get_wptexturize_split_regex();
-               $result = benchmark_pcre_backtracking( $regex, $input, 'split' );
-               $this->assertLessThan( 200, $result );
-
-               // With shortcodes enabled.
-               $shortcode_regex = _get_wptexturize_shortcode_regex( array_keys( $shortcode_tags ) );
-               $regex           = _get_wptexturize_split_regex( $shortcode_regex );
-               $result          = benchmark_pcre_backtracking( $regex, $input, 'split' );
-               return $this->assertLessThan( 200, $result );
-       }
-
-       /**
-        * Ensure that a trailing less-than symbol doesn't cause a PHP warning.
-        *
-        * @ticket 35864
-        */
-       function test_trailing_less_than() {
-               $this->assertSame( 'F&#8211;oo<', wptexturize( 'F--oo<', true ) );
-       }
-
-       function data_whole_posts() {
-               require_once DIR_TESTDATA . '/formatting/whole-posts.php';
-               return data_whole_posts();
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWPTrimWordsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WPTrimWords.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WPTrimWords.php      2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WPTrimWords.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,88 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_WPTrimWords extends WP_UnitTestCase {
-
-       /**
-        * Long Dummy Text.
-        *
-        * @since 5.0.0
-        *
-        * @var string $long_text
-        */
-       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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( $trimmed, wp_trim_words( $text, 5 ) );
-       }
-
-       /**
-        * @ticket 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->assertSame( $trimmed, wp_trim_words( $text ) );
-
-               $text = 'This text contains<style>#css { width:expression(alert("css")) }</style>. It should go.';
-               $this->assertSame( $trimmed, wp_trim_words( $text ) );
-       }
-
-       function test_doesnt_trim_short_text() {
-               $text = 'This is some short text.';
-               $this->assertSame( $text, wp_trim_words( $text ) );
-       }
-
-       /**
-        * @ticket 44541
-        */
-       function test_trims_to_20_counted_by_chars() {
-               switch_to_locale( 'ja_JP' );
-               $expected = substr( $this->long_text, 0, 20 ) . '&hellip;';
-               $actual   = wp_trim_words( $this->long_text, 20 );
-               restore_previous_locale();
-               $this->assertSame( $expected, $actual );
-       }
-
-       /**
-        * @ticket 44541
-        */
-       function test_trims_to_20_counted_by_chars_with_double_width_chars() {
-               switch_to_locale( 'ja_JP' );
-               $text     = str_repeat( 'あ', 100 );
-               $expected = str_repeat( 'あ', 19 ) . '&hellip;';
-               $actual   = wp_trim_words( $text, 19 );
-               restore_previous_locale();
-               $this->assertSame( $expected, $actual );
-       }
-
-       /**
-        * @ticket 47867
-        */
-       function test_works_with_non_numeric_num_words() {
-               $this->assertSame( '', wp_trim_words( $this->long_text, '', '' ) );
-               $this->assertSame( '', wp_trim_words( $this->long_text, 'abc', '' ) );
-               $this->assertSame( '', wp_trim_words( $this->long_text, null, '' ) );
-               $this->assertSame( 'Lorem ipsum dolor', wp_trim_words( $this->long_text, '3', '' ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWpHtmlEditPrephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WpHtmlEditPre.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WpHtmlEditPre.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WpHtmlEditPre.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,37 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @expectedDeprecated wp_htmledit_pre
- */
-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->assertSame( $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->assertSame( $utf8, wp_htmledit_pre( $utf8 ) );
-               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWpHtmlSplitphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WpHtmlSplit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WpHtmlSplit.php      2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WpHtmlSplit.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,53 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_WpHtmlSplit extends WP_UnitTestCase {
-
-       /**
-        * Basic functionality goes here.
-        *
-        * @dataProvider data_basic_features
-        */
-       function test_basic_features( $input, $output ) {
-               return $this->assertSame( $output, wp_html_split( $input ) );
-       }
-
-       function data_basic_features() {
-               return array(
-                       array(
-                               'abcd efgh',
-                               array( 'abcd efgh' ),
-                       ),
-                       array(
-                               'abcd <html> efgh',
-                               array( 'abcd ', '<html>', ' efgh' ),
-                       ),
-                       array(
-                               'abcd <!-- <html> --> efgh',
-                               array( 'abcd ', '<!-- <html> -->', ' efgh' ),
-                       ),
-                       array(
-                               'abcd <![CDATA[ <html> ]]> efgh',
-                               array( 'abcd ', '<![CDATA[ <html> ]]>', ' efgh' ),
-                       ),
-               );
-       }
-
-       /**
-        * Automated performance testing of the main regex.
-        *
-        * @dataProvider data_whole_posts
-        */
-       function test_pcre_performance( $input ) {
-               $regex  = get_html_split_regex();
-               $result = benchmark_pcre_backtracking( $regex, $input, 'split' );
-               return $this->assertLessThan( 200, $result );
-       }
-
-       function data_whole_posts() {
-               require_once DIR_TESTDATA . '/formatting/whole-posts.php';
-               return data_whole_posts();
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWpReplaceInHtmlTagsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WpReplaceInHtmlTags.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WpReplaceInHtmlTags.php      2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WpReplaceInHtmlTags.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,37 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_WpReplaceInTags extends WP_UnitTestCase {
-       /**
-        * Check for expected behavior of new function wp_replace_in_html_tags().
-        *
-        * @dataProvider data_wp_replace_in_html_tags
-        */
-       function test_wp_replace_in_html_tags( $input, $output ) {
-               return $this->assertSame( $output, wp_replace_in_html_tags( $input, array( "\n" => ' ' ) ) );
-       }
-
-       function data_wp_replace_in_html_tags() {
-               return array(
-                       array(
-                               "Hello \n World",
-                               "Hello \n World",
-                       ),
-                       array(
-                               "<Hello \n World>",
-                               '<Hello   World>',
-                       ),
-                       array(
-                               "<!-- Hello \n World -->",
-                               '<!-- Hello   World -->',
-                       ),
-                       array(
-                               "<!-- Hello <\n> World -->",
-                               '<!-- Hello < > World -->',
-                       ),
-               );
-       }
-}
-
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWpRichEditPrephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WpRichEditPre.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WpRichEditPre.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WpRichEditPre.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,37 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @expectedDeprecated wp_richedit_pre
- */
-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->assertSame( '&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->assertSame( '&lt;p&gt;' . $utf8 . "&lt;/p&gt;\n", wp_richedit_pre( $utf8 ) );
-               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingWpTrimExcerptphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/WpTrimExcerpt.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/WpTrimExcerpt.php    2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/WpTrimExcerpt.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,84 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- * @covers ::wp_trim_excerpt
- */
-class Tests_Formatting_WpTrimExcerpt extends WP_UnitTestCase {
-       /**
-        * @ticket 25349
-        */
-       public function test_secondary_loop_respect_more() {
-               $post1 = self::factory()->post->create(
-                       array(
-                               'post_content' => 'Post 1 Page 1<!--more-->Post 1 Page 2',
-                       )
-               );
-               $post2 = self::factory()->post->create(
-                       array(
-                               'post_content' => 'Post 2 Page 1<!--more-->Post 2 Page 2',
-                       )
-               );
-
-               $this->go_to( '/?p=' . $post1 );
-               setup_postdata( get_post( $post1 ) );
-
-               $q = new WP_Query(
-                       array(
-                               'post__in' => array( $post2 ),
-                       )
-               );
-               if ( $q->have_posts() ) {
-                       while ( $q->have_posts() ) {
-                               $q->the_post();
-                               $this->assertSame( 'Post 2 Page 1', wp_trim_excerpt() );
-                       }
-               }
-       }
-
-       /**
-        * @ticket 25349
-        */
-       public function test_secondary_loop_respect_nextpage() {
-               $post1 = self::factory()->post->create(
-                       array(
-                               'post_content' => 'Post 1 Page 1<!--nextpage-->Post 1 Page 2',
-                       )
-               );
-               $post2 = self::factory()->post->create(
-                       array(
-                               'post_content' => 'Post 2 Page 1<!--nextpage-->Post 2 Page 2',
-                       )
-               );
-
-               $this->go_to( '/?p=' . $post1 );
-               setup_postdata( get_post( $post1 ) );
-
-               $q = new WP_Query(
-                       array(
-                               'post__in' => array( $post2 ),
-                       )
-               );
-               if ( $q->have_posts() ) {
-                       while ( $q->have_posts() ) {
-                               $q->the_post();
-                               $this->assertSame( 'Post 2 Page 1', wp_trim_excerpt() );
-                       }
-               }
-       }
-
-       /**
-        * @ticket 51042
-        */
-       public function test_should_generate_excerpt_for_empty_values() {
-               $post = self::factory()->post->create(
-                       array(
-                               'post_content' => 'Post content',
-                       )
-               );
-
-               $this->assertSame( 'Post content', wp_trim_excerpt( '', $post ) );
-               $this->assertSame( 'Post content', wp_trim_excerpt( null, $post ) );
-               $this->assertSame( 'Post content', wp_trim_excerpt( false, $post ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingZeroisephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/Zeroise.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/Zeroise.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/Zeroise.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,14 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
-/**
- * @group formatting
- */
-class Tests_Formatting_Zeroise extends WP_UnitTestCase {
-       function test_pads_with_leading_zeroes() {
-               $this->assertSame( '00005', zeroise( 5, 5 ) );
-       }
-
-       function test_does_nothing_if_input_is_already_longer() {
-               $this->assertSame( '5000000', zeroise( 5000000, 2 ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattingcapitalPDangitphpfromrev51622trunktestsphpunittestsformattingCapitalPDangitphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/capitalPDangit.php (from rev 51622, trunk/tests/phpunit/tests/formatting/CapitalPDangit.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/capitalPDangit.php                           (rev 0)
+++ trunk/tests/phpunit/tests/formatting/capitalPDangit.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,20 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+// phpcs:disable WordPress.WP.CapitalPDangit.Misspelled -- 🙃
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_CapitalPDangit extends WP_UnitTestCase {
+       function test_esc_attr_quotes() {
+               global $wp_current_filter;
+               $this->assertSame( 'Something about WordPress', capital_P_dangit( 'Something about Wordpress' ) );
+               $this->assertSame( 'Something about (WordPress', capital_P_dangit( 'Something about (Wordpress' ) );
+               $this->assertSame( 'Something about &#8216;WordPress', capital_P_dangit( 'Something about &#8216;Wordpress' ) );
+               $this->assertSame( 'Something about &#8220;WordPress', capital_P_dangit( 'Something about &#8220;Wordpress' ) );
+               $this->assertSame( 'Something about >WordPress', capital_P_dangit( 'Something about >Wordpress' ) );
+               $this->assertSame( 'Wordpress', capital_P_dangit( 'Wordpress' ) );
+
+               $wp_current_filter = array( 'the_title' );
+               $this->assertSame( 'WordPress', capital_P_dangit( 'Wordpress' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingcleanPrephpfromrev51622trunktestsphpunittestsformattingCleanPrephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/cleanPre.php (from rev 51622, trunk/tests/phpunit/tests/formatting/CleanPre.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/cleanPre.php                         (rev 0)
+++ trunk/tests/phpunit/tests/formatting/cleanPre.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,40 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * The clean_pre() removes pararaph and line break
+ * tags within `<pre>` elements as part of wpautop().
+ *
+ * @group formatting
+ * @expectedDeprecated clean_pre
+ */
+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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( $res, clean_pre( $source ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingconvertInvalidEntriesphpfromrev51622trunktestsphpunittestsformattingConvertInvalidEntriesphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/convertInvalidEntries.php (from rev 51622, trunk/tests/phpunit/tests/formatting/ConvertInvalidEntries.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/convertInvalidEntries.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/convertInvalidEntries.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,25 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_ConvertInvalidEntities 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->assertSame( $output, convert_invalid_entities( $input ) );
+       }
+
+       /**
+        * @ticket 20503
+        */
+       function test_replaces_latin_letter_z_with_caron() {
+               $input  = '&#142;&#158;';
+               $output = '&#381;&#382;';
+               $this->assertSame( $output, convert_invalid_entities( $input ) );
+       }
+
+       function test_escapes_lone_ampersands() {
+               $this->assertSame( 'at&#038;t', convert_chars( 'at&t' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingconvertSmiliesphpfromrev51622trunktestsphpunittestsformattingSmiliesphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/convertSmilies.php (from rev 51622, trunk/tests/phpunit/tests/formatting/Smilies.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/convertSmilies.php                           (rev 0)
+++ trunk/tests/phpunit/tests/formatting/convertSmilies.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,355 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @group emoji
+ */
+class Tests_Formatting_ConvertSmilies extends WP_UnitTestCase {
+
+       /**
+        * Basic Test Content DataProvider
+        *
+        * array ( input_txt, converted_output_txt)
+        */
+       public function get_smilies_input_output() {
+               $includes_path = includes_url( 'images/smilies/' );
+
+               return array(
+                       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 :?:',
+                               "Lorem ipsum dolor sit amet mauris \xf0\x9f\x98\x89 Praesent gravida sodales. \xf0\x9f\x98\x86 Vivamus nec diam in faucibus eu, bibendum varius nec, imperdiet purus est, at augue at lacus malesuada elit dapibus a, \xf0\x9f\x98\xae mauris. Cras mauris viverra elit. Nam laoreet viverra. Pellentesque tortor. Nam libero ante, porta urna ut turpis. Nullam wisi magna, <img src=\"${includes_path}mrgreen.png\" alt=\":mrgreen:\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" /> 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 \xe2\x9d\x93",
+                       ),
+                       array(
+                               '<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>Welcome to the jungle!</strong> We got fun n games! \xf0\x9f\x99\x82 We got everything you want \xf0\x9f\x98\x8e <em>Honey we know the names \xf0\x9f\x99\x82</em>",
+                       ),
+                       array(
+                               "<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;)>a little bit of this\na little bit:other: of that \xf0\x9f\x98\x80\n\xf0\x9f\x98\x80 a little bit of good\nyeah with a little bit of bad8O",
+                       ),
+                       array(
+                               '<strong style="here comes the sun :-D">and I say it\'s allright:D:D',
+                               '<strong style="here comes the sun :-D">and I say it\'s allright:D:D',
+                       ),
+                       array(
+                               '<!-- Woo-hoo, I\'m a comment, baby! :x > -->',
+                               '<!-- Woo-hoo, I\'m a comment, baby! :x > -->',
+                       ),
+                       array(
+                               ':?:P:?::-x:mrgreen:::',
+                               ':?:P:?::-x:mrgreen:::',
+                       ),
+               );
+       }
+
+       /**
+        * @dataProvider get_smilies_input_output
+        *
+        * Basic Validation Test to confirm that smilies are converted to image
+        * when use_smilies = 1 and not when use_smilies = 0
+        */
+       function test_convert_standard_smilies( $in_txt, $converted_txt ) {
+               // Standard smilies, use_smilies: ON.
+               update_option( 'use_smilies', 1 );
+
+               smilies_init();
+
+               $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
+
+               // Standard smilies, use_smilies: OFF.
+               update_option( 'use_smilies', 0 );
+
+               $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
+       }
+
+       /**
+        * Custom Smilies Test Content DataProvider
+        *
+        * array ( input_txt, converted_output_txt)
+        */
+       public function get_custom_smilies_input_output() {
+               $includes_path = includes_url( 'images/smilies/' );
+
+               return array(
+                       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:',
+                               '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=":monkey:" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
+                       ),
+                       array(
+                               '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:',
+                               'Star Wars Jedi Knight <img src="' . $includes_path . 'icon_arrow.gif" alt=":arrow:" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 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=":nervou:" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
+                       ),
+                       array(
+                               ':arrow: monkey: Lorem ipsum dolor sit amet enim. Etiam ullam :PP <br />corper. Suspendisse a pellentesque dui, non felis.<a> :arrow: :arrow</a>',
+                               '<img src="' . $includes_path . 'icon_arrow.gif" alt=":arrow:" class="wp-smiley" style="height: 1em; max-height: 1em;" /> monkey: Lorem ipsum dolor sit amet enim. Etiam ullam <img src="' . $includes_path . 'icon_tongue.gif" alt=":PP" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <br />corper. Suspendisse a pellentesque dui, non felis.<a> <img src="' . $includes_path . 'icon_arrow.gif" alt=":arrow:" class="wp-smiley" style="height: 1em; max-height: 1em;" /> :arrow</a>',
+                       ),
+               );
+       }
+
+       /**
+        * @dataProvider get_custom_smilies_input_output
+        *
+        * Validate Custom Smilies are converted to images when use_smilies = 1
+        */
+       function test_convert_custom_smilies( $in_txt, $converted_txt ) {
+               global $wpsmiliestrans;
+
+               // Custom smilies, use_smilies: ON.
+               update_option( 'use_smilies', 1 );
+
+               if ( ! isset( $wpsmiliestrans ) ) {
+                       smilies_init();
+               }
+
+               $trans_orig = $wpsmiliestrans; // Save original translations array.
+
+               $wpsmiliestrans = array(
+                       ':PP'      => 'icon_tongue.gif',
+                       ':arrow:'  => 'icon_arrow.gif',
+                       ':monkey:' => 'icon_shock_the_monkey.gif',
+                       ':nervou:' => 'icon_nervou.gif',
+               );
+
+               smilies_init();
+
+               $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
+
+               // Standard smilies, use_smilies: OFF.
+               update_option( 'use_smilies', 0 );
+
+               $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
+
+               $wpsmiliestrans = $trans_orig; // Reset original translations array.
+       }
+
+
+       /**
+        * DataProvider of HTML elements/tags that smilie matches should be ignored in
+        */
+       public function get_smilies_ignore_tags() {
+               return array(
+                       array( 'pre' ),
+                       array( 'code' ),
+                       array( 'script' ),
+                       array( 'style' ),
+                       array( 'textarea' ),
+               );
+       }
+
+       /**
+        * Validate Conversion of Smilies is ignored in pre-determined tags
+        * pre, code, script, style
+        *
+        * @ticket 16448
+        * @dataProvider get_smilies_ignore_tags
+        */
+       public function test_ignore_smilies_in_tags( $element ) {
+               $includes_path = includes_url( 'images/smilies/' );
+
+               $in_str  = 'Do we ingore smilies ;-) in ' . $element . ' tags <' . $element . ' class="foo">My Content Here :?: </' . $element . '>';
+               $exp_str = "Do we ingore smilies \xf0\x9f\x98\x89 in $element tags <$element class=\"foo\">My Content Here :?: </$element>";
+
+               // Standard smilies, use_smilies: ON.
+               update_option( 'use_smilies', 1 );
+               smilies_init();
+
+               $this->assertSame( $exp_str, convert_smilies( $in_str ) );
+
+               // Standard smilies, use_smilies: OFF.
+               update_option( 'use_smilies', 0 );
+       }
+
+       /**
+        * DataProvider of Smilie Combinations
+        */
+       public function get_smilies_combinations() {
+               $includes_path = includes_url( 'images/smilies/' );
+
+               return array(
+                       array(
+                               '8-O :-(',
+                               "\xf0\x9f\x98\xaf \xf0\x9f\x99\x81",
+                       ),
+                       array(
+                               '8-) 8-O',
+                               "\xf0\x9f\x98\x8e \xf0\x9f\x98\xaf",
+                       ),
+                       array(
+                               '8-) 8O',
+                               "\xf0\x9f\x98\x8e \xf0\x9f\x98\xaf",
+                       ),
+                       array(
+                               '8-) :-(',
+                               "\xf0\x9f\x98\x8e \xf0\x9f\x99\x81",
+                       ),
+                       array(
+                               '8-) :twisted:',
+                               "\xf0\x9f\x98\x8e \xf0\x9f\x98\x88",
+                       ),
+                       array(
+                               '8O :twisted: :( :? :roll: :mrgreen:',
+                               "\xf0\x9f\x98\xaf \xf0\x9f\x98\x88 \xf0\x9f\x99\x81 \xf0\x9f\x98\x95 \xf0\x9f\x99\x84 <img src=\"{$includes_path}mrgreen.png\" alt=\":mrgreen:\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" />",
+                       ),
+               );
+       }
+
+       /**
+        * Validate Combinations of Smilies separated by single space
+        * are converted correctly
+        *
+        * @ticket 20124
+        * @dataProvider get_smilies_combinations
+        */
+       public function test_smilies_combinations( $in_txt, $converted_txt ) {
+               // Custom smilies, use_smilies: ON.
+               update_option( 'use_smilies', 1 );
+               smilies_init();
+
+               $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
+
+               // Custom smilies, use_smilies: OFF.
+               update_option( 'use_smilies', 0 );
+
+               $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
+       }
+
+       /**
+        * DataProvider of Single Smilies input and converted output
+        */
+       public function get_single_smilies_input_output() {
+               $includes_path = includes_url( 'images/smilies/' );
+
+               return array(
+                       array(
+                               '8-O :-(',
+                               '8-O :-(',
+                       ),
+                       array(
+                               '8O :) additional text here :)',
+                               '8O <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" /> additional text here <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
+                       ),
+                       array(
+                               ':) :) :) :)',
+                               '<img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="' . $includes_path . 'simple-smile.png" alt=":)" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
+                       ),
+               );
+       }
+
+       /**
+        * Validate Smilies are converted for single smilie in
+        * the $wpsmiliestrans global array
+        *
+        * @ticket 25303
+        * @dataProvider get_single_smilies_input_output
+        */
+       public function test_single_smilies_in_wpsmiliestrans( $in_txt, $converted_txt ) {
+               global $wpsmiliestrans;
+
+               // Standard smilies, use_smilies: ON.
+               update_option( 'use_smilies', 1 );
+
+               if ( ! isset( $wpsmiliestrans ) ) {
+                       smilies_init();
+               }
+
+               $orig_trans = $wpsmiliestrans; // Save original tranlations array.
+
+               $wpsmiliestrans = array(
+                       ':)' => 'simple-smile.png',
+               );
+
+               smilies_init();
+
+               $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
+
+               // Standard smilies, use_smilies: OFF.
+               update_option( 'use_smilies', 0 );
+
+               $this->assertSame( $in_txt, convert_smilies( $in_txt ) );
+
+               $wpsmiliestrans = $orig_trans; // Reset original translations array.
+       }
+
+       public function get_spaces_around_smilies() {
+               $nbsp = "\xC2\xA0";
+
+               return array(
+                       array(
+                               'test :) smile',
+                               "test \xf0\x9f\x99\x82 smile",
+                       ),
+                       array(
+                               'test &nbsp;:)&nbsp;smile',
+                               "test &nbsp;\xf0\x9f\x99\x82&nbsp;smile",
+                       ),
+                       array(
+                               "test {$nbsp}:){$nbsp}smile",
+                               "test {$nbsp}\xf0\x9f\x99\x82{$nbsp}smile",
+                       ),
+               );
+       }
+
+       /**
+        * Check that $wp_smiliessearch pattern will match smilies
+        * between spaces, but never capture those spaces.
+        *
+        * Further check that spaces aren't randomly deleted
+        * or added when replacing the text with an image.
+        *
+        * @ticket 22692
+        * @dataProvider get_spaces_around_smilies
+        */
+       function test_spaces_around_smilies( $in_txt, $converted_txt ) {
+               // Standard smilies, use_smilies: ON.
+               update_option( 'use_smilies', 1 );
+
+               smilies_init();
+
+               $this->assertSame( $converted_txt, convert_smilies( $in_txt ) );
+
+               // Standard smilies, use_smilies: OFF.
+               update_option( 'use_smilies', 0 );
+       }
+
+       /**
+        * Test to ensure smilies can be removed with a filter
+        *
+        * @ticket 35905
+        */
+       public function test_smilies_filter_removes_smilies() {
+               add_filter( 'smilies', array( $this, '_filter_remove_smilies' ) );
+               smilies_init();
+               remove_filter( 'smilies', array( $this, '_filter_remove_smilies' ) );
+
+               $txt = ':oops: I did it again';
+
+               $this->assertSame( $txt, convert_smilies( $txt ) );
+       }
+
+       /**
+        * Test to ensure smilies can be added with a filter
+        *
+        * @ticket 35905
+        */
+       public function test_smilies_filter_adds_smilies() {
+               add_filter( 'smilies', array( $this, '_filter_add_smilies' ) );
+               smilies_init();
+               remove_filter( 'smilies', array( $this, '_filter_add_smilies' ) );
+
+               $txt          = 'You played with my <3';
+               $expected_txt = 'You played with my \xe2\x9d\xa4';
+
+               $this->assertSame( $expected_txt, convert_smilies( $txt ) );
+       }
+
+
+       public function _filter_remove_smilies( $wpsmiliestrans ) {
+               unset( $wpsmiliestrans[':oops:'] );
+               return $wpsmiliestrans;
+       }
+
+       public function _filter_add_smilies( $wpsmiliestrans ) {
+               $wpsmiliestrans['<3'] = '\xe2\x9d\xa4';
+               return $wpsmiliestrans;
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingemojiphpfromrev51622trunktestsphpunittestsformattingEmojiphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/emoji.php (from rev 51622, trunk/tests/phpunit/tests/formatting/Emoji.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/emoji.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/emoji.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,155 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @group emoji
+ */
+class Tests_Formatting_Emoji extends WP_UnitTestCase {
+
+       private $png_cdn = 'https://s.w.org/images/core/emoji/13.1.0/72x72/';
+       private $svn_cdn = 'https://s.w.org/images/core/emoji/13.1.0/svg/';
+
+       /**
+        * @ticket 36525
+        */
+       public function test_unfiltered_emoji_cdns() {
+               // `_print_emoji_detection_script()` assumes `wp-includes/js/wp-emoji-loader.js` is present:
+               self::touch( ABSPATH . WPINC . '/js/wp-emoji-loader.js' );
+               $output = get_echo( '_print_emoji_detection_script' );
+
+               $this->assertStringContainsString( wp_json_encode( $this->png_cdn ), $output );
+               $this->assertStringContainsString( wp_json_encode( $this->svn_cdn ), $output );
+       }
+
+       public function _filtered_emoji_svn_cdn( $cdn = '' ) {
+               return 'https://s.wordpress.org/images/core/emoji/svg/';
+       }
+
+       /**
+        * @ticket 36525
+        */
+       public function test_filtered_emoji_svn_cdn() {
+               $filtered_svn_cdn = $this->_filtered_emoji_svn_cdn();
+
+               add_filter( 'emoji_svg_url', array( $this, '_filtered_emoji_svn_cdn' ) );
+
+               // `_print_emoji_detection_script()` assumes `wp-includes/js/wp-emoji-loader.js` is present:
+               self::touch( ABSPATH . WPINC . '/js/wp-emoji-loader.js' );
+               $output = get_echo( '_print_emoji_detection_script' );
+
+               $this->assertStringContainsString( wp_json_encode( $this->png_cdn ), $output );
+               $this->assertStringNotContainsString( wp_json_encode( $this->svn_cdn ), $output );
+               $this->assertStringContainsString( wp_json_encode( $filtered_svn_cdn ), $output );
+
+               remove_filter( 'emoji_svg_url', array( $this, '_filtered_emoji_svn_cdn' ) );
+       }
+
+       public function _filtered_emoji_png_cdn( $cdn = '' ) {
+               return 'https://s.wordpress.org/images/core/emoji/png_cdn/';
+       }
+
+       /**
+        * @ticket 36525
+        */
+       public function test_filtered_emoji_png_cdn() {
+               $filtered_png_cdn = $this->_filtered_emoji_png_cdn();
+
+               add_filter( 'emoji_url', array( $this, '_filtered_emoji_png_cdn' ) );
+
+               // `_print_emoji_detection_script()` assumes `wp-includes/js/wp-emoji-loader.js` is present:
+               self::touch( ABSPATH . WPINC . '/js/wp-emoji-loader.js' );
+               $output = get_echo( '_print_emoji_detection_script' );
+
+               $this->assertStringContainsString( wp_json_encode( $filtered_png_cdn ), $output );
+               $this->assertStringNotContainsString( wp_json_encode( $this->png_cdn ), $output );
+               $this->assertStringContainsString( wp_json_encode( $this->svn_cdn ), $output );
+
+               remove_filter( 'emoji_url', array( $this, '_filtered_emoji_png_cdn' ) );
+       }
+
+       /**
+        * @ticket 41501
+        */
+       public function test_wp_emoji_list_returns_data() {
+               $default = _wp_emoji_list();
+               $this->assertNotEmpty( $default );
+
+               $entities = _wp_emoji_list( 'entities' );
+               $this->assertNotEmpty( $entities );
+
+               $this->assertSame( $default, $entities );
+
+               $partials = _wp_emoji_list( 'partials' );
+               $this->assertNotEmpty( $partials );
+
+               $this->assertNotSame( $default, $partials );
+       }
+
+       public function data_wp_encode_emoji() {
+               return array(
+                       array(
+                               // Not emoji.
+                               '’',
+                               '’',
+                       ),
+                       array(
+                               // Simple emoji.
+                               '🙂',
+                               '&#x1f642;',
+                       ),
+                       array(
+                               // Skin tone, gender, ZWJ, emoji selector.
+                               '👮🏼‍♀️',
+                               '&#x1f46e;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;',
+                       ),
+                       array(
+                               // Unicode 10.
+                               '🧚',
+                               '&#x1f9da;',
+                       ),
+               );
+       }
+
+       /**
+        * @ticket 35293
+        * @dataProvider data_wp_encode_emoji
+        */
+       public function test_wp_encode_emoji( $emoji, $expected ) {
+               $this->assertSame( $expected, wp_encode_emoji( $emoji ) );
+       }
+
+       public function data_wp_staticize_emoji() {
+               $data = array(
+                       array(
+                               // Not emoji.
+                               '’',
+                               '’',
+                       ),
+                       array(
+                               // Simple emoji.
+                               '🙂',
+                               '<img src="' . $this->png_cdn . '1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
+                       ),
+                       array(
+                               // Skin tone, gender, ZWJ, emoji selector.
+                               '👮🏼‍♀️',
+                               '<img src="' . $this->png_cdn . '1f46e-1f3fc-200d-2640-fe0f.png" alt="👮🏼‍♀️" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
+                       ),
+                       array(
+                               // Unicode 10.
+                               '🧚',
+                               '<img src="' . $this->png_cdn . '1f9da.png" alt="🧚" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
+                       ),
+               );
+
+               return $data;
+       }
+
+       /**
+        * @ticket 35293
+        * @dataProvider data_wp_staticize_emoji
+        */
+       public function test_wp_staticize_emoji( $emoji, $expected ) {
+               $this->assertSame( $expected, wp_staticize_emoji( $emoji ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingent2ncrphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/formatting/ent2ncr.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/ent2ncr.php  2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/ent2ncr.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3,7 +3,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * @group formatting
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-class Tests_Formatting_Ent2NCR extends WP_UnitTestCase {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+class Tests_Formatting_Ent2ncr extends WP_UnitTestCase {
</ins><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * @dataProvider entities
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span></span></pre></div>
<a id="trunktestsphpunittestsformattingescAttrphpfromrev51622trunktestsphpunittestsformattingEscAttrphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/escAttr.php (from rev 51622, trunk/tests/phpunit/tests/formatting/EscAttr.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/escAttr.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/escAttr.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,32 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_EscAttr extends WP_UnitTestCase {
+       function test_esc_attr_quotes() {
+               $attr = '"double quotes"';
+               $this->assertSame( '&quot;double quotes&quot;', esc_attr( $attr ) );
+
+               $attr = "'single quotes'";
+               $this->assertSame( '&#039;single quotes&#039;', esc_attr( $attr ) );
+
+               $attr = "'mixed' " . '"quotes"';
+               $this->assertSame( '&#039;mixed&#039; &quot;quotes&quot;', esc_attr( $attr ) );
+
+               // Handles double encoding?
+               $attr = '"double quotes"';
+               $this->assertSame( '&quot;double quotes&quot;', esc_attr( esc_attr( $attr ) ) );
+
+               $attr = "'single quotes'";
+               $this->assertSame( '&#039;single quotes&#039;', esc_attr( esc_attr( $attr ) ) );
+
+               $attr = "'mixed' " . '"quotes"';
+               $this->assertSame( '&#039;mixed&#039; &quot;quotes&quot;', esc_attr( esc_attr( $attr ) ) );
+       }
+
+       function test_esc_attr_amp() {
+               $out = esc_attr( 'foo & bar &baz; &nbsp;' );
+               $this->assertSame( 'foo &amp; bar &amp;baz; &nbsp;', $out );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingescHtmlphpfromrev51622trunktestsphpunittestsformattingEscHtmlphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/escHtml.php (from rev 51622, trunk/tests/phpunit/tests/formatting/EscHtml.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/escHtml.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/escHtml.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,40 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_EscHtml extends WP_UnitTestCase {
+       function test_esc_html_basics() {
+               // Simple string.
+               $html = 'The quick brown fox.';
+               $this->assertSame( $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->assertSame( $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->assertSame( $escaped, esc_html( $html ) );
+       }
+
+       function test_escapes_ampersands() {
+               $source = 'penn & teller & at&t';
+               $res    = 'penn &amp; teller &amp; at&amp;t';
+               $this->assertSame( $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->assertSame( $res, esc_html( $source ) );
+       }
+
+       function test_ignores_existing_entities() {
+               $source = '&#038; &#x00A3; &#x22; &amp;';
+               $res    = '&#038; &#xA3; &#x22; &amp;';
+               $this->assertSame( $res, esc_html( $source ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingescJsphpfromrev51622trunktestsphpunittestsformattingJSEscapephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/escJs.php (from rev 51622, trunk/tests/phpunit/tests/formatting/JSEscape.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/escJs.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/escJs.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,46 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_EscJs extends WP_UnitTestCase {
+       function test_js_escape_simple() {
+               $out = esc_js( 'foo bar baz();' );
+               $this->assertSame( '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->assertSame( "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->assertSame( 'foo t bar ' . $bs . $bs . ' baz', $out );
+       }
+
+       function test_js_escape_amp() {
+               $out = esc_js( 'foo & bar &baz; &nbsp;' );
+               $this->assertSame( 'foo &amp; bar &amp;baz; &nbsp;', $out );
+       }
+
+       function test_js_escape_quote_entity() {
+               $out = esc_js( 'foo &#x27; bar &#39; baz &#x26;' );
+               $this->assertSame( "foo \\' bar \\' baz &#x26;", $out );
+       }
+
+       function test_js_no_carriage_return() {
+               $out = esc_js( "foo\rbar\nbaz\r" );
+               // \r is stripped.
+               $this->assertSame( "foobar\\nbaz", $out );
+       }
+
+       function test_js_escape_rn() {
+               $out = esc_js( "foo\r\nbar\nbaz\r\n" );
+               // \r is stripped.
+               $this->assertSame( "foo\\nbar\\nbaz\\n", $out );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingescTextareaphpfromrev51622trunktestsphpunittestsformattingEscTextareaphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/escTextarea.php (from rev 51622, trunk/tests/phpunit/tests/formatting/EscTextarea.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/escTextarea.php                              (rev 0)
+++ trunk/tests/phpunit/tests/formatting/escTextarea.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,36 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?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->assertSame( $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->assertSame( $utf8, esc_textarea( $utf8 ) );
+               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingescUrlphpfromrev51622trunktestsphpunittestsformattingEscUrlphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/escUrl.php (from rev 51622, trunk/tests/phpunit/tests/formatting/EscUrl.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/escUrl.php                           (rev 0)
+++ trunk/tests/phpunit/tests/formatting/escUrl.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,265 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_EscUrl extends WP_UnitTestCase {
+
+       /**
+        * @ticket 23605
+        */
+       function test_spaces() {
+               $this->assertSame( 'http://example.com/Mr%20WordPress', esc_url( 'http://example.com/Mr WordPress' ) );
+               $this->assertSame( 'http://example.com/Mr%20WordPress', esc_url( 'http://example.com/Mr%20WordPress' ) );
+               $this->assertSame( 'http://example.com/Mr%20%20WordPress', esc_url( 'http://example.com/Mr%20%20WordPress' ) );
+               $this->assertSame( 'http://example.com/Mr+WordPress', esc_url( 'http://example.com/Mr+WordPress' ) );
+               $this->assertSame( 'http://example.com/Mr+WordPress', esc_url( ' http://example.com/Mr+WordPress' ) );
+
+               $this->assertSame( 'http://example.com/?foo=one%20two%20three&#038;bar=four', esc_url( 'http://example.com/?foo=one two three&bar=four' ) );
+               $this->assertSame( 'http://example.com/?foo=one%20two%20three&#038;bar=four', esc_url( 'http://example.com/?foo=one%20two%20three&bar=four' ) );
+       }
+
+       function test_bad_characters() {
+               $this->assertSame( 'http://example.com/watchthelinefeedgo', esc_url( 'http://example.com/watchthelinefeed%0Ago' ) );
+               $this->assertSame( 'http://example.com/watchthelinefeedgo', esc_url( 'http://example.com/watchthelinefeed%0ago' ) );
+               $this->assertSame( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0Dgo' ) );
+               $this->assertSame( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0dgo' ) );
+               // Nesting checks.
+               $this->assertSame( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0%0ddgo' ) );
+               $this->assertSame( 'http://example.com/watchthecarriagereturngo', esc_url( 'http://example.com/watchthecarriagereturn%0%0DDgo' ) );
+               $this->assertSame( 'http://example.com/', esc_url( 'http://example.com/%0%0%0DAD' ) );
+               $this->assertSame( 'http://example.com/', esc_url( 'http://example.com/%0%0%0ADA' ) );
+               $this->assertSame( 'http://example.com/', esc_url( 'http://example.com/%0%0%0DAd' ) );
+               $this->assertSame( 'http://example.com/', esc_url( 'http://example.com/%0%0%0ADa' ) );
+       }
+
+       function test_relative() {
+               $this->assertSame( '/example.php', esc_url( '/example.php' ) );
+               $this->assertSame( 'example.php', esc_url( 'example.php' ) );
+               $this->assertSame( '#fragment', esc_url( '#fragment' ) );
+               $this->assertSame( '?foo=bar', esc_url( '?foo=bar' ) );
+       }
+
+       function test_all_url_parts() {
+               $url = 'https://user:pass@host.example.com:1234/path;p=1?query=2&r[]=3#fragment';
+
+               $this->assertSame(
+                       array(
+                               'scheme'   => 'https',
+                               'host'     => 'host.example.com',
+                               'port'     => 1234,
+                               'user'     => 'user',
+                               'pass'     => 'pass',
+                               'path'     => '/path;p=1',
+                               'query'    => 'query=2&r[]=3',
+                               'fragment' => 'fragment',
+                       ),
+                       parse_url( $url )
+               );
+               $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', esc_url_raw( $url ) );
+               $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&#038;r%5B%5D=3#fragment', esc_url( $url ) );
+       }
+
+       function test_bare() {
+               $this->assertSame( 'http://example.com?foo', esc_url( 'example.com?foo' ) );
+               $this->assertSame( 'http://example.com', esc_url( 'example.com' ) );
+               $this->assertSame( 'http://localhost', esc_url( 'localhost' ) );
+               $this->assertSame( 'http://example.com/foo', esc_url( 'example.com/foo' ) );
+               $this->assertSame( 'http://баба.org/баба', esc_url( 'баба.org/баба' ) );
+       }
+
+       function test_encoding() {
+               $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );
+               $this->assertSame( 'http://example.com?foo=1&amp;bar=2', esc_url_raw( 'http://example.com?foo=1&amp;bar=2' ) );
+               $this->assertSame( 'http://example.com?foo=1&#038;bar=2', esc_url_raw( 'http://example.com?foo=1&#038;bar=2' ) );
+
+               $this->assertSame( 'http://example.com?foo=1&#038;bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) );
+               $this->assertSame( 'http://example.com?foo=1&#038;bar=2', esc_url( 'http://example.com?foo=1&amp;bar=2' ) );
+               $this->assertSame( 'http://example.com?foo=1&#038;bar=2', esc_url( 'http://example.com?foo=1&#038;bar=2' ) );
+
+               $param = urlencode( 'http://example.com/?one=1&two=2' );
+               $this->assertSame( "http://example.com?url={$param}", esc_url( "http://example.com?url={$param}" ) );
+       }
+
+       function test_protocol() {
+               $this->assertSame( 'http://example.com', esc_url( 'http://example.com' ) );
+               $this->assertSame( '', esc_url( 'nasty://example.com/' ) );
+               $this->assertSame(
+                       '',
+                       esc_url(
+                               'example.com',
+                               array(
+                                       'https',
+                               )
+                       )
+               );
+               $this->assertSame(
+                       '',
+                       esc_url(
+                               'http://example.com',
+                               array(
+                                       'https',
+                               )
+                       )
+               );
+               $this->assertSame(
+                       'https://example.com',
+                       esc_url(
+                               'https://example.com',
+                               array(
+                                       'http',
+                                       'https',
+                               )
+                       )
+               );
+
+               foreach ( wp_allowed_protocols() as $scheme ) {
+                       $this->assertSame( "{$scheme}://example.com", esc_url( "{$scheme}://example.com" ), $scheme );
+                       $this->assertSame(
+                               "{$scheme}://example.com",
+                               esc_url(
+                                       "{$scheme}://example.com",
+                                       array(
+                                               $scheme,
+                                       )
+                               ),
+                               $scheme
+                       );
+               }
+
+               $this->assertNotContains( 'data', wp_allowed_protocols() );
+               $this->assertSame( '', esc_url( 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D' ) );
+
+               $this->assertNotContains( 'foo', wp_allowed_protocols() );
+               $this->assertSame(
+                       'foo://example.com',
+                       esc_url(
+                               'foo://example.com',
+                               array(
+                                       'foo',
+                               )
+                       )
+               );
+
+       }
+
+       /**
+        * @ticket 23187
+        */
+       function test_protocol_case() {
+               $this->assertSame( 'http://example.com', esc_url( 'HTTP://example.com' ) );
+               $this->assertSame( 'http://example.com', esc_url( 'Http://example.com' ) );
+       }
+
+       function test_display_extras() {
+               $this->assertSame( 'http://example.com/&#039;quoted&#039;', esc_url( 'http://example.com/\'quoted\'' ) );
+               $this->assertSame( 'http://example.com/\'quoted\'', esc_url( 'http://example.com/\'quoted\'', null, 'notdisplay' ) );
+       }
+
+       function test_non_ascii() {
+               $this->assertSame( 'http://example.org/баба', esc_url( 'http://example.org/баба' ) );
+               $this->assertSame( 'http://баба.org/баба', esc_url( 'http://баба.org/баба' ) );
+               $this->assertSame( 'http://müller.com/', esc_url( 'http://müller.com/' ) );
+       }
+
+       function test_feed() {
+               $this->assertSame( '', esc_url( 'feed:javascript:alert(1)' ) );
+               $this->assertSame( '', esc_url( 'feed:javascript:feed:alert(1)' ) );
+               $this->assertSame( '', esc_url( 'feed:feed:javascript:alert(1)' ) );
+               $this->assertSame( 'feed:feed:alert(1)', esc_url( 'feed:feed:alert(1)' ) );
+               $this->assertSame( 'feed:http://wordpress.org/feed/', esc_url( 'feed:http://wordpress.org/feed/' ) );
+       }
+
+       /**
+        * @ticket 16859
+        */
+       function test_square_brackets() {
+               $this->assertSame( '/example.php?one%5B%5D=two', esc_url( '/example.php?one[]=two' ) );
+               $this->assertSame( '?foo%5Bbar%5D=baz', esc_url( '?foo[bar]=baz' ) );
+               $this->assertSame( '//example.com/?foo%5Bbar%5D=baz', esc_url( '//example.com/?foo[bar]=baz' ) );
+               $this->assertSame( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'example.com/?foo[bar]=baz' ) );
+               $this->assertSame( 'http://localhost?foo%5Bbar%5D=baz', esc_url( 'localhost?foo[bar]=baz' ) );
+               $this->assertSame( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'http://example.com/?foo[bar]=baz' ) );
+               $this->assertSame( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'http://example.com/?foo%5Bbar%5D=baz' ) );
+               $this->assertSame( 'http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&foo[bar]=baz' ) );
+               $this->assertSame( 'http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&#038;foo%5Bbar%5D=baz' ) );
+       }
+
+       /**
+        * Courtesy of http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding
+        */
+       function test_reserved_characters() {
+               $url = "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$%27()*+,;=/?:@-._~!$%27()*+,;==#/?:@-._~!$&'()*+,;=";
+               $this->assertSame( $url, esc_url_raw( $url ) );
+       }
+
+       /**
+        * @ticket 21974
+        */
+       function test_protocol_relative_with_colon() {
+               $this->assertSame( '//example.com/foo?foo=abc:def', esc_url( '//example.com/foo?foo=abc:def' ) );
+       }
+
+       /**
+        * @ticket 31632
+        */
+       function test_mailto_with_newline() {
+               $body       = <<<EOT
+Hi there,
+
+I thought you might want to sign up for this newsletter
+EOT;
+               $body       = str_replace( "\r\n", "\n", $body );
+               $email_link = 'mailto:?body=' . rawurlencode( $body );
+               $email_link = esc_url( $email_link );
+               $this->assertSame( 'mailto:?body=Hi%20there%2C%0A%0AI%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
+       }
+
+       /**
+        * @ticket 31632
+        */
+       function test_mailto_in_http_url_with_newline() {
+               $body       = <<<EOT
+Hi there,
+
+I thought you might want to sign up for this newsletter
+EOT;
+               $body       = str_replace( "\r\n", "\n", $body );
+               $email_link = 'http://example.com/mailto:?body=' . rawurlencode( $body );
+               $email_link = esc_url( $email_link );
+               $this->assertSame( 'http://example.com/mailto:?body=Hi%20there%2CI%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
+       }
+
+       /**
+        * @ticket 23605
+        */
+       function test_mailto_with_spaces() {
+               $body = 'Hi there, I thought you might want to sign up for this newsletter';
+
+               $email_link = 'mailto:?body=' . $body;
+               $email_link = esc_url( $email_link );
+               $this->assertSame( 'mailto:?body=Hi%20there,%20I%20thought%20you%20might%20want%20to%20sign%20up%20for%20this%20newsletter', $email_link );
+       }
+
+       /**
+        * @ticket 28015
+        */
+       function test_invalid_charaters() {
+               $this->assertEmpty( esc_url_raw( '"^<>{}`' ) );
+       }
+
+       /**
+        * @ticket 34202
+        */
+       function test_ipv6_hosts() {
+               $this->assertSame( '//[::127.0.0.1]', esc_url( '//[::127.0.0.1]' ) );
+               $this->assertSame( 'http://[::FFFF::127.0.0.1]', esc_url( 'http://[::FFFF::127.0.0.1]' ) );
+               $this->assertSame( 'http://[::127.0.0.1]', esc_url( 'http://[::127.0.0.1]' ) );
+               $this->assertSame( 'http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]', esc_url( 'http://[::DEAD:BEEF:DEAD:BEEF:DEAD:BEEF:DEAD:BEEF]' ) );
+
+               // IPv6 with square brackets in the query? Why not.
+               $this->assertSame( '//[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url( '//[::FFFF::127.0.0.1]/?foo[bar]=baz' ) );
+               $this->assertSame( 'http://[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url( 'http://[::FFFF::127.0.0.1]/?foo[bar]=baz' ) );
+       }
+
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingescXmlphpfromrev51622trunktestsphpunittestsformattingEscXmlphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/escXml.php (from rev 51622, trunk/tests/phpunit/tests/formatting/EscXml.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/escXml.php                           (rev 0)
+++ trunk/tests/phpunit/tests/formatting/escXml.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,135 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_EscXml extends WP_UnitTestCase {
+       /**
+        * Test basic escaping
+        *
+        * @dataProvider _test_esc_xml_basics_dataprovider
+        *
+        * @param string $source   The source string to be escaped.
+        * @param string $expected The expected escaped value of `$source`.
+        */
+       public function test_esc_xml_basics( $source, $expected ) {
+               $actual = esc_xml( $source );
+               $this->assertSame( $expected, $actual );
+       }
+
+       /**
+        * Data provider for `test_esc_xml_basics()`.
+        *
+        * @return array {
+        *     @type string $source   The source string to be escaped.
+        *     @type string $expected The expected escaped value of `$source`.
+        * }
+        */
+       public function _test_esc_xml_basics_dataprovider() {
+               return array(
+                       // Simple string.
+                       array(
+                               'The quick brown fox.',
+                               'The quick brown fox.',
+                       ),
+                       // URL with &.
+                       array(
+                               'http://localhost/trunk/wp-login.php?action=logout&_wpnonce=cd57d75985',
+                               'http://localhost/trunk/wp-login.php?action=logout&amp;_wpnonce=cd57d75985',
+                       ),
+                       // SQL query w/ single quotes.
+                       array(
+                               "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",
+                               'SELECT meta_key, meta_value FROM wp_trunk_sitemeta WHERE meta_key IN (&apos;site_name&apos;, &apos;siteurl&apos;, &apos;active_sitewide_plugins&apos;, &apos;_site_transient_timeout_theme_roots&apos;, &apos;_site_transient_theme_roots&apos;, &apos;site_admins&apos;, &apos;can_compress_scripts&apos;, &apos;global_terms_enabled&apos;) AND site_id = 1',
+                       ),
+               );
+       }
+
+       public function test_escapes_ampersands() {
+               $source   = 'penn & teller & at&t';
+               $expected = 'penn &amp; teller &amp; at&amp;t';
+               $actual   = esc_xml( $source );
+               $this->assertSame( $expected, $actual );
+       }
+
+       public function test_escapes_greater_and_less_than() {
+               $source   = 'this > that < that <randomhtml />';
+               $expected = 'this &gt; that &lt; that &lt;randomhtml /&gt;';
+               $actual   = esc_xml( $source );
+               $this->assertSame( $expected, $actual );
+       }
+
+       public function test_escapes_html_named_entities() {
+               $source   = 'this &amp; is a &hellip; followed by &rsaquo; and more and a &nonexistent; entity';
+               $expected = 'this &amp; is a … followed by › and more and a &amp;nonexistent; entity';
+               $actual   = esc_xml( $source );
+               $this->assertSame( $expected, $actual );
+       }
+
+       public function test_ignores_existing_entities() {
+               $source = '&#038; &#x00A3; &#x22; &amp;';
+               // note that _wp_specialchars() strips leading 0's from numeric character references.
+               $expected = '&#038; &#xA3; &#x22; &amp;';
+               $actual   = esc_xml( $source );
+               $this->assertSame( $expected, $actual );
+       }
+
+       /**
+        * Test that CDATA Sections are not escaped.
+        *
+        * @dataProvider _test_ignores_cdata_sections_dataprovider
+        *
+        * @param string $source   The source string to be escaped.
+        * @param string $expected The expected escaped value of `$source`.
+        */
+       public function test_ignores_cdata_sections( $source, $expected ) {
+               $actual = esc_xml( $source );
+               $this->assertSame( $expected, $actual );
+       }
+
+       /**
+        * Data provider for `test_ignores_cdata_sections()`.
+        *
+        * @return array {
+        *     @type string $source   The source string to be escaped.
+        *     @type string $expected The expected escaped value of `$source`.
+        * }
+        */
+       public function _test_ignores_cdata_sections_dataprovider() {
+               return array(
+                       // basic CDATA Section containing chars that would otherwise be escaped if not in a CDATA Section
+                       // not to mention the CDATA Section markup itself :-)
+                       // $source contains embedded newlines to test that the regex that ignores CDATA Sections
+                       // correctly handles that case.
+                       array(
+                               "This is\na<![CDATA[test of\nthe <emergency>]]>\nbroadcast system",
+                               "This is\na<![CDATA[test of\nthe <emergency>]]>\nbroadcast system",
+                       ),
+                       // string with chars that should be escaped as well as a CDATA Section that should be not be.
+                       array(
+                               'This is &hellip; a <![CDATA[test of the <emergency>]]> broadcast <system />',
+                               'This is … a <![CDATA[test of the <emergency>]]> broadcast &lt;system /&gt;',
+                       ),
+                       // Same as above, but with the CDATA Section at the start of the string.
+                       array(
+                               '<![CDATA[test of the <emergency>]]> This is &hellip; a broadcast <system />',
+                               '<![CDATA[test of the <emergency>]]> This is … a broadcast &lt;system /&gt;',
+                       ),
+                       // Same as above, but with the CDATA Section at the end of the string.
+                       array(
+                               'This is &hellip; a broadcast <system /><![CDATA[test of the <emergency>]]>',
+                               'This is … a broadcast &lt;system /&gt;<![CDATA[test of the <emergency>]]>',
+                       ),
+                       // Multiple CDATA Sections.
+                       array(
+                               'This is &hellip; a <![CDATA[test of the <emergency>]]> &broadcast; <![CDATA[<system />]]>',
+                               'This is … a <![CDATA[test of the <emergency>]]> &amp;broadcast; <![CDATA[<system />]]>',
+                       ),
+                       // Ensure that ']]>' that does not mark the end of a CDATA Section is escaped.
+                       array(
+                               '<![CDATA[<&]]>]]>',
+                               '<![CDATA[<&]]>]]&gt;',
+                       ),
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingexcerptRemoveBlocksphpfromrev51622trunktestsphpunittestsformattingExcerptRemoveBlocksphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/excerptRemoveBlocks.php (from rev 51622, trunk/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/excerptRemoveBlocks.php                              (rev 0)
+++ trunk/tests/phpunit/tests/formatting/excerptRemoveBlocks.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,129 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @covers ::excerpt_remove_blocks
+ * @ticket 46133
+ */
+class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase {
+
+       public static $post_id;
+
+       public $content = '
+<!-- wp:paragraph -->
+<p>paragraph</p>
+<!-- /wp:paragraph -->
+<!-- wp:latest-posts {"postsToShow":3,"displayPostDate":true,"order":"asc","orderBy":"title"} /-->
+<!-- wp:spacer -->
+<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
+<!-- /wp:spacer -->
+<!-- wp:columns {"columns":1} -->
+<div class="wp-block-columns has-1-columns">
+       <!-- wp:column -->
+       <div class="wp-block-column">
+               <!-- wp:archives {"displayAsDropdown":false,"showPostCounts":false} /-->
+               
+               <!-- wp:paragraph -->
+               <p>paragraph inside column</p>
+               <!-- /wp:paragraph -->
+       </div>
+       <!-- /wp:column -->
+</div>
+<!-- /wp:columns -->
+';
+
+       public $filtered_content = '
+
+<p>paragraph</p>
+
+
+
+
+               <p>paragraph inside column</p>
+               
+';
+
+       /**
+        * Fake block rendering function.
+        *
+        * @since 5.2.0
+        *
+        * @return string Block output.
+        */
+       function render_fake_block() {
+               return get_the_excerpt( self::$post_id );
+       }
+
+       /**
+        * Set up.
+        *
+        * @since 5.2.0
+        */
+       function set_up() {
+               parent::set_up();
+               self::$post_id = $this->factory()->post->create(
+                       array(
+                               'post_excerpt' => '', // Empty excerpt, so it has to be generated.
+                               'post_content' => '<!-- wp:core/fake /-->',
+                       )
+               );
+               register_block_type(
+                       'core/fake',
+                       array(
+                               'render_callback' => array( $this, 'render_fake_block' ),
+                       )
+               );
+       }
+
+       /**
+        * Tear down.
+        *
+        * @since 5.2.0
+        */
+       function tear_down() {
+               $registry = WP_Block_Type_Registry::get_instance();
+               $registry->unregister( 'core/fake' );
+
+               parent::tear_down();
+       }
+
+       /**
+        * Tests excerpt_remove_blocks().
+        *
+        * @ticket 46133
+        */
+       function test_excerpt_remove_blocks() {
+               // Simple dynamic block..
+               $content = '<!-- wp:core/block /-->';
+
+               $this->assertEmpty( excerpt_remove_blocks( $content ) );
+
+               // Dynamic block with options, embedded in other content.
+               $this->assertSame( $this->filtered_content, excerpt_remove_blocks( $this->content ) );
+       }
+
+       /**
+        * Tests that dynamic blocks don't cause an out-of-memory error.
+        *
+        * When dynamic blocks happen to generate an excerpt, they can cause an
+        * infinite loop if that block is part of the post's content.
+        *
+        * `wp_trim_excerpt()` applies the `the_content` filter, which has
+        * `do_blocks` attached to it, trying to render the block which again will
+        * attempt to return an excerpt of that post.
+        *
+        * This infinite loop can be avoided by stripping dynamic blocks before
+        * `the_content` gets applied, just like shortcodes.
+        *
+        * @ticket 46133
+        */
+       function test_excerpt_infinite_loop() {
+               $query = new WP_Query(
+                       array(
+                               'post__in' => array( self::$post_id ),
+                       )
+               );
+               $query->the_post();
+               $this->assertEmpty( do_blocks( '<!-- wp:core/fake /-->' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattinggetBloginfophpfromrev51622trunktestsphpunittestsformattingBlogInfophp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/getBloginfo.php (from rev 51622, trunk/tests/phpunit/tests/formatting/BlogInfo.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/getBloginfo.php                              (rev 0)
+++ trunk/tests/phpunit/tests/formatting/getBloginfo.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,74 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_GetBloginfo extends WP_UnitTestCase {
+
+       /**
+        * @dataProvider locales
+        * @ticket 28303
+        */
+       function test_get_bloginfo_language( $test_locale, $expected ) {
+               global $locale;
+
+               $old_locale = $locale;
+
+               $locale = $test_locale;
+               $this->assertSame( $expected, get_bloginfo( 'language' ) );
+
+               $locale = $old_locale;
+       }
+
+       function locales() {
+               return array(
+                       // Locale, language code.
+                       array( 'en_US', 'en-US' ),
+                       array( 'ar', 'ar' ),
+                       array( 'de_DE', 'de-DE' ),
+                       array( 'de_DE_formal', 'de-DE-formal' ),
+                       array( 'oci', 'oci' ),
+                       array( 'pt_PT_ao1990', 'pt-PT-ao1990' ),
+                       array( 'ja_JP', 'ja-JP' ),
+               );
+       }
+
+       /**
+        * @ticket 27942
+        */
+       function test_bloginfo_sanitize_option() {
+               $old_values = array(
+                       'blogname'        => get_option( 'blogname' ),
+                       'blogdescription' => get_option( 'blogdescription' ),
+               );
+
+               $values = array(
+                       'foo'                  => 'foo',
+                       '<em>foo</em>'         => '&lt;em&gt;foo&lt;/em&gt;',
+                       '<script>foo</script>' => '&lt;script&gt;foo&lt;/script&gt;',
+                       '&lt;foo&gt;'          => '&lt;foo&gt;',
+                       '<foo'                 => '&lt;foo',
+               );
+
+               foreach ( $values as $value => $expected ) {
+                       $sanitized_value = sanitize_option( 'blogname', $value );
+                       update_option( 'blogname', $sanitized_value );
+
+                       $this->assertSame( $expected, $sanitized_value );
+                       $this->assertSame( $expected, get_bloginfo( 'name' ) );
+                       $this->assertSame( $expected, get_bloginfo( 'name', 'display' ) );
+
+                       $sanitized_value = sanitize_option( 'blogdescription', $value );
+                       update_option( 'blogdescription', $sanitized_value );
+
+                       $this->assertSame( $expected, $sanitized_value );
+                       $this->assertSame( $expected, get_bloginfo( 'description' ) );
+                       $this->assertSame( $expected, get_bloginfo( 'description', 'display' ) );
+               }
+
+               // Restore old values.
+               foreach ( $old_values as $option_name => $value ) {
+                       update_option( $option_name, $value );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattinggetUrlInContentphpfromrev51622trunktestsphpunittestsformattingGetUrlInContentphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/getUrlInContent.php (from rev 51622, trunk/tests/phpunit/tests/formatting/GetUrlInContent.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/getUrlInContent.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/getUrlInContent.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,50 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_GetUrlInContent extends WP_UnitTestCase {
+
+       /**
+        * URL Content Data Provider
+        *
+        * array ( input_txt, converted_output_txt )
+        */
+       public function get_input_output() {
+               return array(
+                       array( // Empty content.
+                               '',
+                               false,
+                       ),
+                       array( // No URLs.
+                               '<div>NO URL CONTENT</div>',
+                               false,
+                       ),
+                       array( // Ignore none link elements.
+                               '<div href="/relative.php">NO URL CONTENT</div>',
+                               false,
+                       ),
+                       array( // Single link.
+                               'ABC<div><a href="/relative.php">LINK</a> CONTENT</div>',
+                               '/relative.php',
+                       ),
+                       array( // Multiple links.
+                               'ABC<div><a href="/relative.php">LINK</a> CONTENT <a href="/suppress.php">LINK</a></div>',
+                               '/relative.php',
+                       ),
+                       array( // Escape link.
+                               'ABC<div><a href="http://example.com/Mr%20WordPress 2">LINK</a> CONTENT </div>',
+                               'http://example.com/Mr%20WordPress%202',
+                       ),
+               );
+       }
+
+       /**
+        * Validate the get_url_in_content function
+        *
+        * @dataProvider get_input_output
+        */
+       function test_get_url_in_content( $in_str, $exp_str ) {
+               $this->assertSame( $exp_str, get_url_in_content( $in_str ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattinghumanTimeDiffphpfromrev51622trunktestsphpunittestsformattingHumanTimeDiffphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/humanTimeDiff.php (from rev 51622, trunk/tests/phpunit/tests/formatting/HumanTimeDiff.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/humanTimeDiff.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/humanTimeDiff.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,74 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @ticket 38773
+ */
+class Tests_Formatting_HumanTimeDiff extends WP_UnitTestCase {
+
+       /**
+        * @group formatting
+        * @ticket 38773
+        * @dataProvider data_test_human_time_diff
+        */
+       function test_human_time_diff( $expected, $stopdate, $message ) {
+               $startdate = new DateTime( '2016-01-01 12:00:00' );
+               $this->assertSame( $expected, human_time_diff( $startdate->format( 'U' ), $stopdate->format( 'U' ) ), $message );
+       }
+
+       // Data for test_human_time_diff.
+       function data_test_human_time_diff() {
+               return array(
+                       array(
+                               '37 seconds',
+                               new DateTime( '2016-01-01 12:00:37' ),
+                               'Test a difference of 37 seconds.',
+                       ),
+                       array(
+                               '5 mins',
+                               new DateTime( '2016-01-01 12:05:00' ),
+                               'Test a difference of 5 minutes.',
+                       ),
+                       array(
+                               '1 hour',
+                               new DateTime( '2016-01-01 13:00:00' ),
+                               'Test a difference of 1 hour.',
+                       ),
+                       array(
+                               '2 days',
+                               new DateTime( '2016-01-03 12:00:00' ),
+                               'Test a difference of 2 days.',
+                       ),
+                       array(
+                               '2 hours',
+                               new DateTime( '2016-01-01 14:29:59' ),
+                               'Test a difference of 2 hours, 29 minutes and 59 seconds  - should round down to 2 hours.',
+                       ),
+                       array(
+                               '3 hours',
+                               new DateTime( '2016-01-01 14:30:00' ),
+                               'Test a difference of 2 hours and 30 minutes - should round up to 3 hours.',
+                       ),
+                       array(
+                               '2 months',
+                               new DateTime( '2016-02-15 12:00:00' ),
+                               'Test a difference of 1 month and 15 days - should round up to 2 months.',
+                       ),
+                       array(
+                               '1 month',
+                               new DateTime( '2016-02-14 12:00:00' ),
+                               'Test a difference of 1 month and 14 days - should round down to 1 month.',
+                       ),
+                       array(
+                               '3 years',
+                               new DateTime( '2018-07-02 12:00:00' ),
+                               'Test a difference of 2 years 6 months and 1 day, should round up to 3 years.',
+                       ),
+                       array(
+                               '2 years',
+                               new DateTime( '2018-07-01 12:00:00' ),
+                               'Test a difference of 2 years 6 months, should round down to 2 years.',
+                       ),
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingisEmailphpfromrev51622trunktestsphpunittestsformattingIsEmailphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/isEmail.php (from rev 51622, trunk/tests/phpunit/tests/formatting/IsEmail.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/isEmail.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/isEmail.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,34 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_IsEmail extends WP_UnitTestCase {
+       function test_returns_the_email_address_if_it_is_valid() {
+               $data = array(
+                       'bob@example.com',
+                       'phil@example.info',
+                       'ace@204.32.222.14',
+                       'kevin@many.subdomains.make.a.happy.man.edu',
+                       'a@b.co',
+                       'bill+ted@example.com',
+               );
+               foreach ( $data as $datum ) {
+                       $this->assertSame( $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',
+                       'a@b.c',
+               );
+               foreach ( $data as $datum ) {
+                       $this->assertFalse( is_email( $datum ), $datum );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingisoDescramblerphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/tests/formatting/isoDescrambler.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/isoDescrambler.php   2021-08-16 20:16:13 UTC (rev 51622)
+++ trunk/tests/phpunit/tests/formatting/isoDescrambler.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,14 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?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->assertSame( 'this is some text', wp_iso_descrambler( '=?iso-8859-1?q?this=20is=20some=20text?=' ) );
-       }
-}
</del></span></pre></div>
<a id="trunktestsphpunittestsformattinglikeEscapephpfromrev51622trunktestsphpunittestsformattingLikeEscapephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/likeEscape.php (from rev 51622, trunk/tests/phpunit/tests/formatting/LikeEscape.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/likeEscape.php                               (rev 0)
+++ trunk/tests/phpunit/tests/formatting/likeEscape.php 2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,30 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_LikeEscape extends WP_UnitTestCase {
+       /**
+        * @ticket 10041
+        * @expectedDeprecated like_escape
+        */
+       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->assertSame( $expected[ $key ], like_escape( $input ) );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattinglinksAddTargetphpfromrev51622trunktestsphpunittestsformattingLinksAddTargetphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/linksAddTarget.php (from rev 51622, trunk/tests/phpunit/tests/formatting/LinksAddTarget.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/linksAddTarget.php                           (rev 0)
+++ trunk/tests/phpunit/tests/formatting/linksAddTarget.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,108 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * @group formatting
+ */
+class Tests_Formatting_LinksAddTarget extends WP_UnitTestCase {
+       /**
+        * Test Content DataProvider
+        *
+        * array ( input_txt, converted_output_txt)
+        */
+       public function get_input_output() {
+               return array(
+                       array(
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> END TEXT',
+                               null,
+                               null,
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC" target="_blank">LINK</a> HERE </div> END TEXT',
+                       ),
+                       array(
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <A href="XYZ" src="ABC">LINK</A> HERE </div> END TEXT',
+                               null,
+                               null,
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <A href="XYZ" src="ABC" target="_blank">LINK</A> HERE </div> END TEXT',
+                       ),
+                       array(
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <a href="XYZ"  >LINK</a>END TEXT',
+                               null,
+                               null,
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC" target="_blank">LINK</a> HERE </div> <a href="XYZ"   target="_blank">LINK</a>END TEXT',
+                       ),
+                       array(
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span>END TEXT</span>',
+                               '_top',
+                               null,
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC" target="_top">LINK</a> HERE </div> <span>END TEXT</span>',
+                       ),
+                       array(
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span>END TEXT</span>',
+                               '_top',
+                               array( 'span' ),
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="_top">END TEXT</span>',
+                       ),
+                       array(
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span>END TEXT</span>',
+                               '_top',
+                               array( 'SPAN' ),
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="_top">END TEXT</span>',
+                       ),
+                       array(
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="_top">END TEXT</span>',
+                               '_top',
+                               array( 'span', 'div' ),
+                               'MY CONTENT <div target="_top"> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="_top">END TEXT</span>',
+                       ),
+                       array(
+                               'MY CONTENT <div target=\'ABC\'> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="xyz">END TEXT</span>',
+                               '_top',
+                               array( 'span', 'div' ),
+                               'MY CONTENT <div target="_top"> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="_top">END TEXT</span>',
+                       ),
+                       array(
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span target="xyz" src="ABC">END TEXT</span>',
+                               '_top',
+                               array( 'span' ),
+                               'MY CONTENT <div> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </div> <span src="ABC" target="_top">END TEXT</span>',
+                       ),
+                       array(
+                               'MY CONTENT <aside> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </aside> END TEXT',
+                               null,
+                               null,
+                               'MY CONTENT <aside> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC" target="_blank">LINK</a> HERE </aside> END TEXT',
+                       ),
+                       array(
+                               'MY CONTENT <aside class="_blank"> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC">LINK</a> HERE </aside> END TEXT',
+                               null,
+                               null,
+                               'MY CONTENT <aside class="_blank"> SOME ADDITIONAL TEXT <a href="XYZ" src="ABC" target="_blank">LINK</a> HERE </aside> END TEXT',
+                       ),
+                       array(
+                               'MY CONTENT <blockquote>SOME</blockquote> ADDITIONAL TEXT <b>LINK</b> HERE END TEXT',
+                               '_blank',
+                               array( 'b' ),
+                               'MY CONTENT <blockquote>SOME</blockquote> ADDITIONAL TEXT <b target="_blank">LINK</b> HERE END TEXT',
+                       ),
+                       array(
+                               'MY CONTENT <blockquote target="_self">SOME</blockquote> ADDITIONAL TEXT <b>LINK</b> HERE END TEXT',
+                               '_blank',
+                               array( 'b' ),
+                               'MY CONTENT <blockquote target="_self">SOME</blockquote> ADDITIONAL TEXT <b target="_blank">LINK</b> HERE END TEXT',
+                       ),
+               );
+       }
+
+       /**
+        * Validate the normalize_whitespace function
+        *
+        * @dataProvider get_input_output
+        */
+       function test_normalize_whitespace( $content, $target, $tags, $exp_str ) {
+               if ( true === is_null( $target ) ) {
+                       $this->assertSame( $exp_str, links_add_target( $content ) );
+               } elseif ( true === is_null( $tags ) ) {
+                       $this->assertSame( $exp_str, links_add_target( $content, $target ) );
+               } else {
+                       $this->assertSame( $exp_str, links_add_target( $content, $target, $tags ) );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingmakeClickablephpfromrev51622trunktestsphpunittestsformattingMakeClickablephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/makeClickable.php (from rev 51622, trunk/tests/phpunit/tests/formatting/MakeClickable.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/makeClickable.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/makeClickable.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,451 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?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->assertSame( $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->assertSame( '<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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
+               }
+       }
+
+       /**
+        * @ticket 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->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
+               }
+       }
+
+       /**
+        * @ticket 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->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
+               }
+       }
+
+       /**
+        * Based on real comments which were incorrectly linked.
+        *
+        * @ticket 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->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
+               }
+       }
+
+       /**
+        * @ticket 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->assertSame( $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->assertSame( $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->assertSame( $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='https://www.youtube.com/watch?v=72xdCU__XCk&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' /> <param name='allowfullscreen' value='true' /> <param name='wmode' value='opaque' /> <embed src='https://www.youtube.com/watch?v=72xdCU__XCk&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='https://www.youtube.com/watch?v=72xdCU__XCk&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1' /> <param name='allowfullscreen' value='true' /> <param name='wmode' value='opaque' /> <embed src='https://www.youtube.com/watch?v=72xdCU__XCk&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->assertSame( $urls_expected[ $key ], make_clickable( $url ) );
+               }
+       }
+
+       /**
+        * @ticket 23756
+        */
+       function test_no_links_inside_pre_or_code() {
+               $before = array(
+                       '<pre>http://wordpress.org</pre>',
+                       '<code>http://wordpress.org</code>',
+                       '<pre class="foobar" id="foo">http://wordpress.org</pre>',
+                       '<code class="foobar" id="foo">http://wordpress.org</code>',
+                       '<precustomtag>http://wordpress.org</precustomtag>',
+                       '<codecustomtag>http://wordpress.org</codecustomtag>',
+                       'URL before pre http://wordpress.org<pre>http://wordpress.org</pre>',
+                       'URL before code http://wordpress.org<code>http://wordpress.org</code>',
+                       'URL after pre <PRE>http://wordpress.org</PRE>http://wordpress.org',
+                       'URL after code <code>http://wordpress.org</code>http://wordpress.org',
+                       'URL before and after pre http://wordpress.org<pre>http://wordpress.org</pre>http://wordpress.org',
+                       'URL before and after code http://wordpress.org<code>http://wordpress.org</code>http://wordpress.org',
+                       'code inside pre <pre>http://wordpress.org <code>http://wordpress.org</code> http://wordpress.org</pre>',
+               );
+
+               $expected = array(
+                       '<pre>http://wordpress.org</pre>',
+                       '<code>http://wordpress.org</code>',
+                       '<pre class="foobar" id="foo">http://wordpress.org</pre>',
+                       '<code class="foobar" id="foo">http://wordpress.org</code>',
+                       '<precustomtag><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a></precustomtag>',
+                       '<codecustomtag><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a></codecustomtag>',
+                       'URL before pre <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><pre>http://wordpress.org</pre>',
+                       'URL before code <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><code>http://wordpress.org</code>',
+                       'URL after pre <PRE>http://wordpress.org</PRE><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>',
+                       'URL after code <code>http://wordpress.org</code><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>',
+                       'URL before and after pre <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><pre>http://wordpress.org</pre><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>',
+                       'URL before and after code <a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a><code>http://wordpress.org</code><a href="http://wordpress.org" rel="nofollow">http://wordpress.org</a>',
+                       'code inside pre <pre>http://wordpress.org <code>http://wordpress.org</code> http://wordpress.org</pre>',
+               );
+
+               foreach ( $before as $key => $url ) {
+                       $this->assertSame( $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->assertSame( $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->assertSame( $text, make_clickable( $text ) );
+               }
+       }
+
+       /**
+        * @ticket 16892
+        */
+       function test_no_segfault() {
+               $in  = str_repeat( 'http://example.com/2011/03/18/post-title/', 256 );
+               $out = make_clickable( $in );
+               $this->assertSame( $in, $out );
+       }
+
+       /**
+        * @ticket 19028
+        */
+       function test_line_break_in_existing_clickable_link() {
+               $html = "<a
+                                 href='mailto:someone@example.com'>someone@example.com</a>";
+               $this->assertSame( $html, make_clickable( $html ) );
+       }
+
+       /**
+        * @ticket 30162
+        * @dataProvider data_script_and_style_tags
+        */
+       public function test_dont_link_script_and_style_tags( $tag ) {
+               $this->assertSame( $tag, make_clickable( $tag ) );
+       }
+
+       public function data_script_and_style_tags() {
+               return array(
+                       array(
+                               '<script>http://wordpress.org</script>',
+                       ),
+                       array(
+                               '<style>http://wordpress.org</style>',
+                       ),
+                       array(
+                               '<script type="text/javascript">http://wordpress.org</script>',
+                       ),
+                       array(
+                               '<style type="text/css">http://wordpress.org</style>',
+                       ),
+               );
+       }
+
+       /**
+        * @ticket 48022
+        * @dataProvider data_add_rel_ugc_in_comments
+        */
+       public function test_add_rel_ugc_in_comments( $content, $expected ) {
+               $comment_id = self::factory()->comment->create(
+                       array(
+                               'comment_content' => $content,
+                       )
+               );
+
+               ob_start();
+               comment_text( $comment_id );
+               $comment_text = ob_get_clean();
+
+               $this->assertStringContainsString( $expected, make_clickable( $comment_text ) );
+       }
+
+       public function data_add_rel_ugc_in_comments() {
+               return array(
+                       array(
+                               'http://wordpress.org',
+                               '<a href="http://wordpress.org" rel="nofollow ugc">http://wordpress.org</a>',
+                       ),
+                       array(
+                               'www.wordpress.org',
+                               '<p><a href="http://www.wordpress.org" rel="nofollow ugc">http://www.wordpress.org</a>',
+                       ),
+               );
+       }
+
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingmapDeepphpfromrev51622trunktestsphpunittestsformattingMapDeepphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/mapDeep.php (from rev 51622, trunk/tests/phpunit/tests/formatting/MapDeep.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/mapDeep.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/mapDeep.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,173 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @ticket 22300
+ */
+class Tests_Formatting_MapDeep extends WP_UnitTestCase {
+
+       public function test_map_deep_with_any_function_over_empty_array_should_return_empty_array() {
+               $this->assertSame( array(), map_deep( array(), array( $this, 'append_baba' ) ) );
+       }
+
+       public function test_map_deep_should_map_each_element_of_array_one_level_deep() {
+               $this->assertSame(
+                       array(
+                               'ababa',
+                               'xbaba',
+                       ),
+                       map_deep(
+                               array(
+                                       'a',
+                                       'x',
+                               ),
+                               array( $this, 'append_baba' )
+                       )
+               );
+       }
+
+       public function test_map_deep_should_map_each_element_of_array_two_levels_deep() {
+               $this->assertSame(
+                       array(
+                               'ababa',
+                               array(
+                                       'xbaba',
+                               ),
+                       ),
+                       map_deep(
+                               array(
+                                       'a',
+                                       array(
+                                               'x',
+                                       ),
+                               ),
+                               array( $this, 'append_baba' )
+                       )
+               );
+       }
+
+       public function test_map_deep_should_map_each_object_element_of_an_array() {
+               $this->assertEquals(
+                       array(
+                               'var0' => 'ababa',
+                               'var1' => (object) array(
+                                       'var0' => 'xbaba',
+                               ),
+                       ),
+                       map_deep(
+                               array(
+                                       'var0' => 'a',
+                                       'var1' => (object) array(
+                                               'var0' => 'x',
+                                       ),
+                               ),
+                               array( $this, 'append_baba' )
+                       )
+               );
+       }
+
+       public function test_map_deep_should_apply_the_function_to_a_string() {
+               $this->assertSame( 'xbaba', map_deep( 'x', array( $this, 'append_baba' ) ) );
+       }
+
+       public function test_map_deep_should_apply_the_function_to_an_integer() {
+               $this->assertSame( '5baba', map_deep( 5, array( $this, 'append_baba' ) ) );
+       }
+
+       public function test_map_deep_should_map_each_property_of_an_object() {
+               $this->assertEquals(
+                       (object) array(
+                               'var0' => 'ababa',
+                               'var1' => 'xbaba',
+                       ),
+                       map_deep(
+                               (object) array(
+                                       'var0' => 'a',
+                                       'var1' => 'x',
+                               ),
+                               array( $this, 'append_baba' )
+                       )
+               );
+       }
+
+       public function test_map_deep_should_map_each_array_property_of_an_object() {
+               $this->assertEquals(
+                       (object) array(
+                               'var0' => 'ababa',
+                               'var1' => array(
+                                       'xbaba',
+                               ),
+                       ),
+                       map_deep(
+                               (object) array(
+                                       'var0' => 'a',
+                                       'var1' => array(
+                                               'x',
+                                       ),
+                               ),
+                               array( $this, 'append_baba' )
+                       )
+               );
+       }
+
+       public function test_map_deep_should_map_each_object_property_of_an_object() {
+               $this->assertEquals(
+                       (object) array(
+                               'var0' => 'ababa',
+                               'var1' => (object) array(
+                                       'var0' => 'xbaba',
+                               ),
+                       ),
+                       map_deep(
+                               (object) array(
+                                       'var0' => 'a',
+                                       'var1' => (object) array(
+                                               'var0' => 'x',
+                                       ),
+                               ),
+                               array( $this, 'append_baba' )
+                       )
+               );
+       }
+
+       /**
+        * @ticket 35058
+        */
+       public function test_map_deep_should_map_object_properties_passed_by_reference() {
+               $object_a = (object) array( 'var0' => 'a' );
+               $object_b = (object) array(
+                       'var0' => &$object_a->var0,
+                       'var1' => 'x',
+               );
+               $this->assertEquals(
+                       (object) array(
+                               'var0' => 'ababa',
+                               'var1' => 'xbaba',
+                       ),
+                       map_deep( $object_b, array( $this, 'append_baba' ) )
+               );
+       }
+
+       /**
+        * @ticket 35058
+        */
+       public function test_map_deep_should_map_array_elements_passed_by_reference() {
+               $array_a = array( 'var0' => 'a' );
+               $array_b = array(
+                       'var0' => &$array_a['var0'],
+                       'var1' => 'x',
+               );
+               $this->assertSame(
+                       array(
+                               'var0' => 'ababa',
+                               'var1' => 'xbaba',
+                       ),
+                       map_deep( $array_b, array( $this, 'append_baba' ) )
+               );
+       }
+
+       public function append_baba( $value ) {
+               return $value . 'baba';
+       }
+
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingnormalizeWhitespacephpfromrev51622trunktestsphpunittestsformattingNormalizeWhitespacephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/normalizeWhitespace.php (from rev 51622, trunk/tests/phpunit/tests/formatting/NormalizeWhitespace.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/normalizeWhitespace.php                              (rev 0)
+++ trunk/tests/phpunit/tests/formatting/normalizeWhitespace.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,52 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * @group formatting
+ */
+class Tests_Formatting_NormalizeWhitespace extends WP_UnitTestCase {
+       /**
+        * WhitespaceTest Content DataProvider
+        *
+        * array( input_txt, converted_output_txt)
+        */
+       public function get_input_output() {
+               return array(
+                       array(
+                               '               ',
+                               '',
+                       ),
+                       array(
+                               "\rTEST\r",
+                               'TEST',
+                       ),
+                       array(
+                               "\r\nMY TEST CONTENT\r\n",
+                               'MY TEST CONTENT',
+                       ),
+                       array(
+                               "MY\r\nTEST\r\nCONTENT ",
+                               "MY\nTEST\nCONTENT",
+                       ),
+                       array(
+                               "\tMY\rTEST\rCONTENT ",
+                               "MY\nTEST\nCONTENT",
+                       ),
+                       array(
+                               "\tMY\t\t\tTEST\r\t\t\rCONTENT ",
+                               "MY TEST\n \nCONTENT",
+                       ),
+                       array(
+                               "\tMY TEST \t\t\t CONTENT ",
+                               'MY TEST CONTENT',
+                       ),
+               );
+       }
+
+       /**
+        * Validate the normalize_whitespace function
+        *
+        * @dataProvider get_input_output
+        */
+       function test_normalize_whitespace( $in_str, $exp_str ) {
+               $this->assertSame( $exp_str, normalize_whitespace( $in_str ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingremoveAccentsphpfromrev51622trunktestsphpunittestsformattingRemoveAccentsphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/removeAccents.php (from rev 51622, trunk/tests/phpunit/tests/formatting/RemoveAccents.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/removeAccents.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/removeAccents.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,146 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_RemoveAccents extends WP_UnitTestCase {
+       public function test_remove_accents_simple() {
+               $this->assertSame( 'abcdefghijkl', remove_accents( 'abcdefghijkl' ) );
+       }
+
+       /**
+        * @ticket 9591
+        */
+       public function test_remove_accents_latin1_supplement() {
+               $input  = 'ªºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ';
+               $output = 'aoAAAAAAAECEEEEIIIIDNOOOOOOUUUUYTHsaaaaaaaeceeeeiiiidnoooooouuuuythy';
+
+               $this->assertSame( $output, remove_accents( $input ), 'remove_accents replaces Latin-1 Supplement' );
+       }
+
+       public function test_remove_accents_latin_extended_a() {
+               $input  = 'ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſ';
+               $output = 'AaAaAaCcCcCcCcDdDdEeEeEeEeEeGgGgGgGgHhHhIiIiIiIiIiIJijJjKkkLlLlLlLlLlNnNnNnnNnOoOoOoOEoeRrRrRrSsSsSsSsTtTtTtUuUuUuUuUuUuWwYyYZzZzZzs';
+
+               $this->assertSame( $output, remove_accents( $input ), 'remove_accents replaces Latin Extended A' );
+       }
+
+       public function test_remove_accents_latin_extended_b() {
+               $this->assertSame( 'SsTt', remove_accents( 'ȘșȚț' ), 'remove_accents replaces Latin Extended B' );
+       }
+
+       public function test_remove_accents_euro_pound_signs() {
+               $this->assertSame( 'E', remove_accents( '€' ), 'remove_accents replaces euro sign' );
+               $this->assertSame( '', 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->assertSame( $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->assertSame( 'OoUu', remove_accents( 'ƠơƯư' ) );
+               // Grave accent.
+               $this->assertSame( 'AaAaEeOoOoUuYy', remove_accents( 'ẦầẰằỀềỒồỜờỪừỲỳ' ) );
+               // Hook.
+               $this->assertSame( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẢảẨẩẲẳẺẻỂểỈỉỎỏỔổỞởỦủỬửỶỷ' ) );
+               // Tilde.
+               $this->assertSame( 'AaAaEeEeOoOoUuYy', remove_accents( 'ẪẫẴẵẼẽỄễỖỗỠỡỮữỸỹ' ) );
+               // Acute accent.
+               $this->assertSame( 'AaAaEeOoOoUu', remove_accents( 'ẤấẮắẾếỐốỚớỨứ' ) );
+               // Dot below.
+               $this->assertSame( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẠạẬậẶặẸẹỆệỊịỌọỘộỢợỤụỰựỴỵ' ) );
+       }
+
+       /**
+        * @ticket 20772
+        */
+       public function test_remove_accents_hanyu_pinyin() {
+               // Vowels with diacritic (Chinese, Hanyu Pinyin).
+               // Macron.
+               $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'āēīōūǖĀĒĪŌŪǕ' ) );
+               // Acute accent.
+               $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'áéíóúǘÁÉÍÓÚǗ' ) );
+               // Caron.
+               $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'ǎěǐǒǔǚǍĚǏǑǓǙ' ) );
+               // Grave accent.
+               $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'àèìòùǜÀÈÌÒÙǛ' ) );
+               // Unmarked.
+               $this->assertSame( '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->assertSame( 'AeOeUeaeoeuess', remove_accents( 'ÄÖÜäöüß' ) );
+
+               remove_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) );
+       }
+
+       public function _set_locale_to_danish() {
+               return 'da_DK';
+       }
+
+       /**
+        * @ticket 23907
+        */
+       public function test_remove_danish_accents() {
+               add_filter( 'locale', array( $this, '_set_locale_to_danish' ) );
+
+               $this->assertSame( 'AeOeAaaeoeaa', remove_accents( 'ÆØÅæøå' ) );
+
+               remove_filter( 'locale', array( $this, '_set_locale_to_danish' ) );
+       }
+
+       public function _set_locale_to_catalan() {
+               return 'ca';
+       }
+
+       /**
+        * @ticket 37086
+        */
+       public function test_remove_catalan_middot() {
+               add_filter( 'locale', array( $this, '_set_locale_to_catalan' ) );
+
+               $this->assertSame( 'allallalla', remove_accents( 'al·lallaŀla' ) );
+
+               remove_filter( 'locale', array( $this, '_set_locale_to_catalan' ) );
+
+               $this->assertSame( 'al·lallalla', remove_accents( 'al·lallaŀla' ) );
+       }
+
+       public function _set_locale_to_serbian() {
+               return 'sr_RS';
+       }
+
+       /**
+        * @ticket 38078
+        */
+       public function test_transcribe_serbian_crossed_d() {
+               add_filter( 'locale', array( $this, '_set_locale_to_serbian' ) );
+
+               $this->assertSame( 'DJdj', remove_accents( 'Đđ' ) );
+
+               remove_filter( 'locale', array( $this, '_set_locale_to_serbian' ) );
+
+               $this->assertSame( 'Dd', remove_accents( 'Đđ' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingsanitizeFileNamephpfromrev51622trunktestsphpunittestsformattingSanitizeFileNamephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/sanitizeFileName.php (from rev 51622, trunk/tests/phpunit/tests/formatting/SanitizeFileName.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/sanitizeFileName.php                         (rev 0)
+++ trunk/tests/phpunit/tests/formatting/sanitizeFileName.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,96 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeFileName extends WP_UnitTestCase {
+       function test_munges_extensions() {
+               // r17990
+               $file_name = sanitize_file_name( 'test.phtml.txt' );
+               $this->assertSame( '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->assertSame( 'testtest', sanitize_file_name( $string ) );
+       }
+
+       /**
+        * @ticket 22363
+        */
+       function test_removes_accents() {
+               $in  = 'àáâãäåæçèéêëìíîïñòóôõöøùúûüýÿ';
+               $out = 'aaaaaaaeceeeeiiiinoooooouuuuyy';
+               $this->assertSame( $out, sanitize_file_name( $in ) );
+       }
+
+       /**
+        * Test that spaces are correctly replaced with dashes.
+        *
+        * @ticket 16330
+        */
+       function test_replaces_spaces() {
+               $urls = array(
+                       'unencoded space.png'  => 'unencoded-space.png',
+                       'encoded-space.jpg'    => 'encoded-space.jpg',
+                       'plus+space.jpg'       => 'plusspace.jpg',
+                       'multi %20 +space.png' => 'multi-20-space.png',
+               );
+
+               foreach ( $urls as $test => $expected ) {
+                       $this->assertSame( $expected, sanitize_file_name( $test ) );
+               }
+       }
+
+       function test_replaces_any_number_of_hyphens_with_one_hyphen() {
+               $this->assertSame( 'a-t-t', sanitize_file_name( 'a----t----t' ) );
+       }
+
+       function test_trims_trailing_hyphens() {
+               $this->assertSame( 'a-t-t', sanitize_file_name( 'a----t----t----' ) );
+       }
+
+       function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
+               $this->assertSame( 'a-t', sanitize_file_name( 'a          t' ) );
+               $this->assertSame( 'a-t', sanitize_file_name( "a    \n\n\nt" ) );
+       }
+
+       /**
+        * @ticket 16226
+        */
+       function test_replaces_percent_sign() {
+               $this->assertSame( 'a22b.jpg', sanitize_file_name( 'a%22b.jpg' ) );
+       }
+
+       function test_replaces_unnamed_file_extensions() {
+               // Test filenames with both supported and unsupported extensions.
+               $this->assertSame( 'unnamed-file.exe', sanitize_file_name( '_.exe' ) );
+               $this->assertSame( 'unnamed-file.jpg', sanitize_file_name( '_.jpg' ) );
+       }
+
+       function test_replaces_unnamed_file_extensionless() {
+               // Test a filenames that becomes extensionless.
+               $this->assertSame( 'no-extension', sanitize_file_name( '_.no-extension' ) );
+       }
+
+       /**
+        * @dataProvider data_wp_filenames
+        */
+       function test_replaces_invalid_utf8_characters( $input, $expected ) {
+               $this->assertSame( $expected, sanitize_file_name( $input ) );
+       }
+
+       function data_wp_filenames() {
+               return array(
+                       array( urldecode( '%B1myfile.png' ), 'myfile.png' ),
+                       array( urldecode( '%B1myfile' ), 'myfile' ),
+                       array( 'demo bar.png', 'demo-bar.png' ),
+                       array( 'demo' . json_decode( '"\u00a0"' ) . 'bar.png', 'demo-bar.png' ),
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingsanitizeMimeTypephpfromrev51622trunktestsphpunittestsformattingSanitizeMimeTypephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/sanitizeMimeType.php (from rev 51622, trunk/tests/phpunit/tests/formatting/SanitizeMimeType.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/sanitizeMimeType.php                         (rev 0)
+++ trunk/tests/phpunit/tests/formatting/sanitizeMimeType.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,41 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeMimeType extends WP_UnitTestCase {
+
+       /**
+        * @ticket 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->assertSame( $input, sanitize_mime_type( $input ) );
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingsanitizeOrderbyphpfromrev51622trunktestsphpunittestsformattingSanitizeOrderbyphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/sanitizeOrderby.php (from rev 51622, trunk/tests/phpunit/tests/formatting/SanitizeOrderby.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/sanitizeOrderby.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/sanitizeOrderby.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,57 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group sanitize_sql_orderby
+ */
+class Tests_Formatting_SanitizeOrderby extends WP_UnitTestCase {
+
+       /**
+        * @covers ::sanitize_sql_orderby
+        * @dataProvider valid_orderbys
+        */
+       function test_valid( $orderby ) {
+               $this->assertSame( $orderby, sanitize_sql_orderby( $orderby ) );
+       }
+       function valid_orderbys() {
+               return array(
+                       array( '1' ),
+                       array( '1 ASC' ),
+                       array( '1 ASC, 2' ),
+                       array( '1 ASC, 2 DESC' ),
+                       array( '1 ASC, 2 DESC, 3' ),
+                       array( '       1      DESC' ),
+                       array( 'field ASC' ),
+                       array( 'field1 ASC, field2' ),
+                       array( 'field_1 ASC, field_2 DESC' ),
+                       array( 'field1, field2 ASC' ),
+                       array( '`field1`' ),
+                       array( '`field1` ASC' ),
+                       array( '`field` ASC, `field2`' ),
+                       array( 'RAND()' ),
+                       array( '   RAND(  )   ' ),
+               );
+       }
+
+       /**
+        * @covers ::sanitize_sql_orderby
+        * @dataProvider invalid_orderbys
+        */
+       function test_invalid( $orderby ) {
+               $this->assertFalse( sanitize_sql_orderby( $orderby ) );
+       }
+       function invalid_orderbys() {
+               return array(
+                       array( '' ),
+                       array( '1 2' ),
+                       array( '1, 2 3' ),
+                       array( '1 DESC, ' ),
+                       array( 'field-1' ),
+                       array( 'field DESC,' ),
+                       array( 'field1 field2' ),
+                       array( 'field RAND()' ),
+                       array( 'RAND() ASC' ),
+                       array( '`field1` ASC, `field2' ),
+                       array( 'field, !@#$%^' ),
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingsanitizePostphpfromrev51622trunktestsphpunittestsformattingSanitizePostphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/sanitizePost.php (from rev 51622, trunk/tests/phpunit/tests/formatting/SanitizePost.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/sanitizePost.php                             (rev 0)
+++ trunk/tests/phpunit/tests/formatting/sanitizePost.php       2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,32 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * @group formatting
+ * @group post
+ */
+class Tests_Formatting_SanitizePost extends WP_UnitTestCase {
+
+       /**
+        * @ticket 22324
+        */
+       function test_int_fields() {
+               $post       = self::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 ) {
+                       switch ( $type ) {
+                               case 'integer':
+                                       $this->assertIsInt( $post->$field, "field $field" );
+                                       break;
+                               case 'string':
+                                       $this->assertIsString( $post->$field, "field $field" );
+                                       break;
+                       }
+               }
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingsanitizeTextFieldphpfromrev51622trunktestsphpunittestsformattingSanitizeTextFieldphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/sanitizeTextField.php (from rev 51622, trunk/tests/phpunit/tests/formatting/SanitizeTextField.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/sanitizeTextField.php                                (rev 0)
+++ trunk/tests/phpunit/tests/formatting/sanitizeTextField.php  2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,143 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeTextField extends WP_UnitTestCase {
+       function data_sanitize_text_field() {
+               return array(
+                       array(
+                               'оРангутанг', // Ensure UTF-8 text is safe. The Р is D0 A0 and A0 is the non-breaking space.
+                               'оРангутанг',
+                       ),
+                       array(
+                               'САПР',       // Ensure UTF-8 text is safe. the Р is D0 A0 and A0 is the non-breaking space.
+                               'САПР',
+                       ),
+                       array(
+                               'one is < two',
+                               'one is &lt; two',
+                       ),
+                       array(
+                               "one is <\n two",
+                               array(
+                                       'oneline'   => 'one is &lt; two',
+                                       'multiline' => "one is &lt;\n two",
+                               ),
+                       ),
+                       array(
+                               "foo <div\n> bar",
+                               array(
+                                       'oneline'   => 'foo bar',
+                                       'multiline' => 'foo  bar',
+                               ),
+                       ),
+                       array(
+                               "foo <\ndiv\n> bar",
+                               array(
+                                       'oneline'   => 'foo &lt; div > bar',
+                                       'multiline' => "foo &lt;\ndiv\n> bar",
+                               ),
+                       ),
+                       array(
+                               'tags <span>are</span> <em>not allowed</em> here',
+                               'tags are not allowed here',
+                       ),
+                       array(
+                               ' we should trim leading and trailing whitespace ',
+                               'we should trim leading and trailing whitespace',
+                       ),
+                       array(
+                               'we  trim  extra  internal  whitespace  only  in  single  line  texts',
+                               array(
+                                       'oneline'   => 'we trim extra internal whitespace only in single line texts',
+                                       'multiline' => 'we  trim  extra  internal  whitespace  only  in  single  line  texts',
+                               ),
+                       ),
+                       array(
+                               "tabs \tget removed in single line texts",
+                               array(
+                                       'oneline'   => 'tabs get removed in single line texts',
+                                       'multiline' => "tabs \tget removed in single line texts",
+                               ),
+                       ),
+                       array(
+                               "newlines are allowed only\n in multiline texts",
+                               array(
+                                       'oneline'   => 'newlines are allowed only in multiline texts',
+                                       'multiline' => "newlines are allowed only\n in multiline texts",
+                               ),
+                       ),
+                       array(
+                               'We also %AB remove %ab octets',
+                               'We also remove octets',
+                       ),
+                       array(
+                               'We don\'t need to wory about %A
+                               B removing %a
+                               b octets even when %a   B they are obscured by whitespace',
+                               array(
+                                       'oneline'   => 'We don\'t need to wory about %A B removing %a b octets even when %a B they are obscured by whitespace',
+                                       'multiline' => "We don't need to wory about %A\n                                B removing %a\n                         b octets even when %a   B they are obscured by whitespace",
+                               ),
+                       ),
+                       array(
+                               '%AB%BC%DE', // Just octets.
+                               '',          // Emtpy as we strip all the octets out.
+                       ),
+                       array(
+                               'Invalid octects remain %II',
+                               'Invalid octects remain %II',
+                       ),
+                       array(
+                               'Nested octects %%%ABABAB %A%A%ABBB',
+                               'Nested octects',
+                       ),
+                       array(
+                               array(),
+                               '',
+                       ),
+                       array(
+                               array( 1, 2, 'foo' ),
+                               '',
+                       ),
+                       array(
+                               new WP_Query,
+                               '',
+                       ),
+                       array(
+                               2,
+                               '2',
+                       ),
+                       array(
+                               false,
+                               '',
+                       ),
+                       array(
+                               true,
+                               '1',
+                       ),
+                       array(
+                               10.1,
+                               '10.1',
+                       ),
+               );
+       }
+
+       /**
+        * @ticket 32257
+        * @dataProvider data_sanitize_text_field
+        */
+       function test_sanitize_text_field( $string, $expected ) {
+               if ( is_array( $expected ) ) {
+                       $expected_oneline   = $expected['oneline'];
+                       $expected_multiline = $expected['multiline'];
+               } else {
+                       $expected_oneline   = $expected;
+                       $expected_multiline = $expected;
+               }
+               $this->assertSame( $expected_oneline, sanitize_text_field( $string ) );
+               $this->assertSameIgnoreEOL( $expected_multiline, sanitize_textarea_field( $string ) );
+
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingsanitizeTitlephpfromrev51622trunktestsphpunittestsformattingSanitizeTitlephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/sanitizeTitle.php (from rev 51622, trunk/tests/phpunit/tests/formatting/SanitizeTitle.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/sanitizeTitle.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/sanitizeTitle.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,18 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeTitle extends WP_UnitTestCase {
+       function test_strips_html() {
+               $input    = 'Captain <strong>Awesome</strong>';
+               $expected = 'captain-awesome';
+               $this->assertSame( $expected, sanitize_title( $input ) );
+       }
+
+       function test_titles_sanitized_to_nothing_are_replaced_with_optional_fallback() {
+               $input    = '<strong></strong>';
+               $fallback = 'Captain Awesome';
+               $this->assertSame( $fallback, sanitize_title( $input, $fallback ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingsanitizeTitleWithDashesphpfromrev51622trunktestsphpunittestsformattingSanitizeTitleWithDashesphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php (from rev 51622, trunk/tests/phpunit/tests/formatting/SanitizeTitleWithDashes.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,150 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeTitleWithDashes extends WP_UnitTestCase {
+       function test_strips_html() {
+               $input    = 'Captain <strong>Awesome</strong>';
+               $expected = 'captain-awesome';
+               $this->assertSame( $expected, sanitize_title_with_dashes( $input ) );
+       }
+
+       function test_strips_unencoded_percent_signs() {
+               $this->assertSame( 'fran%c3%a7ois', sanitize_title_with_dashes( 'fran%c3%a7%ois' ) );
+       }
+
+       function test_makes_title_lowercase() {
+               $this->assertSame( 'abc', sanitize_title_with_dashes( 'ABC' ) );
+       }
+
+       function test_replaces_any_amount_of_whitespace_with_one_hyphen() {
+               $this->assertSame( 'a-t', sanitize_title_with_dashes( 'a          t' ) );
+               $this->assertSame( 'a-t', sanitize_title_with_dashes( "a    \n\n\nt" ) );
+       }
+
+       function test_replaces_any_number_of_hyphens_with_one_hyphen() {
+               $this->assertSame( 'a-t-t', sanitize_title_with_dashes( 'a----t----t' ) );
+       }
+
+       function test_trims_trailing_hyphens() {
+               $this->assertSame( 'a-t-t', sanitize_title_with_dashes( 'a----t----t----' ) );
+       }
+
+       function test_handles_non_entity_ampersands() {
+               $this->assertSame( 'penn-teller-bull', sanitize_title_with_dashes( 'penn & teller bull' ) );
+       }
+
+       public function test_strips_nbsp_ndash_and_amp() {
+               $this->assertSame( 'no-entities-here', sanitize_title_with_dashes( 'No &nbsp; Entities &ndash; Here &amp;' ) );
+       }
+
+       public function test_strips_encoded_ampersand() {
+               $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One &amp; Two', '', 'save' ) );
+       }
+
+       public function test_strips_url_encoded_ampersand() {
+               $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One &#123; Two;', '', 'save' ) );
+       }
+
+       public function test_strips_trademark_symbol() {
+               $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One Two™;', '', 'save' ) );
+       }
+
+       public function test_strips_unencoded_ampersand_followed_by_encoded_ampersand() {
+               $this->assertSame( 'one-two', sanitize_title_with_dashes( 'One &&amp; Two;', '', 'save' ) );
+       }
+
+       public function test_strips_unencoded_ampersand_when_not_surrounded_by_spaces() {
+               $this->assertSame( 'onetwo', sanitize_title_with_dashes( 'One&Two', '', 'save' ) );
+       }
+
+       function test_replaces_nbsp() {
+               $this->assertSame( 'dont-break-the-space', sanitize_title_with_dashes( "don't break the space", '', 'save' ) );
+       }
+
+       /**
+        * @ticket 31790
+        */
+       function test_replaces_nbsp_entities() {
+               $this->assertSame( 'dont-break-the-space', sanitize_title_with_dashes( "don't&nbsp;break&#160;the&nbsp;space", '', 'save' ) );
+       }
+
+       function test_replaces_ndash_mdash() {
+               $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do – the Dash', '', 'save' ) );
+               $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do the — Dash', '', 'save' ) );
+       }
+
+       /**
+        * @ticket 31790
+        */
+       function test_replaces_ndash_mdash_entities() {
+               $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do &ndash; the &#8211; Dash', '', 'save' ) );
+               $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do &mdash; the &#8212; Dash', '', 'save' ) );
+       }
+
+       function test_replaces_iexcel_iquest() {
+               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just ¡a Slug', '', 'save' ) );
+               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just a Slug¿', '', 'save' ) );
+       }
+
+       function test_replaces_angle_quotes() {
+               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( '‹Just a Slug›', '', 'save' ) );
+               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( '«Just a Slug»', '', 'save' ) );
+       }
+
+       function test_replaces_curly_quotes() {
+               $this->assertSame( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its “Curly Joe”', '', 'save' ) );
+               $this->assertSame( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its ‘Curly Joe’', '', 'save' ) );
+               $this->assertSame( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its „Curly Joe“', '', 'save' ) );
+               $this->assertSame( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its ‚Curly Joe‛', '', 'save' ) );
+               $this->assertSame( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its „Curly Joe‟', '', 'save' ) );
+       }
+
+       /**
+        * @ticket 49791
+        */
+       function test_replaces_bullet() {
+               $this->assertSame( 'fancy-title-amazing', sanitize_title_with_dashes( 'Fancy Title • Amazing', '', 'save' ) );
+       }
+
+       function test_replaces_copy_reg_deg_trade() {
+               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just © a Slug', '', 'save' ) );
+               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( '® Just a Slug', '', 'save' ) );
+               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just a ° Slug', '', 'save' ) );
+               $this->assertSame( 'just-a-slug', sanitize_title_with_dashes( 'Just ™ a Slug', '', 'save' ) );
+       }
+
+       /**
+        * @ticket 10792
+        */
+       function test_replaces_forward_slash() {
+               $this->assertSame( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon/McCartney', '', 'save' ) );
+               $this->assertSame( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon//McCartney', '', 'save' ) );
+               $this->assertSame( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon///McCartney', '', 'save' ) );
+               $this->assertSame( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( 'songs by Lennon/-McCartney', '', 'save' ) );
+               $this->assertSame( 'songs-by-lennon-mccartney', sanitize_title_with_dashes( '//songs by Lennon/McCartney', '', 'save' ) );
+       }
+
+       /**
+        * @ticket 19820
+        */
+       function test_replaces_multiply_sign() {
+               $this->assertSame( '6x7-is-42', sanitize_title_with_dashes( '6×7 is 42', '', 'save' ) );
+       }
+
+       /**
+        * @ticket 20772
+        */
+       function test_replaces_standalone_diacritic() {
+               $this->assertSame( 'aaaa', sanitize_title_with_dashes( 'āáǎà', '', 'save' ) );
+       }
+
+       /**
+        * @ticket 22395
+        */
+       function test_replaces_acute_accents() {
+               $this->assertSame( 'aaaa', sanitize_title_with_dashes( 'ááa´aˊ', '', 'save' ) );
+       }
+
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingsanitizeTrackbackUrlsphpfromrev51622trunktestsphpunittestsformattingSanitizeTrackbackUrlsphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php (from rev 51622, trunk/tests/phpunit/tests/formatting/SanitizeTrackbackUrls.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,27 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_SanitizeTrackbackUrls extends WP_UnitTestCase {
+       /**
+        * @ticket 21624
+        * @dataProvider breaks
+        */
+       function test_sanitize_trackback_urls_with_multiple_urls( $break ) {
+               $this->assertSame( "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="trunktestsphpunittestsformattingsanitizeUserphpfromrev51622trunktestsphpunittestsformattingSanitizeUserphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/sanitizeUser.php (from rev 51622, trunk/tests/phpunit/tests/formatting/SanitizeUser.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/sanitizeUser.php                             (rev 0)
+++ trunk/tests/phpunit/tests/formatting/sanitizeUser.php       2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,42 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?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->assertSame( $expected, sanitize_user( $input ) );
+       }
+
+       public function test_strips_encoded_ampersand() {
+               $expected = 'ATT';
+
+               // Multisite forces user logins to lowercase.
+               if ( is_multisite() ) {
+                       $expected = strtolower( $expected );
+               }
+
+               $this->assertSame( $expected, sanitize_user( 'AT&amp;T' ) );
+       }
+
+       public function test_strips_encoded_ampersand_when_followed_by_semicolon() {
+               $expected = 'ATT Test;';
+
+               // Multisite forces user logins to lowercase.
+               if ( is_multisite() ) {
+                       $expected = strtolower( $expected );
+               }
+
+               $this->assertSame( $expected, sanitize_user( 'AT&amp;T Test;' ) );
+       }
+
+       function test_strips_percent_encoded_octets() {
+               $expected = is_multisite() ? 'franois' : 'Franois';
+               $this->assertSame( $expected, sanitize_user( 'Fran%c3%a7ois' ) );
+       }
+       function test_optional_strict_mode_reduces_to_safe_ascii_subset() {
+               $this->assertSame( 'abc', sanitize_user( '()~ab~ˆcˆ!', true ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingseemsUtf8phpfromrev51622trunktestsphpunittestsformattingSeemsUtf8php"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/seemsUtf8.php (from rev 51622, trunk/tests/phpunit/tests/formatting/SeemsUtf8.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/seemsUtf8.php                                (rev 0)
+++ trunk/tests/phpunit/tests/formatting/seemsUtf8.php  2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,44 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?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( $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->assertFalse( seems_utf8( $big5_string ) );
+       }
+
+       function big5_strings() {
+               // Get data from formatting/big5.txt.
+               $big5_strings = file( DIR_TESTDATA . '/formatting/big5.txt' );
+               foreach ( $big5_strings as &$string ) {
+                       $string = (array) trim( $string );
+               }
+               unset( $string );
+               return $big5_strings;
+       }
+}
+
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingslashitphpfromrev51622trunktestsphpunittestsformattingSlashitphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/slashit.php (from rev 51622, trunk/tests/phpunit/tests/formatting/Slashit.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/slashit.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/slashit.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,54 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_Slashit extends WP_UnitTestCase {
+       function test_backslashes_middle_numbers() {
+               $this->assertSame( "\\a-!9\\a943\\b\\c", backslashit( 'a-!9a943bc' ) );
+       }
+
+       function test_backslashes_alphas() {
+               $this->assertSame( "\\a943\\b\\c", backslashit( 'a943bc' ) );
+       }
+
+       function test_double_backslashes_leading_numbers() {
+               $this->assertSame( '\\\\95', backslashit( '95' ) );
+       }
+
+       function test_removes_trailing_slashes() {
+               $this->assertSame( 'a', untrailingslashit( 'a/' ) );
+               $this->assertSame( 'a', untrailingslashit( 'a////' ) );
+       }
+
+       /**
+        * @ticket 22267
+        */
+       function test_removes_trailing_backslashes() {
+               $this->assertSame( 'a', untrailingslashit( 'a\\' ) );
+               $this->assertSame( 'a', untrailingslashit( 'a\\\\\\\\' ) );
+       }
+
+       /**
+        * @ticket 22267
+        */
+       function test_removes_trailing_mixed_slashes() {
+               $this->assertSame( 'a', untrailingslashit( 'a/\\' ) );
+               $this->assertSame( 'a', untrailingslashit( 'a\\/\\///\\\\//' ) );
+       }
+
+       function test_adds_trailing_slash() {
+               $this->assertSame( 'a/', trailingslashit( 'a' ) );
+       }
+
+       function test_does_not_add_trailing_slash_if_one_exists() {
+               $this->assertSame( 'a/', trailingslashit( 'a/' ) );
+       }
+
+       /**
+        * @ticket 22267
+        */
+       function test_converts_trailing_backslash_to_slash_if_one_exists() {
+               $this->assertSame( 'a/', trailingslashit( 'a\\' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingstripslashesDeepphpfromrev51622trunktestsphpunittestsformattingStripSlashesDeepphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/stripslashesDeep.php (from rev 51622, trunk/tests/phpunit/tests/formatting/StripSlashesDeep.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/stripslashesDeep.php                         (rev 0)
+++ trunk/tests/phpunit/tests/formatting/stripslashesDeep.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,54 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @group slashes
+ */
+class Tests_Formatting_StripslashesDeep extends WP_UnitTestCase {
+       /**
+        * @ticket 18026
+        */
+       function test_preserves_original_datatype() {
+
+               $this->assertTrue( stripslashes_deep( true ) );
+               $this->assertFalse( stripslashes_deep( false ) );
+               $this->assertSame( 4, stripslashes_deep( 4 ) );
+               $this->assertSame( 'foo', stripslashes_deep( 'foo' ) );
+               $arr      = array(
+                       'a' => true,
+                       'b' => false,
+                       'c' => 4,
+                       'd' => 'foo',
+               );
+               $arr['e'] = $arr; // Add a sub-array.
+               $this->assertSame( $arr, stripslashes_deep( $arr ) ); // Keyed array.
+               $this->assertSame( array_values( $arr ), stripslashes_deep( array_values( $arr ) ) ); // Non-keyed.
+
+               $obj = new stdClass;
+               foreach ( $arr as $k => $v ) {
+                       $obj->$k = $v;
+               }
+               $this->assertSame( $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->assertSame( $new, stripslashes_deep( $old ) );
+               $this->assertSame( $new, stripslashes_deep( "I can\\'t see, isn\\'t that it?" ) );
+               $this->assertSame( array( 'a' => $new ), stripslashes_deep( array( 'a' => $old ) ) ); // Keyed array.
+               $this->assertSame( 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->assertSame( $txt, stripslashes_deep( "I can\'t see, isn\\\'t that it?" ) );
+               $this->assertSame( $txt, stripslashes_deep( "I can\'t see, isn\\\\\'t that it?" ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingurlShortenphpfromrev51622trunktestsphpunittestsformattingURLShortenphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/urlShorten.php (from rev 51622, trunk/tests/phpunit/tests/formatting/URLShorten.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/urlShorten.php                               (rev 0)
+++ trunk/tests/phpunit/tests/formatting/urlShorten.php 2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,23 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_UrlShorten extends WP_UnitTestCase {
+       function test_url_shorten() {
+               $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->assertSame( $v, url_shorten( $k ) );
+               }
+
+               // Shorten to 31 if > 34 after cleaning.
+               $this->assertSame( 'wordpress.org/about/philosophy/#&hellip;', url_shorten( 'http://wordpress.org/about/philosophy/#decisions' ), 31 );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingurlencodeDeepphpfromrev51622trunktestsphpunittestsformattingUrlencodeDeepphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/urlencodeDeep.php (from rev 51622, trunk/tests/phpunit/tests/formatting/UrlencodeDeep.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/urlencodeDeep.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/urlencodeDeep.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,46 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @ticket 22300
+ */
+class Tests_Formatting_UrlencodeDeep extends WP_UnitTestCase {
+
+       /**
+        * Data Provider
+        */
+       public function data_test_values() {
+               return array(
+                       array( 'qwerty123456', 'qwerty123456' ),
+                       array( '|!"£$%&/()=?', '%7C%21%22%C2%A3%24%25%26%2F%28%29%3D%3F' ),
+                       array( '^é*ç°§;:_-.,', '%5E%C3%A9%2A%C3%A7%C2%B0%C2%A7%3B%3A_-.%2C' ),
+                       array( 'abc123 @#[]€', 'abc123+%40%23%5B%5D%E2%82%AC' ),
+                       array( 'abc123 @#[]€', urlencode( 'abc123 @#[]€' ) ),
+               );
+       }
+
+       /**
+        * Validate the urlencode_deep function pair by pair
+        *
+        * @dataProvider data_test_values
+        *
+        * @param string $actual
+        * @param string $expected
+        */
+       public function test_urlencode_deep_should_encode_individual_value( $actual, $expected ) {
+               $this->assertSame( $expected, urlencode_deep( $actual ) );
+       }
+
+       /**
+        * Test the whole array as input
+        */
+       public function test_urlencode_deep_should_encode_all_values_in_array() {
+               $data = $this->data_test_values();
+
+               $actual   = wp_list_pluck( $data, 0 );
+               $expected = wp_list_pluck( $data, 1 );
+
+               $this->assertSame( $expected, urlencode_deep( $actual ) );
+       }
+
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingutf8UriEncodephpfromrev51622trunktestsphpunittestsformattingUtf8UriEncodephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/utf8UriEncode.php (from rev 51622, trunk/tests/phpunit/tests/formatting/Utf8UriEncode.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/utf8UriEncode.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/utf8UriEncode.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,36 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?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->assertSame( $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="trunktestsphpunittestsformattingwpAutopphpfromrev51622trunktestsphpunittestsformattingAutopphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpAutop.php (from rev 51622, trunk/tests/phpunit/tests/formatting/Autop.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpAutop.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpAutop.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,608 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpAutop extends WP_UnitTestCase {
+
+       /**
+        * @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; 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; 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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( "<p>$str</p>", trim( wpautop( $str ) ) );
+       }
+
+       /**
+        * wpautop() Should not add <p> and <br/> around <source> and <track>
+        *
+        * @ticket 26864
+        */
+       public function test_source_track_elements() {
+               $content = "Paragraph one.\n\n" .
+                       '<video class="wp-video-shortcode" id="video-0-1" width="640" height="360" preload="metadata" controls="controls">
+                               <source type="video/mp4" src="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4" />
+                               <!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
+                               <source type="video/webm" src="myvideo.webm" />
+                               <!-- Ogg/Vorbis for older Firefox and Opera versions -->
+                               <source type="video/ogg" src="myvideo.ogv" />
+                               <!-- Optional: Add subtitles for each language -->
+                               <track kind="subtitles" src="subtitles.srt" srclang="en" />
+                               <!-- Optional: Add chapters -->
+                               <track kind="chapters" src="chapters.srt" srclang="en" />
+                               <a href="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4">http://domain.tld/wp-content/uploads/2013/12/xyz.mp4</a>
+                       </video>' .
+                       "\n\nParagraph two.";
+
+               $content2 = "Paragraph one.\n\n" .
+                       '<video class="wp-video-shortcode" id="video-0-1" width="640" height="360" preload="metadata" controls="controls">
+
+                       <source type="video/mp4" src="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4" />
+
+                       <!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
+                       <source type="video/webm" src="myvideo.webm" />
+
+                       <!-- Ogg/Vorbis for older Firefox and Opera versions -->
+                       <source type="video/ogg" src="myvideo.ogv" />
+
+                       <!-- Optional: Add subtitles for each language -->
+                       <track kind="subtitles" src="subtitles.srt" srclang="en" />
+
+                       <!-- Optional: Add chapters -->
+                       <track kind="chapters" src="chapters.srt" srclang="en" />
+
+                       <a href="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4">http://domain.tld/wp-content/uploads/2013/12/xyz.mp4</a>
+
+                       </video>' .
+                       "\n\nParagraph two.";
+
+               $expected = "<p>Paragraph one.</p>\n" . // Line breaks only after <p>.
+                       '<p><video class="wp-video-shortcode" id="video-0-1" width="640" height="360" preload="metadata" controls="controls">' .
+                       '<source type="video/mp4" src="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4" />' .
+                       '<!-- WebM/VP8 for Firefox4, Opera, and Chrome -->' .
+                       '<source type="video/webm" src="myvideo.webm" />' .
+                       '<!-- Ogg/Vorbis for older Firefox and Opera versions -->' .
+                       '<source type="video/ogg" src="myvideo.ogv" />' .
+                       '<!-- Optional: Add subtitles for each language -->' .
+                       '<track kind="subtitles" src="subtitles.srt" srclang="en" />' .
+                       '<!-- Optional: Add chapters -->' .
+                       '<track kind="chapters" src="chapters.srt" srclang="en" />' .
+                       '<a href="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4">' .
+                       "http://domain.tld/wp-content/uploads/2013/12/xyz.mp4</a></video></p>\n" .
+                       '<p>Paragraph two.</p>';
+
+               // When running the content through wpautop() from wp_richedit_pre().
+               $shortcode_content = "Paragraph one.\n\n" .
+                       '[video width="720" height="480" mp4="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4"]
+                       <!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
+                       <source type="video/webm" src="myvideo.webm" />
+                       <!-- Ogg/Vorbis for older Firefox and Opera versions -->
+                       <source type="video/ogg" src="myvideo.ogv" />
+                       <!-- Optional: Add subtitles for each language -->
+                       <track kind="subtitles" src="subtitles.srt" srclang="en" />
+                       <!-- Optional: Add chapters -->
+                       <track kind="chapters" src="chapters.srt" srclang="en" />
+                       [/video]' .
+                       "\n\nParagraph two.";
+
+               $shortcode_expected = "<p>Paragraph one.</p>\n" . // Line breaks only after <p>.
+                       '<p>[video width="720" height="480" mp4="http://domain.tld/wp-content/uploads/2013/12/xyz.mp4"]' .
+                       '<!-- WebM/VP8 for Firefox4, Opera, and Chrome --><source type="video/webm" src="myvideo.webm" />' .
+                       '<!-- Ogg/Vorbis for older Firefox and Opera versions --><source type="video/ogg" src="myvideo.ogv" />' .
+                       '<!-- Optional: Add subtitles for each language --><track kind="subtitles" src="subtitles.srt" srclang="en" />' .
+                       '<!-- Optional: Add chapters --><track kind="chapters" src="chapters.srt" srclang="en" />' .
+                       "[/video]</p>\n" .
+                       '<p>Paragraph two.</p>';
+
+               $this->assertSame( $expected, trim( wpautop( $content ) ) );
+               $this->assertSame( $expected, trim( wpautop( $content2 ) ) );
+               $this->assertSame( $shortcode_expected, trim( wpautop( $shortcode_content ) ) );
+       }
+
+       /**
+        * wpautop() Should not add <p> and <br/> around <param> and <embed>
+        *
+        * @ticket 26864
+        */
+       public function test_param_embed_elements() {
+               $content1 = '
+Paragraph one.
+
+<object width="400" height="224" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
+       <param name="src" value="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" />
+       <param name="allowfullscreen" value="true" />
+       <param name="allowscriptaccess" value="always" />
+       <param name="overstretch" value="true" />
+       <param name="flashvars" value="isDynamicSeeking=true" />
+
+       <embed width="400" height="224" type="application/x-shockwave-flash" src="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" wmode="direct" seamlesstabbing="true" allowfullscreen="true" overstretch="true" flashvars="isDynamicSeeking=true" />
+</object>
+
+Paragraph two.';
+
+               $expected1 = "<p>Paragraph one.</p>\n" . // Line breaks only after <p>.
+                       '<p><object width="400" height="224" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">' .
+                       '<param name="src" value="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" />' .
+                       '<param name="allowfullscreen" value="true" />' .
+                       '<param name="allowscriptaccess" value="always" />' .
+                       '<param name="overstretch" value="true" />' .
+                       '<param name="flashvars" value="isDynamicSeeking=true" />' .
+                       '<embed width="400" height="224" type="application/x-shockwave-flash" src="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" wmode="direct" seamlesstabbing="true" allowfullscreen="true" overstretch="true" flashvars="isDynamicSeeking=true" />' .
+                       "</object></p>\n" .
+                       '<p>Paragraph two.</p>';
+
+               $content2 = '
+Paragraph one.
+
+<div class="video-player" id="x-video-0">
+<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="640" height="360" id="video-0" standby="Standby text">
+  <param name="movie" value="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" />
+  <param name="quality" value="best" />
+
+  <param name="seamlesstabbing" value="true" />
+  <param name="allowfullscreen" value="true" />
+  <param name="allowscriptaccess" value="always" />
+  <param name="overstretch" value="true" />
+
+  <!--[if !IE]--><object type="application/x-shockwave-flash" data="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" width="640" height="360" standby="Standby text">
+    <param name="quality" value="best" />
+
+    <param name="seamlesstabbing" value="true" />
+    <param name="allowfullscreen" value="true" />
+    <param name="allowscriptaccess" value="always" />
+    <param name="overstretch" value="true" />
+  </object><!--<![endif]-->
+</object></div>
+
+Paragraph two.';
+
+               $expected2 = "<p>Paragraph one.</p>\n" . // Line breaks only after block tags.
+                       '<div class="video-player" id="x-video-0">' . "\n" .
+                       '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="640" height="360" id="video-0" standby="Standby text">' .
+                       '<param name="movie" value="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" />' .
+                       '<param name="quality" value="best" />' .
+                       '<param name="seamlesstabbing" value="true" />' .
+                       '<param name="allowfullscreen" value="true" />' .
+                       '<param name="allowscriptaccess" value="always" />' .
+                       '<param name="overstretch" value="true" />' .
+                       '<!--[if !IE]--><object type="application/x-shockwave-flash" data="http://domain.tld/wp-content/uploads/2013/12/xyz.swf" width="640" height="360" standby="Standby text">' .
+                       '<param name="quality" value="best" />' .
+                       '<param name="seamlesstabbing" value="true" />' .
+                       '<param name="allowfullscreen" value="true" />' .
+                       '<param name="allowscriptaccess" value="always" />' .
+                       '<param name="overstretch" value="true" /></object><!--<![endif]-->' .
+                       "</object></div>\n" .
+                       '<p>Paragraph two.</p>';
+
+               $this->assertSame( $expected1, trim( wpautop( $content1 ) ) );
+               $this->assertSame( $expected2, trim( wpautop( $content2 ) ) );
+       }
+
+       /**
+        * wpautop() Should not add <br/> to "<select>" or "<option>" elements
+        *
+        * @ticket 22230
+        */
+       public function test_skip_select_option_elements() {
+               $str = 'Country: <select id="state" name="state"><option value="1">Alabama</option><option value="2">Alaska</option><option value="3">Arizona</option><option value="4">Arkansas</option><option value="5">California</option></select>';
+               $this->assertSame( "<p>$str</p>", trim( wpautop( $str ) ) );
+       }
+
+       /**
+        * wpautop() should treat block level HTML elements as blocks.
+        *
+        * @ticket 27268
+        */
+       function test_that_wpautop_treats_block_level_elements_as_blocks() {
+               $blocks = array(
+                       'table',
+                       'thead',
+                       'tfoot',
+                       'caption',
+                       'col',
+                       'colgroup',
+                       'tbody',
+                       'tr',
+                       'td',
+                       'th',
+                       'div',
+                       'dl',
+                       'dd',
+                       'dt',
+                       'ul',
+                       'ol',
+                       'li',
+                       'pre',
+                       'form',
+                       'map',
+                       'area',
+                       'address',
+                       'math',
+                       'style',
+                       'p',
+                       'h1',
+                       'h2',
+                       'h3',
+                       'h4',
+                       'h5',
+                       'h6',
+                       'fieldset',
+                       'legend',
+                       'section',
+                       'article',
+                       'aside',
+                       'hgroup',
+                       'header',
+                       'footer',
+                       'nav',
+                       'figure',
+                       'details',
+                       'menu',
+                       'summary',
+               );
+
+               // Check whitespace normalization.
+               $content = array();
+
+               foreach ( $blocks as $block ) {
+                       $content[] = "<$block>foo</$block>";
+               }
+
+               $expected = implode( "\n", $content );
+               $input    = implode( "\n\n", $content ); // Whitespace difference.
+
+               $this->assertSame( $expected, trim( wpautop( $input ) ) );
+
+               $input = implode( '', $content ); // Whitespace difference.
+
+               $this->assertSame( $expected, trim( wpautop( $input ) ) );
+
+               // Check whitespace addition.
+               $content = array();
+
+               foreach ( $blocks as $block ) {
+                       $content[] = "<$block/>";
+               }
+
+               $expected = implode( "\n", $content );
+               $input    = implode( '', $content );
+
+               $this->assertSame( $expected, trim( wpautop( $input ) ) );
+
+               // Check whitespace addition with attributes.
+               $content = array();
+
+               foreach ( $blocks as $block ) {
+                       $content[] = "<$block attr='value'>foo</$block>";
+               }
+
+               $expected = implode( "\n", $content );
+               $input    = implode( '', $content );
+
+               $this->assertSame( $expected, trim( wpautop( $input ) ) );
+       }
+
+       /**
+        * wpautop() should autop a blockquote's contents but not the blockquote itself
+        *
+        * @ticket 27268
+        */
+       function test_that_wpautop_does_not_wrap_blockquotes_but_does_autop_their_contents() {
+               $content  = '<blockquote>foo</blockquote>';
+               $expected = '<blockquote><p>foo</p></blockquote>';
+
+               $this->assertSame( $expected, trim( wpautop( $content ) ) );
+       }
+
+       /**
+        * wpautop() should treat inline HTML elements as inline.
+        *
+        * @ticket 27268
+        */
+       function test_that_wpautop_treats_inline_elements_as_inline() {
+               $inlines = array(
+                       'a',
+                       'em',
+                       'strong',
+                       'small',
+                       's',
+                       'cite',
+                       'q',
+                       'dfn',
+                       'abbr',
+                       'data',
+                       'time',
+                       'code',
+                       'var',
+                       'samp',
+                       'kbd',
+                       'sub',
+                       'sup',
+                       'i',
+                       'b',
+                       'u',
+                       'mark',
+                       'span',
+                       'del',
+                       'ins',
+                       'noscript',
+                       'select',
+               );
+
+               $content  = array();
+               $expected = array();
+
+               foreach ( $inlines as $inline ) {
+                       $content[]  = "<$inline>foo</$inline>";
+                       $expected[] = "<p><$inline>foo</$inline></p>";
+               }
+
+               $content  = implode( "\n\n", $content );
+               $expected = implode( "\n", $expected );
+
+               $this->assertSame( $expected, trim( wpautop( $content ) ) );
+       }
+
+       /**
+        * Do not allow newlines within HTML elements to become mangled.
+        *
+        * @ticket 33106
+        * @dataProvider data_element_sanity
+        */
+       function test_element_sanity( $input, $output ) {
+               return $this->assertSame( $output, wpautop( $input ) );
+       }
+
+       function data_element_sanity() {
+               return array(
+                       array(
+                               "Hello <a\nhref='world'>",
+                               "<p>Hello <a\nhref='world'></p>\n",
+                       ),
+                       array(
+                               "Hello <!-- a\nhref='world' -->",
+                               "<p>Hello <!-- a\nhref='world' --></p>\n",
+                       ),
+                       array(
+                               "Hello <!-- <object>\n<param>\n<param>\n<embed>\n</embed>\n</object>\n -->",
+                               "<p>Hello <!-- <object>\n<param>\n<param>\n<embed>\n</embed>\n</object>\n --></p>\n",
+                       ),
+                       array(
+                               "Hello <!-- <object>\n<param/>\n<param/>\n<embed>\n</embed>\n</object>\n -->",
+                               "<p>Hello <!-- <object>\n<param/>\n<param/>\n<embed>\n</embed>\n</object>\n --></p>\n",
+                       ),
+                       /* Block elements inside comments will fail this test in all versions, it's not a regression.
+                               array(
+                                       "Hello <!-- <hr> a\nhref='world' -->",
+                                       "<p>Hello <!-- <hr> a\nhref='world' --></p>\n",
+                               ),
+                               array(
+                                       "Hello <![CDATA[ <hr> a\nhttps://youtu.be/jgz0uSaOZbE\n ]]>",
+                                       "<p>Hello <![CDATA[ <hr> a\nhttps://youtu.be/jgz0uSaOZbE\n ]]></p>\n",
+                               ),
+                       */
+                               array(
+                                       "Hello <![CDATA[ a\nhttps://youtu.be/jgz0uSaOZbE\n ]]>",
+                                       "<p>Hello <![CDATA[ a\nhttps://youtu.be/jgz0uSaOZbE\n ]]></p>\n",
+                               ),
+                       array(
+                               "Hello <![CDATA[ <!-- a\nhttps://youtu.be/jgz0uSaOZbE\n a\n9 ]]> -->",
+                               "<p>Hello <![CDATA[ <!-- a\nhttps://youtu.be/jgz0uSaOZbE\n a\n9 ]]> --></p>\n",
+                       ),
+                       array(
+                               "Hello <![CDATA[ <!-- a\nhttps://youtu.be/jgz0uSaOZbE\n a\n9 --> a\n9 ]]>",
+                               "<p>Hello <![CDATA[ <!-- a\nhttps://youtu.be/jgz0uSaOZbE\n a\n9 --> a\n9 ]]></p>\n",
+                       ),
+               );
+       }
+
+       /**
+        * wpautop() should not convert line breaks after <br /> tags
+        *
+        * @ticket 33377
+        */
+       function test_that_wpautop_skips_line_breaks_after_br() {
+               $content = '
+line 1<br>
+line 2<br/>
+line 3<br />
+line 4
+line 5
+';
+
+               $expected = '<p>line 1<br />
+line 2<br />
+line 3<br />
+line 4<br />
+line 5</p>';
+
+               $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
+       }
+
+       /**
+        * wpautop() should convert multiple line breaks into a paragraph regarless of <br /> format
+        *
+        * @ticket 33377
+        */
+       function test_that_wpautop_adds_a_paragraph_after_multiple_br() {
+               $content = '
+line 1<br>
+<br/>
+line 2<br/>
+<br />
+';
+
+               $expected = '<p>line 1</p>
+<p>line 2</p>';
+
+               $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
+       }
+
+
+       /**
+        * @ticket 4857
+        */
+       function test_that_text_before_blocks_is_peed() {
+               $content  = 'a<div>b</div>';
+               $expected = "<p>a</p>\n<div>b</div>";
+
+               $this->assertSame( $expected, trim( wpautop( $content ) ) );
+       }
+
+       /**
+        * wpautop() should not add extra </p> before <figcaption>
+        *
+        * @covers ::wpautop
+        * @uses ::trim
+        *
+        * @ticket 39307
+        */
+       function test_that_wpautop_does_not_add_extra_closing_p_in_figure() {
+               $content1  = '<figure><img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
+               $expected1 = $content1;
+
+               $content2 = '<figure>
+<img src="example.jpg" />
+<figcaption>Caption</figcaption>
+</figure>';
+
+               $expected2 = '<figure>
+<img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
+
+               $this->assertSame( $expected1, trim( wpautop( $content1 ) ) );
+               $this->assertSameIgnoreEOL( $expected2, trim( wpautop( $content2 ) ) );
+       }
+
+       /**
+        * @ticket 14674
+        */
+       function test_the_hr_is_not_peed() {
+               $content  = 'paragraph1<hr>paragraph2';
+               $expected = "<p>paragraph1</p>\n<hr>\n<p>paragraph2</p>";
+
+               $this->assertSame( $expected, trim( wpautop( $content ) ) );
+       }
+
+       /**
+        * wpautop() should ignore inline SVG graphics
+        *
+        * @ticket 9437
+        */
+       function test_that_wpautop_ignores_inline_svgs() {
+               $content =
+                       '<svg xmlns="http://www.w3.org/2000/svg">
+                               <circle cx="50" cy="50" r="30" fill="blue">
+                                       <animateTransform attributeName="transform" type="scale" to="1.5" dur="2s" fill="freeze"/>
+                               </circle>
+                       </svg>';
+
+               $expected = '<p>' . $content . '</p>';
+
+               $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
+       }
+
+       /**
+        * wpautop() should ignore inline scripts
+        *
+        * @ticket 9437
+        */
+       function test_that_wpautop_ignores_inline_scripts() {
+               $content =
+                       '<script type="text/javascript">
+                               var dummy = 1;
+                       </script>';
+
+               $expected = '<p>' . $content . '</p>';
+
+               $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpBasenamephpfromrev51622trunktestsphpunittestsformattingWPBasenamephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpBasename.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WPBasename.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpBasename.php                               (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpBasename.php 2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,42 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpBasename extends WP_UnitTestCase {
+
+       function test_wp_basename_unix() {
+               $this->assertSame(
+                       'file',
+                       wp_basename( '/home/test/file' )
+               );
+       }
+
+       function test_wp_basename_unix_utf8_support() {
+               $this->assertSame(
+                       'žluťoučký kůň.txt',
+                       wp_basename( '/test/žluťoučký kůň.txt' )
+               );
+       }
+
+       /**
+        * @ticket 22138
+        */
+       function test_wp_basename_windows() {
+               $this->assertSame(
+                       'file.txt',
+                       wp_basename( 'C:\Documents and Settings\User\file.txt' )
+               );
+       }
+
+       /**
+        * @ticket 22138
+        */
+       function test_wp_basename_windows_utf8_support() {
+               $this->assertSame(
+                       'щипцы.txt',
+                       wp_basename( 'C:\test\щипцы.txt' )
+               );
+       }
+
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpHtmlExcerptphpfromrev51622trunktestsphpunittestsformattingHtmlExcerptphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpHtmlExcerpt.php (from rev 51622, trunk/tests/phpunit/tests/formatting/HtmlExcerpt.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpHtmlExcerpt.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpHtmlExcerpt.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,19 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpHtmlExcerpt extends WP_UnitTestCase {
+       function test_simple() {
+               $this->assertSame( 'Baba', wp_html_excerpt( 'Baba told me not to come', 4 ) );
+       }
+       function test_html() {
+               $this->assertSame( 'Baba', wp_html_excerpt( "<a href='http://baba.net/'>Baba</a> told me not to come", 4 ) );
+       }
+       function test_entities() {
+               $this->assertSame( 'Baba', wp_html_excerpt( 'Baba &amp; Dyado', 8 ) );
+               $this->assertSame( 'Baba', wp_html_excerpt( 'Baba &#038; Dyado', 8 ) );
+               $this->assertSame( 'Baba &amp; D', wp_html_excerpt( 'Baba &amp; Dyado', 12 ) );
+               $this->assertSame( 'Baba &amp; Dyado', wp_html_excerpt( 'Baba &amp; Dyado', 100 ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpHtmlSplitphpfromrev51622trunktestsphpunittestsformattingWpHtmlSplitphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpHtmlSplit.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WpHtmlSplit.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpHtmlSplit.php                              (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpHtmlSplit.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,53 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpHtmlSplit extends WP_UnitTestCase {
+
+       /**
+        * Basic functionality goes here.
+        *
+        * @dataProvider data_basic_features
+        */
+       function test_basic_features( $input, $output ) {
+               return $this->assertSame( $output, wp_html_split( $input ) );
+       }
+
+       function data_basic_features() {
+               return array(
+                       array(
+                               'abcd efgh',
+                               array( 'abcd efgh' ),
+                       ),
+                       array(
+                               'abcd <html> efgh',
+                               array( 'abcd ', '<html>', ' efgh' ),
+                       ),
+                       array(
+                               'abcd <!-- <html> --> efgh',
+                               array( 'abcd ', '<!-- <html> -->', ' efgh' ),
+                       ),
+                       array(
+                               'abcd <![CDATA[ <html> ]]> efgh',
+                               array( 'abcd ', '<![CDATA[ <html> ]]>', ' efgh' ),
+                       ),
+               );
+       }
+
+       /**
+        * Automated performance testing of the main regex.
+        *
+        * @dataProvider data_whole_posts
+        */
+       function test_pcre_performance( $input ) {
+               $regex  = get_html_split_regex();
+               $result = benchmark_pcre_backtracking( $regex, $input, 'split' );
+               return $this->assertLessThan( 200, $result );
+       }
+
+       function data_whole_posts() {
+               require_once DIR_TESTDATA . '/formatting/whole-posts.php';
+               return data_whole_posts();
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpHtmleditPrephpfromrev51622trunktestsphpunittestsformattingWpHtmlEditPrephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpHtmleditPre.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WpHtmlEditPre.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpHtmleditPre.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpHtmleditPre.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,37 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @expectedDeprecated wp_htmledit_pre
+ */
+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->assertSame( $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->assertSame( $utf8, wp_htmledit_pre( $utf8 ) );
+               remove_filter( 'pre_option_blog_charset', array( $this, '_charset_utf_8' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpIsoDescramblerphpfromrev51622trunktestsphpunittestsformattingisoDescramblerphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpIsoDescrambler.php (from rev 51622, trunk/tests/phpunit/tests/formatting/isoDescrambler.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpIsoDescrambler.php                         (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpIsoDescrambler.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,14 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpIsoDescrambler 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->assertSame( 'this is some text', wp_iso_descrambler( '=?iso-8859-1?q?this=20is=20some=20text?=' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpMakeLinkRelativephpfromrev51622trunktestsphpunittestsformattingWPMakeLinkRelativephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpMakeLinkRelative.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WPMakeLinkRelative.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpMakeLinkRelative.php                               (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpMakeLinkRelative.php 2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,47 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpMakeLinkRelative extends WP_UnitTestCase {
+
+       public function test_wp_make_link_relative_with_http_scheme() {
+               $link          = 'http://example.com/this-is-a-test-http-url/';
+               $relative_link = wp_make_link_relative( $link );
+               $this->assertSame( '/this-is-a-test-http-url/', $relative_link );
+       }
+
+       public function test_wp_make_link_relative_with_https_scheme() {
+               $link          = 'https://example.com/this-is-a-test-https-url/';
+               $relative_link = wp_make_link_relative( $link );
+               $this->assertSame( '/this-is-a-test-https-url/', $relative_link );
+       }
+
+       /**
+        * @ticket 30373
+        */
+       public function test_wp_make_link_relative_with_no_scheme() {
+               $link          = '//example.com/this-is-a-test-schemeless-url/';
+               $relative_link = wp_make_link_relative( $link );
+               $this->assertSame( '/this-is-a-test-schemeless-url/', $relative_link );
+       }
+
+       /**
+        * @ticket 30373
+        */
+       public function test_wp_make_link_relative_should_retain_URL_param_that_is_also_a_URL() {
+               $link          = 'https://example.com/this-is-a-test/?redirect=https://example.org/a-different-test-post/';
+               $relative_link = wp_make_link_relative( $link );
+               $this->assertSame( '/this-is-a-test/?redirect=https://example.org/a-different-test-post/', $relative_link );
+       }
+
+       /**
+        * @ticket 26819
+        */
+       function test_wp_make_link_relative_with_no_path() {
+               $link          = 'http://example.com';
+               $relative_link = wp_make_link_relative( $link );
+               $this->assertSame( '', $relative_link );
+       }
+
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpRelNofollowphpfromrev51622trunktestsphpunittestsformattingWPRelNoFollowphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpRelNofollow.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WPRelNoFollow.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpRelNofollow.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpRelNofollow.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,83 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpRelNofollow extends WP_UnitTestCase {
+
+       /**
+        * @ticket 9959
+        */
+       public function test_add_no_follow() {
+               $content  = '<p>This is some cool <a href="/">Code</a></p>';
+               $expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow\">Code</a></p>';
+               $this->assertSame( $expected, wp_rel_nofollow( $content ) );
+       }
+
+       /**
+        * @ticket 9959
+        */
+       public function test_convert_no_follow() {
+               $content  = '<p>This is some cool <a href="/" rel="weird">Code</a></p>';
+               $expected = '<p>This is some cool <a href=\"/\" rel=\"weird nofollow\">Code</a></p>';
+               $this->assertSame( $expected, wp_rel_nofollow( $content ) );
+       }
+
+       /**
+        * @ticket 11360
+        * @dataProvider data_wp_rel_nofollow
+        */
+       public function test_wp_rel_nofollow( $input, $output ) {
+               return $this->assertSame( wp_slash( $output ), wp_rel_nofollow( $input ) );
+       }
+
+       public function data_wp_rel_nofollow() {
+               $home_url_http  = set_url_scheme( home_url(), 'http' );
+               $home_url_https = set_url_scheme( home_url(), 'https' );
+
+               return array(
+                       array(
+                               '<a href="">Double Quotes</a>',
+                               '<a href="" rel="nofollow">Double Quotes</a>',
+                       ),
+                       array(
+                               '<a href="https://wordpress.org">Double Quotes</a>',
+                               '<a href="https://wordpress.org" rel="nofollow">Double Quotes</a>',
+                       ),
+                       array(
+                               "<a href='https://wordpress.org'>Single Quotes</a>",
+                               "<a href='https://wordpress.org' rel=\"nofollow\">Single Quotes</a>",
+                       ),
+                       array(
+                               '<a href="https://wordpress.org" title="Title">Multiple attributes</a>',
+                               '<a href="https://wordpress.org" title="Title" rel="nofollow">Multiple attributes</a>',
+                       ),
+                       array(
+                               '<a title="Title" href="https://wordpress.org">Multiple attributes</a>',
+                               '<a title="Title" href="https://wordpress.org" rel="nofollow">Multiple attributes</a>',
+                       ),
+                       array(
+                               '<a data-someflag href="https://wordpress.org">Multiple attributes</a>',
+                               '<a data-someflag href="https://wordpress.org" rel="nofollow">Multiple attributes</a>',
+                       ),
+                       array(
+                               '<a  data-someflag  title="Title"  href="https://wordpress.org" onclick=""  >Everything at once</a>',
+                               '<a  data-someflag  title="Title"  href="https://wordpress.org" onclick=""   rel="nofollow">Everything at once</a>',
+                       ),
+                       array(
+                               '<a href="' . $home_url_http . '/some-url">Home URL (http)</a>',
+                               '<a href="' . $home_url_http . '/some-url">Home URL (http)</a>',
+                       ),
+                       array(
+                               '<a href="' . $home_url_https . '/some-url">Home URL (https)</a>',
+                               '<a href="' . $home_url_https . '/some-url">Home URL (https)</a>',
+                       ),
+               );
+       }
+
+       public function test_append_no_follow_with_valueless_attribute() {
+               $content  = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>';
+               $expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow\">Code</a></p>';
+               $this->assertSame( $expected, wp_rel_nofollow( $content ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpRelUgcphpfromrev51622trunktestsphpunittestsformattingWPRelUgcphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpRelUgc.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WPRelUgc.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpRelUgc.php                         (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpRelUgc.php   2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,83 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpRelUgc extends WP_UnitTestCase {
+
+       /**
+        * @ticket 48022
+        */
+       public function test_add_ugc() {
+               $content  = '<p>This is some cool <a href="/">Code</a></p>';
+               $expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow ugc\">Code</a></p>';
+               $this->assertSame( $expected, wp_rel_ugc( $content ) );
+       }
+
+       /**
+        * @ticket 48022
+        */
+       public function test_convert_ugc() {
+               $content  = '<p>This is some cool <a href="/" rel="weird">Code</a></p>';
+               $expected = '<p>This is some cool <a href=\"/\" rel=\"weird nofollow ugc\">Code</a></p>';
+               $this->assertSame( $expected, wp_rel_ugc( $content ) );
+       }
+
+       /**
+        * @ticket 48022
+        * @dataProvider data_wp_rel_ugc
+        */
+       public function test_wp_rel_ugc( $input, $output ) {
+               return $this->assertSame( wp_slash( $output ), wp_rel_ugc( $input ) );
+       }
+
+       public function data_wp_rel_ugc() {
+               $home_url_http  = set_url_scheme( home_url(), 'http' );
+               $home_url_https = set_url_scheme( home_url(), 'https' );
+
+               return array(
+                       array(
+                               '<a href="">Double Quotes</a>',
+                               '<a href="" rel="nofollow ugc">Double Quotes</a>',
+                       ),
+                       array(
+                               '<a href="https://wordpress.org">Double Quotes</a>',
+                               '<a href="https://wordpress.org" rel="nofollow ugc">Double Quotes</a>',
+                       ),
+                       array(
+                               "<a href='https://wordpress.org'>Single Quotes</a>",
+                               "<a href='https://wordpress.org' rel=\"nofollow ugc\">Single Quotes</a>",
+                       ),
+                       array(
+                               '<a href="https://wordpress.org" title="Title">Multiple attributes</a>',
+                               '<a href="https://wordpress.org" title="Title" rel="nofollow ugc">Multiple attributes</a>',
+                       ),
+                       array(
+                               '<a title="Title" href="https://wordpress.org">Multiple attributes</a>',
+                               '<a title="Title" href="https://wordpress.org" rel="nofollow ugc">Multiple attributes</a>',
+                       ),
+                       array(
+                               '<a data-someflag href="https://wordpress.org">Multiple attributes</a>',
+                               '<a data-someflag href="https://wordpress.org" rel="nofollow ugc">Multiple attributes</a>',
+                       ),
+                       array(
+                               '<a  data-someflag  title="Title"  href="https://wordpress.org" onclick=""  >Everything at once</a>',
+                               '<a  data-someflag  title="Title"  href="https://wordpress.org" onclick=""   rel="nofollow ugc">Everything at once</a>',
+                       ),
+                       array(
+                               '<a href="' . $home_url_http . '/some-url">Home URL (http)</a>',
+                               '<a href="' . $home_url_http . '/some-url">Home URL (http)</a>',
+                       ),
+                       array(
+                               '<a href="' . $home_url_https . '/some-url">Home URL (https)</a>',
+                               '<a href="' . $home_url_https . '/some-url">Home URL (https)</a>',
+                       ),
+               );
+       }
+
+       public function test_append_ugc_with_valueless_attribute() {
+               $content  = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>';
+               $expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow ugc\">Code</a></p>';
+               $this->assertSame( $expected, wp_rel_ugc( $content ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpReplaceInHtmlTagsphpfromrev51622trunktestsphpunittestsformattingWpReplaceInHtmlTagsphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpReplaceInHtmlTags.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WpReplaceInHtmlTags.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpReplaceInHtmlTags.php                              (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpReplaceInHtmlTags.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,37 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpReplaceInHtmlTags extends WP_UnitTestCase {
+       /**
+        * Check for expected behavior of new function wp_replace_in_html_tags().
+        *
+        * @dataProvider data_wp_replace_in_html_tags
+        */
+       function test_wp_replace_in_html_tags( $input, $output ) {
+               return $this->assertSame( $output, wp_replace_in_html_tags( $input, array( "\n" => ' ' ) ) );
+       }
+
+       function data_wp_replace_in_html_tags() {
+               return array(
+                       array(
+                               "Hello \n World",
+                               "Hello \n World",
+                       ),
+                       array(
+                               "<Hello \n World>",
+                               '<Hello   World>',
+                       ),
+                       array(
+                               "<!-- Hello \n World -->",
+                               '<!-- Hello   World -->',
+                       ),
+                       array(
+                               "<!-- Hello <\n> World -->",
+                               '<!-- Hello < > World -->',
+                       ),
+               );
+       }
+}
+
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpRicheditPrephpfromrev51622trunktestsphpunittestsformattingWpRichEditPrephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpRicheditPre.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WpRichEditPre.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpRicheditPre.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpRicheditPre.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,37 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @expectedDeprecated wp_richedit_pre
+ */
+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->assertSame( '&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->assertSame( '&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="trunktestsphpunittestsformattingwpSlashphpfromrev51622trunktestsphpunittestsformattingWPSlashphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpSlash.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WPSlash.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpSlash.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpSlash.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,103 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpSlash extends WP_UnitTestCase {
+
+       /**
+        * @ticket 42195
+        *
+        * @dataProvider data_wp_slash
+        *
+        * @param string $value
+        * @param string $expected
+        */
+       public function test_wp_slash( $value, $expected ) {
+               $this->assertSame( $expected, wp_slash( $value ) );
+       }
+
+       /**
+        * Data provider for test_wp_slash().
+        *
+        * @return array {
+        *     @type array {
+        *         @type mixed  $value    The value passed to wp_slash().
+        *         @type string $expected The expected output of wp_slash().
+        *     }
+        * }
+        */
+       public function data_wp_slash() {
+               return array(
+                       array( 123, 123 ),
+                       array( 123.4, 123.4 ),
+                       array( true, true ),
+                       array( false, false ),
+                       array(
+                               array(
+                                       'hello',
+                                       null,
+                                       '"string"',
+                                       125.41,
+                               ),
+                               array(
+                                       'hello',
+                                       null,
+                                       '\"string\"',
+                                       125.41,
+                               ),
+                       ),
+                       array( "first level 'string'", "first level \'string\'" ),
+               );
+       }
+
+       /**
+        * @ticket 24106
+        */
+       function test_adds_slashes() {
+               $old = "I can't see, isn't that it?";
+               $new = "I can\'t see, isn\'t that it?";
+               $this->assertSame( $new, wp_slash( $old ) );
+               $this->assertSame( "I can\\\\\'t see, isn\\\\\'t that it?", wp_slash( $new ) );
+               $this->assertSame( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array.
+               $this->assertSame( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed.
+       }
+
+       /**
+        * @ticket 24106
+        */
+       function test_preserves_original_datatype() {
+
+               $this->assertTrue( wp_slash( true ) );
+               $this->assertFalse( wp_slash( false ) );
+               $this->assertSame( 4, wp_slash( 4 ) );
+               $this->assertSame( 'foo', wp_slash( 'foo' ) );
+               $arr      = array(
+                       'a' => true,
+                       'b' => false,
+                       'c' => 4,
+                       'd' => 'foo',
+               );
+               $arr['e'] = $arr; // Add a sub-array.
+               $this->assertSame( $arr, wp_slash( $arr ) ); // Keyed array.
+               $this->assertSame( array_values( $arr ), wp_slash( array_values( $arr ) ) ); // Non-keyed.
+
+               $obj = new stdClass;
+               foreach ( $arr as $k => $v ) {
+                       $obj->$k = $v;
+               }
+               $this->assertSame( $obj, wp_slash( $obj ) );
+       }
+
+       /**
+        * @ticket 24106
+        */
+       function test_add_even_more_slashes() {
+               $old = 'single\\slash double\\\\slash triple\\\\\\slash';
+               $new = 'single\\\\slash double\\\\\\\\slash triple\\\\\\\\\\\\slash';
+               $this->assertSame( $new, wp_slash( $old ) );
+               $this->assertSame( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array.
+               $this->assertSame( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed.
+       }
+
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpSpecialcharsphpfromrev51622trunktestsphpunittestsformattingWPSpecialcharsphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpSpecialchars.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WPSpecialchars.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpSpecialchars.php                           (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpSpecialchars.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,100 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpSpecialchars extends WP_UnitTestCase {
+       function test_wp_specialchars_basics() {
+               $html = '&amp;&lt;hello world&gt;';
+               $this->assertSame( $html, _wp_specialchars( $html ) );
+
+               $double = '&amp;amp;&amp;lt;hello world&amp;gt;';
+               $this->assertSame( $double, _wp_specialchars( $html, ENT_NOQUOTES, false, true ) );
+       }
+
+       function test_allowed_entity_names() {
+               global $allowedentitynames;
+
+               // Allowed entities should be unchanged.
+               foreach ( $allowedentitynames as $ent ) {
+                       if ( 'apos' === $ent ) {
+                               // But for some reason, PHP doesn't allow &apos;
+                               continue;
+                       }
+                       $ent = '&' . $ent . ';';
+                       $this->assertSame( $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->assertSame( $escaped, _wp_specialchars( $ent ) );
+               }
+       }
+
+       function test_optionally_escapes_quotes() {
+               $source = "\"'hello!'\"";
+               $this->assertSame( '"&#039;hello!&#039;"', _wp_specialchars( $source, 'single' ) );
+               $this->assertSame( "&quot;'hello!'&quot;", _wp_specialchars( $source, 'double' ) );
+               $this->assertSame( '&quot;&#039;hello!&#039;&quot;', _wp_specialchars( $source, true ) );
+               $this->assertSame( $source, _wp_specialchars( $source ) );
+       }
+
+       /**
+        * Check some of the double-encoding features for entity references.
+        *
+        * @ticket 17780
+        * @dataProvider data_double_encoding
+        */
+       function test_double_encoding( $input, $output ) {
+               return $this->assertSame( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, true ) );
+       }
+
+       function data_double_encoding() {
+               return array(
+                       array(
+                               'This & that, this &amp; that, &#8212; &quot; &QUOT; &Uacute; &nbsp; &#34; &#034; &#0034; &#x00022; &#x22; &dollar; &times;',
+                               'This &amp; that, this &amp;amp; that, &amp;#8212; &amp;quot; &amp;QUOT; &amp;Uacute; &amp;nbsp; &amp;#34; &amp;#034; &amp;#0034; &amp;#x00022; &amp;#x22; &amp;dollar; &amp;times;',
+                       ),
+                       array(
+                               '&& &&amp; &amp;&amp; &amp;;',
+                               '&amp;&amp; &amp;&amp;amp; &amp;amp;&amp;amp; &amp;amp;;',
+                       ),
+                       array(
+                               '&garbage; &***; &aaaa; &0000; &####; &;;',
+                               '&amp;garbage; &amp;***; &amp;aaaa; &amp;0000; &amp;####; &amp;;;',
+                       ),
+               );
+       }
+
+       /**
+        * Check some of the double-encoding features for entity references.
+        *
+        * @ticket 17780
+        * @dataProvider data_no_double_encoding
+        */
+       function test_no_double_encoding( $input, $output ) {
+               return $this->assertSame( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, false ) );
+       }
+
+       function data_no_double_encoding() {
+               return array(
+                       array(
+                               'This & that, this &amp; that, &#8212; &quot; &QUOT; &Uacute; &nbsp; &#34; &#034; &#0034; &#x00022; &#x22; &dollar; &times;',
+                               'This &amp; that, this &amp; that, &#8212; &quot; &amp;QUOT; &Uacute; &nbsp; &#034; &#034; &#034; &#x22; &#x22; &amp;dollar; &times;',
+                       ),
+                       array(
+                               '&& &&amp; &amp;&amp; &amp;;',
+                               '&amp;&amp; &amp;&amp; &amp;&amp; &amp;;',
+                       ),
+                       array(
+                               '&garbage; &***; &aaaa; &0000; &####; &;;',
+                               '&amp;garbage; &amp;***; &amp;aaaa; &amp;0000; &amp;####; &amp;;;',
+                       ),
+               );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpStripAllTagsphpfromrev51622trunktestsphpunittestsformattingWPStripAllTagsphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpStripAllTags.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WPStripAllTags.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpStripAllTags.php                           (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpStripAllTags.php     2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,33 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Test wp_strip_all_tags()
+ *
+ * @group formatting
+ */
+class Tests_Formatting_wpStripAllTags extends WP_UnitTestCase {
+
+       function test_wp_strip_all_tags() {
+
+               $text = 'lorem<br />ipsum';
+               $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
+
+               $text = "lorem<br />\nipsum";
+               $this->assertSame( "lorem\nipsum", wp_strip_all_tags( $text ) );
+
+               // Test removing breaks is working.
+               $text = 'lorem<br />ipsum';
+               $this->assertSame( 'loremipsum', wp_strip_all_tags( $text, true ) );
+
+               // Test script / style tag's contents is removed.
+               $text = 'lorem<script>alert(document.cookie)</script>ipsum';
+               $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
+
+               $text = "lorem<style>* { display: 'none' }</style>ipsum";
+               $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
+
+               // Test "marlformed" markup of contents.
+               $text = "lorem<style>* { display: 'none' }<script>alert( document.cookie )</script></style>ipsum";
+               $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) );
+       }
+}
+
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpTargetedLinkRelphpfromrev51622trunktestsphpunittestsformattingWPTargetedLinkRelphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpTargetedLinkRel.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WPTargetedLinkRel.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpTargetedLinkRel.php                                (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpTargetedLinkRel.php  2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,138 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @ticket 43187
+ */
+class Tests_Formatting_wpTargetedLinkRel extends WP_UnitTestCase {
+
+       public function test_add_to_links_with_target_blank() {
+               $content  = '<p>Links: <a href="/" target="_blank">No rel</a></p>';
+               $expected = '<p>Links: <a href="/" target="_blank" rel="noopener">No rel</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       public function test_add_to_links_with_target_foo() {
+               $content  = '<p>Links: <a href="/" target="foo">No rel</a></p>';
+               $expected = '<p>Links: <a href="/" target="foo" rel="noopener">No rel</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       public function test_target_as_first_attribute() {
+               $content  = '<p>Links: <a target="_blank" href="#">No rel</a></p>';
+               $expected = '<p>Links: <a target="_blank" href="#" rel="noopener">No rel</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       public function test_add_to_existing_rel() {
+               $content  = '<p>Links: <a href="/" rel="existing values" target="_blank">Existing rel</a></p>';
+               $expected = '<p>Links: <a href="/" rel="existing values noopener" target="_blank">Existing rel</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       public function test_no_duplicate_values_added() {
+               $content  = '<p>Links: <a href="/" rel="existing noopener values" target="_blank">Existing rel</a></p>';
+               $expected = '<p>Links: <a href="/" rel="existing noopener values" target="_blank">Existing rel</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       public function test_rel_with_single_quote_delimiter() {
+               $content  = '<p>Links: <a href="/" rel=\'existing values\' target="_blank">Existing rel</a></p>';
+               $expected = '<p>Links: <a href="/" rel="existing values noopener" target="_blank">Existing rel</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       public function test_rel_with_no_delimiter() {
+               $content  = '<p>Links: <a href="/" rel=existing target="_blank">Existing rel</a></p>';
+               $expected = '<p>Links: <a href="/" rel="existing noopener" target="_blank">Existing rel</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       public function test_rel_value_spaced_and_no_delimiter() {
+               $content  = '<p>Links: <a href="/" rel = existing target="_blank">Existing rel</a></p>';
+               $expected = '<p>Links: <a href="/" rel="existing noopener" target="_blank">Existing rel</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       public function test_escaped_quotes() {
+               $content  = '<p>Links: <a href=\"/\" rel=\"existing values\" target=\"_blank\">Existing rel</a></p>';
+               $expected = '<p>Links: <a href=\"/\" rel=\"existing values noopener\" target=\"_blank\">Existing rel</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       public function test_ignore_links_with_no_target() {
+               $content  = '<p>Links: <a href="/" target="_blank">Change me</a> <a href="/">Do not change me</a></p>';
+               $expected = '<p>Links: <a href="/" target="_blank" rel="noopener">Change me</a> <a href="/">Do not change me</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       /**
+        * Ensure empty rel attributes are not added.
+        *
+        * @ticket 45352
+        */
+       public function test_ignore_if_wp_targeted_link_rel_nulled() {
+               add_filter( 'wp_targeted_link_rel', '__return_empty_string' );
+               $content  = '<p>Links: <a href="/" target="_blank">Do not change me</a></p>';
+               $expected = '<p>Links: <a href="/" target="_blank">Do not change me</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       /**
+        * Ensure default content filters are added.
+        *
+        * @ticket 45292
+        */
+       public function test_wp_targeted_link_rel_filters_run() {
+               $content  = '<p>Links: <a href="/" target="_blank">No rel</a></p>';
+               $expected = '<p>Links: <a href="/" target="_blank" rel="noopener">No rel</a></p>';
+
+               $post = $this->factory()->post->create_and_get(
+                       array(
+                               'post_content' => $content,
+                       )
+               );
+
+               $this->assertSame( $expected, $post->post_content );
+       }
+
+       /**
+        * Ensure JSON format is preserved when relation attribute (rel) is missing.
+        *
+        * @ticket 46316
+        */
+       public function test_wp_targeted_link_rel_should_preserve_json() {
+               $content  = '<p>Links: <a href=\"\/\" target=\"_blank\">No rel<\/a><\/p>';
+               $expected = '<p>Links: <a href=\"\/\" target=\"_blank\" rel=\"noopener\">No rel<\/a><\/p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       /**
+        * Ensure the content of style and script tags are not processed
+        *
+        * @ticket 47244
+        */
+       public function test_wp_targeted_link_rel_skips_style_and_scripts() {
+               $content  = '<style><a href="/" target=a></style><p>Links: <script>console.log("<a href=\'/\' target=a>hi</a>");</script><script>alert(1);</script>here <a href="/" target=_blank>aq</a></p><script>console.log("<a href=\'last\' target=\'_blank\'")</script>';
+               $expected = '<style><a href="/" target=a></style><p>Links: <script>console.log("<a href=\'/\' target=a>hi</a>");</script><script>alert(1);</script>here <a href="/" target="_blank" rel="noopener">aq</a></p><script>console.log("<a href=\'last\' target=\'_blank\'")</script>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       /**
+        * Ensure entirely serialized content is ignored.
+        *
+        * @ticket 46402
+        */
+       public function test_ignore_entirely_serialized_content() {
+               $content  = 'a:1:{s:4:"html";s:52:"<p>Links: <a href="/" target="_blank">No Rel</a></p>";}';
+               $expected = 'a:1:{s:4:"html";s:52:"<p>Links: <a href="/" target="_blank">No Rel</a></p>";}';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+       public function test_wp_targeted_link_rel_tab_separated_values_are_split() {
+               $content  = "<p>Links: <a href=\"/\" target=\"_blank\" rel=\"ugc\t\tnoopener\t\">No rel</a></p>";
+               $expected = '<p>Links: <a href="/" target="_blank" rel="ugc noopener">No rel</a></p>';
+               $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+       }
+
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpTexturizephpfromrev51622trunktestsphpunittestsformattingWPTexturizephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpTexturize.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WPTexturize.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpTexturize.php                              (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpTexturize.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,2113 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpTexturize extends WP_UnitTestCase {
+       function test_dashes() {
+               $this->assertSame( 'Hey &#8212; boo?', wptexturize( 'Hey -- boo?' ) );
+               $this->assertSame( '<a href="http://xx--xx">Hey &#8212; boo?</a>', wptexturize( '<a href="http://xx--xx">Hey -- boo?</a>' ) );
+       }
+
+       function test_disable() {
+               $this->assertSame( '<pre>---&</pre>', wptexturize( '<pre>---&</pre>' ) );
+               $this->assertSame( '<pre><code></code>--&</pre>', wptexturize( '<pre><code></code>--&</pre>' ) );
+
+               $this->assertSame( '<code>---&</code>', wptexturize( '<code>---&</code>' ) );
+               $this->assertSame( '<kbd>---&</kbd>', wptexturize( '<kbd>---&</kbd>' ) );
+               $this->assertSame( '<style>---&</style>', wptexturize( '<style>---&</style>' ) );
+               $this->assertSame( '<script>---&</script>', wptexturize( '<script>---&</script>' ) );
+               $this->assertSame( '<tt>---&</tt>', wptexturize( '<tt>---&</tt>' ) );
+
+               $this->assertSame( '<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->assertSame( $enabled_tags_inside_code, wptexturize( $enabled_tags_inside_code ) );
+
+               $double_nest = '<pre>"baba"<code>"baba"<pre></pre></code>"baba"</pre>';
+               $this->assertSame( $double_nest, wptexturize( $double_nest ) );
+
+               $invalid_nest = '<pre></code>"baba"</pre>';
+               $this->assertSame( $invalid_nest, wptexturize( $invalid_nest ) );
+
+       }
+
+       /**
+        * @ticket 1418
+        */
+       function test_bracketed_quotes_1418() {
+               $this->assertSame( '(&#8220;test&#8221;)', wptexturize( '("test")' ) );
+               $this->assertSame( '(&#8216;test&#8217;)', wptexturize( "('test')" ) );
+               $this->assertSame( '(&#8217;twas)', wptexturize( "('twas)" ) );
+       }
+
+       /**
+        * @ticket 3810
+        */
+       function test_bracketed_quotes_3810() {
+               $this->assertSame( 'A dog (&#8220;Hubertus&#8221;) was sent out.', wptexturize( 'A dog ("Hubertus") was sent out.' ) );
+       }
+
+       /**
+        * @ticket 4539
+        */
+       function test_basic_quotes() {
+               $this->assertSame( 'test&#8217;s', wptexturize( 'test\'s' ) );
+
+               $this->assertSame( '&#8216;quoted&#8217;', wptexturize( '\'quoted\'' ) );
+               $this->assertSame( '&#8220;quoted&#8221;', wptexturize( '"quoted"' ) );
+
+               $this->assertSame( 'space before &#8216;quoted&#8217; space after', wptexturize( 'space before \'quoted\' space after' ) );
+               $this->assertSame( 'space before &#8220;quoted&#8221; space after', wptexturize( 'space before "quoted" space after' ) );
+
+               $this->assertSame( '(&#8216;quoted&#8217;)', wptexturize( '(\'quoted\')' ) );
+               $this->assertSame( '{&#8220;quoted&#8221;}', wptexturize( '{"quoted"}' ) );
+
+               $this->assertSame( '&#8216;qu(ot)ed&#8217;', wptexturize( '\'qu(ot)ed\'' ) );
+               $this->assertSame( '&#8220;qu{ot}ed&#8221;', wptexturize( '"qu{ot}ed"' ) );
+
+               $this->assertSame( ' &#8216;test&#8217;s quoted&#8217; ', wptexturize( ' \'test\'s quoted\' ' ) );
+               $this->assertSame( ' &#8220;test&#8217;s quoted&#8221; ', wptexturize( ' "test\'s quoted" ' ) );
+       }
+
+       /**
+        * @ticket 4539
+        * @ticket 15241
+        */
+       function test_full_sentences_with_unmatched_single_quotes() {
+               $this->assertSame(
+                       '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->assertSame( '&#8220;Quoted String&#8221;', wptexturize( '"Quoted String"' ) );
+               // $this->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( '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->assertSame( 'A test with a finishing number, &#8220;like 23&#8221;.', wptexturize( 'A test with a finishing number, "like 23".' ) );
+               $this->assertSame( '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->assertSame( 'test&#8217;s', wptexturize( "test's" ) );
+               $this->assertSame( '&#8216;test&#8217;s', wptexturize( "'test's" ) );
+               $this->assertSame( '&#8216;test&#8217;s&#8217;', wptexturize( "'test's'" ) );
+               $this->assertSame( '&#8216;string&#8217;', wptexturize( "'string'" ) );
+               $this->assertSame( '&#8216;string&#8217;s&#8217;', wptexturize( "'string's'" ) );
+       }
+
+       /**
+        * @ticket 4539
+        */
+       function test_quotes_before_numbers() {
+               $this->assertSame( 'Class of &#8217;99', wptexturize( "Class of '99" ) );
+               $this->assertSame( 'Class of &#8217;99&#8217;s', wptexturize( "Class of '99's" ) );
+               $this->assertSame( '&#8216;Class of &#8217;99&#8217;', wptexturize( "'Class of '99'" ) );
+               $this->assertSame( '&#8216;Class of &#8217;99&#8217; ', wptexturize( "'Class of '99' " ) );
+               $this->assertSame( '&#8216;Class of &#8217;99&#8217;.', wptexturize( "'Class of '99'." ) );
+               $this->assertSame( '&#8216;Class of &#8217;99&#8217;, she said', wptexturize( "'Class of '99', she said" ) );
+               $this->assertSame( '&#8216;Class of &#8217;99&#8217;:', wptexturize( "'Class of '99':" ) );
+               $this->assertSame( '&#8216;Class of &#8217;99&#8217;;', wptexturize( "'Class of '99';" ) );
+               $this->assertSame( '&#8216;Class of &#8217;99&#8217;!', wptexturize( "'Class of '99'!" ) );
+               $this->assertSame( '&#8216;Class of &#8217;99&#8217;?', wptexturize( "'Class of '99'?" ) );
+               $this->assertSame( '&#8216;Class of &#8217;99&#8217;s&#8217;', wptexturize( "'Class of '99's'" ) );
+               $this->assertSame( '&#8216;Class of &#8217;99&#8217;s&#8217;', wptexturize( "'Class of '99&#8217;s'" ) );
+               $this->assertSame( '&#8220;Class of 99&#8221;', wptexturize( '"Class of 99"' ) );
+               $this->assertSame( '&#8220;Class of &#8217;99&#8221;', wptexturize( "\"Class of '99\"" ) );
+               $this->assertSame( '{&#8220;Class of &#8217;99&#8221;}', wptexturize( "{\"Class of '99\"}" ) );
+               $this->assertSame( ' &#8220;Class of &#8217;99&#8221; ', wptexturize( " \"Class of '99\" " ) );
+               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;.', wptexturize( " \"Class of '99\"." ) );
+               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;, she said', wptexturize( " \"Class of '99\", she said" ) );
+               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;:', wptexturize( " \"Class of '99\":" ) );
+               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;;', wptexturize( " \"Class of '99\";" ) );
+               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;!', wptexturize( " \"Class of '99\"!" ) );
+               $this->assertSame( ' &#8220;Class of &#8217;99&#8221;?', wptexturize( " \"Class of '99\"?" ) );
+               // Not a quotation, may be between two other quotations.
+               $this->assertSame( '}&#8221;Class of &#8217;99&#8243;{', wptexturize( "}\"Class of '99\"{" ) );
+       }
+
+       function test_quotes_after_numbers() {
+               $this->assertSame( 'Class of &#8217;99', wptexturize( "Class of '99" ) );
+       }
+
+       /**
+        * @ticket 4539
+        * @ticket 15241
+        */
+       function test_other_html() {
+               $this->assertSame( '&#8216;<strong>', wptexturize( "'<strong>" ) );
+               // $this->assertSame( '&#8216;<strong>Quoted Text</strong>&#8217;,', wptexturize( "'<strong>Quoted Text</strong>'," ) );
+               // $this->assertSame( '&#8220;<strong>Quoted Text</strong>&#8221;,', wptexturize( '"<strong>Quoted Text</strong>",' ) );
+       }
+
+       function test_x() {
+               $this->assertSame( '14&#215;24', wptexturize( '14x24' ) );
+       }
+
+       function test_minutes_seconds() {
+               $this->assertSame( '9&#8242;', wptexturize( '9\'' ) );
+               $this->assertSame( '9&#8243;', wptexturize( '9"' ) );
+
+               $this->assertSame( 'a 9&#8242; b', wptexturize( 'a 9\' b' ) );
+               $this->assertSame( 'a 9&#8243; b', wptexturize( 'a 9" b' ) );
+
+               $this->assertSame( '&#8220;a 9&#8242; b&#8221;', wptexturize( '"a 9\' b"' ) );
+               $this->assertSame( '&#8216;a 9&#8243; b&#8217;', wptexturize( "'a 9\" b'" ) );
+       }
+
+       /**
+        * @ticket 8775
+        */
+       function test_wptexturize_quotes_around_numbers() {
+               $this->assertSame( '&#8220;12345&#8221;', wptexturize( '"12345"' ) );
+               $this->assertSame( '&#8216;12345&#8217;', wptexturize( '\'12345\'' ) );
+               $this->assertSame( '&#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->assertSame( '<p>&#8217;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->assertSame( '<!--[if !IE]>--><!--<![endif]-->', wptexturize( '<!--[if !IE]>--><!--<![endif]-->' ) );
+               $this->assertSame( '<!--[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->assertSame( '<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->assertSame( '&nbsp;&#8220;Testing&#8221;', wptexturize( '&nbsp;"Testing"' ) );
+               // $this->assertSame( '&#38;&#8220;Testing&#8221;', wptexturize( '&#38;"Testing"' ) );
+       }
+
+       /**
+        * @ticket 22823
+        */
+       function test_apostrophes_before_primes() {
+               $this->assertSame( 'WordPress 3.5&#8217;s release date', wptexturize( "WordPress 3.5's release date" ) );
+       }
+
+       /**
+        * @ticket 23185
+        */
+       function test_spaces_around_hyphens() {
+               $nbsp = "\xC2\xA0";
+
+               $this->assertSame( ' &#8211; ', wptexturize( ' - ' ) );
+               $this->assertSame( '&nbsp;&#8211;&nbsp;', wptexturize( '&nbsp;-&nbsp;' ) );
+               $this->assertSame( ' &#8211;&nbsp;', wptexturize( ' -&nbsp;' ) );
+               $this->assertSame( '&nbsp;&#8211; ', wptexturize( '&nbsp;- ' ) );
+               $this->assertSame( "$nbsp&#8211;$nbsp", wptexturize( "$nbsp-$nbsp" ) );
+               $this->assertSame( " &#8211;$nbsp", wptexturize( " -$nbsp" ) );
+               $this->assertSame( "$nbsp&#8211; ", wptexturize( "$nbsp- " ) );
+
+               $this->assertSame( ' &#8212; ', wptexturize( ' -- ' ) );
+               $this->assertSame( '&nbsp;&#8212;&nbsp;', wptexturize( '&nbsp;--&nbsp;' ) );
+               $this->assertSame( ' &#8212;&nbsp;', wptexturize( ' --&nbsp;' ) );
+               $this->assertSame( '&nbsp;&#8212; ', wptexturize( '&nbsp;-- ' ) );
+               $this->assertSame( "$nbsp&#8212;$nbsp", wptexturize( "$nbsp--$nbsp" ) );
+               $this->assertSame( " &#8212;$nbsp", wptexturize( " --$nbsp" ) );
+               $this->assertSame( "$nbsp&#8212; ", wptexturize( "$nbsp-- " ) );
+       }
+
+       /**
+        * @ticket 31030
+        */
+       function test_hyphens_at_start_and_end() {
+               $this->assertSame( '&#8211; ', wptexturize( '- ' ) );
+               $this->assertSame( '&#8211; &#8211;', wptexturize( '- -' ) );
+               $this->assertSame( ' &#8211;', wptexturize( ' -' ) );
+
+               $this->assertSame( '&#8212; ', wptexturize( '-- ' ) );
+               $this->assertSame( '&#8212; &#8212;', wptexturize( '-- --' ) );
+               $this->assertSame( ' &#8212;', wptexturize( ' --' ) );
+       }
+
+       /**
+        * Test spaces around quotes.
+        *
+        * These should never happen, even if the desired output changes some day.
+        *
+        * @ticket 22692
+        */
+       function test_spaces_around_quotes_never() {
+               $nbsp = "\xC2\xA0";
+
+               $problem_input  = "$nbsp\"A";
+               $problem_output = "$nbsp&#8221;A";
+
+               $this->assertNotEquals( $problem_output, wptexturize( $problem_input ) );
+       }
+
+       /**
+        * Test spaces around quotes.
+        *
+        * These are desirable outputs for the current design.
+        *
+        * @ticket 22692
+        * @dataProvider data_spaces_around_quotes
+        */
+       function test_spaces_around_quotes( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_spaces_around_quotes() {
+               $nbsp = "\xC2\xA0";
+               $pi   = "\xCE\xA0";
+
+               return array(
+                       array(
+                               "stop. $nbsp\"A quote after 2 spaces.\"",
+                               "stop. $nbsp&#8220;A quote after 2 spaces.&#8221;",
+                       ),
+                       array(
+                               "stop.$nbsp$nbsp\"A quote after 2 spaces.\"",
+                               "stop.$nbsp$nbsp&#8220;A quote after 2 spaces.&#8221;",
+                       ),
+                       array(
+                               "stop. $nbsp'A quote after 2 spaces.'",
+                               "stop. $nbsp&#8216;A quote after 2 spaces.&#8217;",
+                       ),
+                       array(
+                               "stop.$nbsp$nbsp'A quote after 2 spaces.'",
+                               "stop.$nbsp$nbsp&#8216;A quote after 2 spaces.&#8217;",
+                       ),
+                       array(
+                               'stop. &nbsp;"A quote after 2 spaces."',
+                               'stop. &nbsp;&#8220;A quote after 2 spaces.&#8221;',
+                       ),
+                       array(
+                               'stop.&nbsp;&nbsp;"A quote after 2 spaces."',
+                               'stop.&nbsp;&nbsp;&#8220;A quote after 2 spaces.&#8221;',
+                       ),
+                       array(
+                               "stop. &nbsp;'A quote after 2 spaces.'",
+                               'stop. &nbsp;&#8216;A quote after 2 spaces.&#8217;',
+                       ),
+                       array(
+                               "stop.&nbsp;&nbsp;'A quote after 2 spaces.'",
+                               'stop.&nbsp;&nbsp;&#8216;A quote after 2 spaces.&#8217;',
+                       ),
+                       array(
+                               "Contraction: $pi's",
+                               "Contraction: $pi&#8217;s",
+                       ),
+               );
+       }
+
+       /**
+        * Apostrophe before a number always becomes &#8217 (apos);
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_apos_before_digits
+        */
+       function test_apos_before_digits( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_apos_before_digits() {
+               return array(
+                       array(
+                               "word '99 word",
+                               'word &#8217;99 word',
+                       ),
+                       array(
+                               "word'99 word",
+                               'word&#8217;99 word',
+                       ),
+                       array(
+                               "word '99word",
+                               'word &#8217;99word',
+                       ),
+                       array(
+                               "word'99word",
+                               'word&#8217;99word',
+                       ),
+                       array(
+                               "word '99&#8217;s word", // Appears as a separate but logically superfluous pattern in 3.8.
+                               'word &#8217;99&#8217;s word',
+                       ),
+                       array(
+                               "according to our source, '33 students scored less than 50' on the test.", // Apostrophes and primes have priority over quotes.
+                               'according to our source, &#8217;33 students scored less than 50&#8242; on the test.',
+                       ),
+               );
+       }
+
+       /**
+        * Apostrophe after a space or ([{<" becomes &#8216; (opening_single_quote)
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_opening_single_quote
+        */
+       function test_opening_single_quote( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_opening_single_quote() {
+               return array(
+                       array(
+                               "word 'word word",
+                               'word &#8216;word word',
+                       ),
+                       array(
+                               "word ('word word",
+                               'word (&#8216;word word',
+                       ),
+                       array(
+                               "word ['word word",
+                               'word [&#8216;word word',
+                       ),
+                       array(
+                               "word <'word word",    // Invalid HTML.
+                               "word <'word word",
+                       ),
+                       array(
+                               "word &lt;'word word", // Valid HTML input makes curly quotes.
+                               'word &lt;&#8216;word word',
+                       ),
+                       array(
+                               "word {'word word",
+                               'word {&#8216;word word',
+                       ),
+                       array(
+                               "word \"'word word",
+                               'word &#8220;&#8216;word word', // Two opening quotes.
+                       ),
+                       array(
+                               "'word word",
+                               '&#8216;word word',
+                       ),
+                       array(
+                               "word('word word",
+                               'word(&#8216;word word',
+                       ),
+                       array(
+                               "word['word word",
+                               'word[&#8216;word word',
+                       ),
+                       array(
+                               "word<'word word",
+                               "word<'word word",
+                       ),
+                       array(
+                               "word&lt;'word word",
+                               'word&lt;&#8216;word word',
+                       ),
+                       array(
+                               "word{'word word",
+                               'word{&#8216;word word',
+                       ),
+                       array(
+                               "word\"'word word",
+                               'word&#8221;&#8216;word word', // Closing quote, then opening quote.
+                       ),
+                       array(
+                               "word ' word word",
+                               'word &#8216; word word',
+                       ),
+                       array(
+                               "word (' word word",
+                               'word (&#8216; word word',
+                       ),
+                       array(
+                               "word [' word word",
+                               'word [&#8216; word word',
+                       ),
+                       array(
+                               "word <' word word",
+                               "word <' word word",
+                       ),
+                       array(
+                               "word &lt;' word word",
+                               'word &lt;&#8216; word word',
+                       ),
+                       array(
+                               "word {' word word",
+                               'word {&#8216; word word',
+                       ),
+                       array(
+                               "word \"' word word",
+                               'word &#8220;&#8216; word word', // Two opening quotes.
+                       ),
+                       array(
+                               "' word word",
+                               '&#8216; word word',
+                       ),
+                       array(
+                               "word(' word word",
+                               'word(&#8216; word word',
+                       ),
+                       array(
+                               "word[' word word",
+                               'word[&#8216; word word',
+                       ),
+                       array(
+                               "word<' word word",
+                               "word<' word word",
+                       ),
+                       array(
+                               "word&lt;' word word",
+                               'word&lt;&#8216; word word',
+                       ),
+                       array(
+                               "word{' word word",
+                               'word{&#8216; word word',
+                       ),
+                       array(
+                               "word\"' word word",
+                               'word&#8221;&#8216; word word', // Closing quote, then opening quote.
+                       ),
+               );
+       }
+
+       /**
+        * Double quote after a number becomes &#8243; (double_prime)
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_double_prime
+        */
+       function test_double_prime( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_double_prime() {
+               return array(
+                       array(
+                               'word 99" word',
+                               'word 99&#8243; word',
+                       ),
+                       array(
+                               'word 99"word',
+                               'word 99&#8243;word',
+                       ),
+                       array(
+                               'word99" word',
+                               'word99&#8243; word',
+                       ),
+                       array(
+                               'word99"word',
+                               'word99&#8243;word',
+                       ),
+               );
+       }
+
+       /**
+        * Apostrophe after a number becomes &#8242; (prime)
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_single_prime
+        */
+       function test_single_prime( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_single_prime() {
+               return array(
+                       array(
+                               "word 99' word",
+                               'word 99&#8242; word',
+                       ),
+                       array(
+                               "word 99'word", // Not a prime anymore. Apostrophes get priority.
+                               'word 99&#8217;word',
+                       ),
+                       array(
+                               "word99' word",
+                               'word99&#8242; word',
+                       ),
+                       array(
+                               "word99'word",  // Not a prime anymore.
+                               'word99&#8217;word',
+                       ),
+               );
+       }
+
+       /**
+        * Apostrophe "in a word" becomes &#8217; (apos)
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_contractions
+        */
+       function test_contractions( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_contractions() {
+               return array(
+                       array(
+                               "word word's word",
+                               'word word&#8217;s word',
+                       ),
+                       array(
+                               "word'[ word", // Apostrophes are never followed by opening punctuation.
+                               "word'[ word",
+                       ),
+                       array(
+                               "word'( word",
+                               "word'( word",
+                       ),
+                       array(
+                               "word'{ word",
+                               "word'{ word",
+                       ),
+                       array(
+                               "word'&lt; word",
+                               "word'&lt; word",
+                       ),
+                       array(
+                               "word'< word", // Invalid HTML input does trigger the apos pattern.
+                               'word&#8217;< word',
+                       ),
+               );
+       }
+
+       /**
+        * Double quote after a space or ([-{< becomes &#8220; (opening_quote) if not followed by spaces
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_opening_quote
+        */
+       function test_opening_quote( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_opening_quote() {
+               return array(
+                       array(
+                               'word "word word',
+                               'word &#8220;word word',
+                       ),
+                       array(
+                               'word ("word word',
+                               'word (&#8220;word word',
+                       ),
+                       array(
+                               'word ["word word',
+                               'word [&#8220;word word',
+                       ),
+                       array(
+                               'word <"word word', // Invalid HTML.
+                               'word <"word word',
+                       ),
+                       array(
+                               'word &lt;"word word',
+                               'word &lt;&#8220;word word',
+                       ),
+                       array(
+                               'word {"word word',
+                               'word {&#8220;word word',
+                       ),
+                       array(
+                               'word -"word word',
+                               'word -&#8220;word word',
+                       ),
+                       array(
+                               'word-"word word',
+                               'word-&#8220;word word',
+                       ),
+                       array(
+                               '"word word',
+                               '&#8220;word word',
+                       ),
+                       array(
+                               'word("word word',
+                               'word(&#8220;word word',
+                       ),
+                       array(
+                               'word["word word',
+                               'word[&#8220;word word',
+                       ),
+                       array(
+                               'word<"word word',
+                               'word<"word word',
+                       ),
+                       array(
+                               'word&lt;"word word',
+                               'word&lt;&#8220;word word',
+                       ),
+                       array(
+                               'word{"word word',
+                               'word{&#8220;word word',
+                       ),
+                       array(
+                               'word "99 word',
+                               'word &#8220;99 word',
+                       ),
+               );
+       }
+
+       /**
+        * Double quote becomes &#8221; (closing_quote) unless it is already converted to double_prime or opening_quote.
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_closing_quote
+        */
+       function test_closing_quote( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_closing_quote() {
+               return array(
+                       array(
+                               'word word" word',
+                               'word word&#8221; word',
+                       ),
+                       array(
+                               'word word") word',
+                               'word word&#8221;) word',
+                       ),
+                       array(
+                               'word word"] word',
+                               'word word&#8221;] word',
+                       ),
+                       array(
+                               'word word"} word',
+                               'word word&#8221;} word',
+                       ),
+                       array(
+                               'word word"> word',    // Invalid HTML input?
+                               'word word&#8221;> word',
+                       ),
+                       array(
+                               'word word"&gt; word', // Valid HTML should work.
+                               'word word&#8221;&gt; word',
+                       ),
+                       array(
+                               'word word"',
+                               'word word&#8221;',
+                       ),
+                       array(
+                               'word word"word',
+                               'word word&#8221;word',
+                       ),
+                       array(
+                               'word"word"word',
+                               'word&#8221;word&#8221;word',
+                       ),
+                       array(
+                               'test sentence".',
+                               'test sentence&#8221;.',
+                       ),
+                       array(
+                               'test sentence",',
+                               'test sentence&#8221;,',
+                       ),
+                       array(
+                               'test sentence":',
+                               'test sentence&#8221;:',
+                       ),
+                       array(
+                               'test sentence";',
+                               'test sentence&#8221;;',
+                       ),
+                       array(
+                               'test sentence"!',
+                               'test sentence&#8221;!',
+                       ),
+                       array(
+                               'test sentence"?',
+                               'test sentence&#8221;?',
+                       ),
+                       array(
+                               'test sentence."',
+                               'test sentence.&#8221;',
+                       ),
+                       array(
+                               'test sentence". word',
+                               'test sentence&#8221;. word',
+                       ),
+                       array(
+                               'test sentence." word',
+                               'test sentence.&#8221; word',
+                       ),
+               );
+       }
+
+       /**
+        * Test that single quotes followed by a space or .,-)}]> become &#8217; (closing_single_quote)
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_closing_single_quote
+        */
+       function test_closing_single_quote( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_closing_single_quote() {
+               return array(
+                       array(
+                               "word word' word",
+                               'word word&#8217; word',
+                       ),
+                       array(
+                               "word word'. word",
+                               'word word&#8217;. word',
+                       ),
+                       array(
+                               "word word'.word",
+                               'word word&#8217;.word',
+                       ),
+                       array(
+                               "word word', she said",
+                               'word word&#8217;, she said',
+                       ),
+                       array(
+                               "word word': word",
+                               'word word&#8217;: word',
+                       ),
+                       array(
+                               "word word'; word",
+                               'word word&#8217;; word',
+                       ),
+                       array(
+                               "word word'! word",
+                               'word word&#8217;! word',
+                       ),
+                       array(
+                               "word word'? word",
+                               'word word&#8217;? word',
+                       ),
+                       array(
+                               "word word'- word",
+                               'word word&#8217;- word',
+                       ),
+                       array(
+                               "word word') word",
+                               'word word&#8217;) word',
+                       ),
+                       array(
+                               "word word'} word",
+                               'word word&#8217;} word',
+                       ),
+                       array(
+                               "word word'] word",
+                               'word word&#8217;] word',
+                       ),
+                       array(
+                               "word word'&gt; word",
+                               'word word&#8217;&gt; word',
+                       ),
+                       array(
+                               "word word'",
+                               'word word&#8217;',
+                       ),
+                       array(
+                               "test sentence'.",
+                               'test sentence&#8217;.',
+                       ),
+                       array(
+                               "test sentence.'",
+                               'test sentence.&#8217;',
+                       ),
+                       array(
+                               "test sentence'. word",
+                               'test sentence&#8217;. word',
+                       ),
+                       array(
+                               "test sentence.' word",
+                               'test sentence.&#8217; word',
+                       ),
+               );
+       }
+
+       /**
+        * Tests multiplication.
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @ticket 30445
+        * @dataProvider data_multiplication
+        */
+       function test_multiplication( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_multiplication() {
+               return array(
+                       array(
+                               '9x9',
+                               '9&#215;9',
+                       ),
+                       array(
+                               '12x34',
+                               '12&#215;34',
+                       ),
+                       array(
+                               '-123x1=-123',
+                               '-123&#215;1=-123',
+                       ),
+                       // @ticket 30445
+                       array(
+                               '-123x-1',
+                               '-123x-1',
+                       ),
+                       array(
+                               '0.675x1=0.675',
+                               '0.675&#215;1=0.675',
+                       ),
+                       array(
+                               '9 x 9',
+                               '9 x 9',
+                       ),
+                       array(
+                               '0x70',
+                               '0x70',
+                       ),
+                       array(
+                               '3x2x1x0',
+                               '3x2x1x0',
+                       ),
+               );
+       }
+
+       /**
+        * Test ampersands. & always becomes &#038; unless it is followed by # or ;
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_ampersand
+        */
+       function test_ampersand( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_ampersand() {
+               return array(
+                       array(
+                               'word & word',
+                               'word &#038; word',
+                       ),
+                       array(
+                               'word&word',
+                               'word&#038;word',
+                       ),
+                       array(
+                               'word &nbsp; word',
+                               'word &nbsp; word',
+                       ),
+                       array(
+                               'word &#038; word',
+                               'word &#038; word',
+                       ),
+                       array(
+                               'word &#xabc; word',
+                               'word &#xabc; word',
+                       ),
+                       array(
+                               'word &#X394; word',
+                               'word &#X394; word',
+                       ),
+                       array(
+                               'word &# word',
+                               'word &#038;# word',
+                       ),
+                       array(
+                               'word &44; word',
+                               'word &44; word',
+                       ),
+                       array(
+                               'word &&amp; word',
+                               'word &#038;&amp; word',
+                       ),
+                       array(
+                               'word &!amp; word',
+                               'word &#038;!amp; word',
+                       ),
+                       array(
+                               'word &#',
+                               'word &#038;#',
+                       ),
+                       array(
+                               'word &',
+                               'word &#038;',
+                       ),
+               );
+       }
+
+       /**
+        * Test "cockney" phrases, which begin with an apostrophe instead of an opening single quote.
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_cockney
+        */
+       function test_cockney( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_cockney() {
+               return array(
+                       array(
+                               "word 'tain't word",
+                               'word &#8217;tain&#8217;t word',
+                       ),
+                       array(
+                               "word 'twere word",
+                               'word &#8217;twere word',
+                       ),
+                       array(
+                               "word 'twas word",
+                               'word &#8217;twas word',
+                       ),
+                       array(
+                               "word 'tis word",
+                               'word &#8217;tis word',
+                       ),
+                       array(
+                               "word 'twill word",
+                               'word &#8217;twill word',
+                       ),
+                       array(
+                               "word 'til word",
+                               'word &#8217;til word',
+                       ),
+                       array(
+                               "word 'bout word",
+                               'word &#8217;bout word',
+                       ),
+                       array(
+                               "word 'nuff word",
+                               'word &#8217;nuff word',
+                       ),
+                       array(
+                               "word 'round word",
+                               'word &#8217;round word',
+                       ),
+                       array(
+                               "word 'cause word",
+                               'word &#8217;cause word',
+                       ),
+                       array(
+                               "word 'em word",
+                               'word &#8217;em word',
+                       ),
+               );
+       }
+
+       /**
+        * Test smart dashes.
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_smart_dashes
+        */
+       function test_smart_dashes( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_smart_dashes() {
+               return array(
+                       array(
+                               'word --- word',
+                               'word &#8212; word',
+                       ),
+                       array(
+                               'word---word',
+                               'word&#8212;word',
+                       ),
+                       array(
+                               'word -- word',
+                               'word &#8212; word',
+                       ),
+                       array(
+                               'word--word',
+                               'word&#8211;word',
+                       ),
+                       array(
+                               'word - word',
+                               'word &#8211; word',
+                       ),
+                       array(
+                               'word-word',
+                               'word-word',
+                       ),
+                       array(
+                               'word xn&#8211; word',
+                               'word xn&#8211; word',
+                       ),
+                       array(
+                               'wordxn&#8211;word',
+                               'wordxn&#8211;word',
+                       ),
+                       array(
+                               'wordxn--word',
+                               'wordxn--word',
+                       ),
+               );
+       }
+
+       /**
+        * Test miscellaneous static replacements.
+        *
+        * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
+        *
+        * @ticket 22692
+        * @dataProvider data_misc_static_replacements
+        */
+       function test_misc_static_replacements( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_misc_static_replacements() {
+               return array(
+                       array(
+                               'word ... word',
+                               'word &#8230; word',
+                       ),
+                       array(
+                               'word...word',
+                               'word&#8230;word',
+                       ),
+                       array(
+                               'word `` word',
+                               'word &#8220; word',
+                       ),
+                       array(
+                               'word``word',
+                               'word&#8220;word',
+                       ),
+                       array(
+                               "word '' word",
+                               'word &#8221; word',
+                       ),
+                       array(
+                               "word''word",
+                               'word&#8221;word',
+                       ),
+                       array(
+                               'word (tm) word',
+                               'word &#8482; word',
+                       ),
+                       array(
+                               'word (tm)word',
+                               'word &#8482;word',
+                       ),
+                       array(
+                               'word(tm) word',
+                               'word(tm) word',
+                       ),
+                       array(
+                               'word(tm)word',
+                               'word(tm)word',
+                       ),
+               );
+       }
+
+       /**
+        * Numbers inside of matching quotes get curly quotes instead of apostrophes and primes.
+        *
+        * @ticket 8775
+        * @dataProvider data_quoted_numbers
+        */
+       function test_quoted_numbers( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_quoted_numbers() {
+               return array(
+                       array(
+                               'word "42.00" word',
+                               'word &#8220;42.00&#8221; word',
+                       ),
+                       array(
+                               'word "42.00"word',
+                               'word &#8220;42.00&#8221;word',
+                       ),
+                       array(
+                               "word '42.00' word",
+                               'word &#8216;42.00&#8217; word',
+                       ),
+                       array(
+                               "word '42.00'word",
+                               'word &#8216;42.00&#8217;word',
+                       ),
+                       array(
+                               'word "42" word',
+                               'word &#8220;42&#8221; word',
+                       ),
+                       array(
+                               'word "42,00" word',
+                               'word &#8220;42,00&#8221; word',
+                       ),
+                       array(
+                               'word "4,242.00" word',
+                               'word &#8220;4,242.00&#8221; word',
+                       ),
+                       array(
+                               "word '99's word",
+                               'word &#8217;99&#8217;s word',
+                       ),
+                       array(
+                               "word '99'samsonite",
+                               'word &#8217;99&#8217;samsonite',
+                       ),
+               );
+       }
+
+       /**
+        * Quotations should be allowed to have dashes around them.
+        *
+        * @ticket 20342
+        * @dataProvider data_quotes_and_dashes
+        */
+       function test_quotes_and_dashes( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_quotes_and_dashes() {
+               return array(
+                       array(
+                               'word---"quote"',
+                               'word&#8212;&#8220;quote&#8221;',
+                       ),
+                       array(
+                               'word--"quote"',
+                               'word&#8211;&#8220;quote&#8221;',
+                       ),
+                       array(
+                               'word-"quote"',
+                               'word-&#8220;quote&#8221;',
+                       ),
+                       array(
+                               "word---'quote'",
+                               'word&#8212;&#8216;quote&#8217;',
+                       ),
+                       array(
+                               "word--'quote'",
+                               'word&#8211;&#8216;quote&#8217;',
+                       ),
+                       array(
+                               "word-'quote'",
+                               'word-&#8216;quote&#8217;',
+                       ),
+                       array(
+                               '"quote"---word',
+                               '&#8220;quote&#8221;&#8212;word',
+                       ),
+                       array(
+                               '"quote"--word',
+                               '&#8220;quote&#8221;&#8211;word',
+                       ),
+                       array(
+                               '"quote"-word',
+                               '&#8220;quote&#8221;-word',
+                       ),
+                       array(
+                               "'quote'---word",
+                               '&#8216;quote&#8217;&#8212;word',
+                       ),
+                       array(
+                               "'quote'--word",
+                               '&#8216;quote&#8217;&#8211;word',
+                       ),
+                       array(
+                               "'quote'-word",
+                               '&#8216;quote&#8217;-word',
+                       ),
+               );
+       }
+
+       /**
+        * Test HTML and shortcode avoidance.
+        *
+        * @ticket 12690
+        * @dataProvider data_tag_avoidance
+        */
+       function test_tag_avoidance( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_tag_avoidance() {
+               return array(
+                       array(
+                               '[ ... ]',
+                               '[ &#8230; ]',
+                       ),
+                       array(
+                               '[ is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
+                               '[ is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
+                       ),
+                       array(
+                               '[is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
+                               '[is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
+                       ),
+                       array(
+                               '[caption - is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
+                               '[caption &#8211; is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]',
+                       ),
+                       array(
+                               '[ photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy & that guy </a> ]',
+                               '[ photos by <a href="http://example.com/?a[]=1&#038;a[]=2"> this guy &#038; that guy </a> ]',
+                       ),
+                       array(
+                               '[photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy & that guy </a>]',
+                               '[photos by <a href="http://example.com/?a[]=1&#038;a[]=2"> this guy &#038; that guy </a>]',
+                       ),
+                       array(
+                               '& <script>&&</script>',
+                               '&#038; <script>&&</script>',
+                       ),
+                       array(
+                               '[gallery ...]',
+                               '[gallery ...]',
+                       ),
+                       array(
+                               '[[gallery ...]', // This tag is still valid.
+                               '[[gallery ...]',
+                       ),
+                       array(
+                               '[gallery ...]]', // This tag is also valid.
+                               '[gallery ...]]',
+                       ),
+                       array(
+                               '[/gallery ...]', // This would actually be ignored by the shortcode system.
+                               '[/gallery ...]', // The decision to not texturize it is intentional, if not correct.
+                       ),
+                       array(
+                               '[[gallery]]...[[/gallery]]', // Shortcode parsing will ignore the inner ']...[' part and treat this as a single escaped shortcode.
+                               '[[gallery]]&#8230;[[/gallery]]',
+                       ),
+                       array(
+                               '[[[gallery]]]...[[[/gallery]]]', // Again, shortcode parsing matches, but only the '[[gallery]' and '[/gallery]]' parts.
+                               '[[[gallery]]]&#8230;[[[/gallery]]]',
+                       ),
+                       array(
+                               '[gallery ...',
+                               '[gallery &#8230;',
+                       ),
+                       array(
+                               '[gallery <br ... /> ...]', // This tag is still valid. Shortcode 'attributes' are not considered
+                               '[gallery <br ... /> ...]', // in the initial parsing of shortcodes, and HTML is allowed.
+                       ),
+                       array(
+                               '<br [gallery ...] ... />',
+                               '<br [gallery ...] ... />',
+                       ),
+                       array(
+                               '<br [gallery ...] ... /',
+                               '<br [gallery ...] ... /',
+                       ),
+                       array(
+                               '<br ... />',
+                               '<br ... />',
+                       ),
+                       array(
+                               '<br ... />...<br ... />',
+                               '<br ... />&#8230;<br ... />',
+                       ),
+                       array(
+                               '[gallery ...]...[gallery ...]',
+                               '[gallery ...]&#8230;[gallery ...]',
+                       ),
+                       array(
+                               '[[gallery ...]]',
+                               '[[gallery ...]]',
+                       ),
+                       array(
+                               '[[gallery ...]',
+                               '[[gallery ...]',
+                       ),
+                       array(
+                               '[gallery ...]]',
+                               '[gallery ...]]',
+                       ),
+                       array(
+                               '[/gallery ...]]',
+                               '[/gallery ...]]',
+                       ),
+                       array(
+                               '[[gallery <br ... /> ...]]', // This gets parsed as an escaped shortcode with embedded HTML. Brains may explode.
+                               '[[gallery <br ... /> ...]]',
+                       ),
+                       array(
+                               '<br [[gallery ...]] ... />',
+                               '<br [[gallery ...]] ... />',
+                       ),
+                       array(
+                               '<br [[gallery ...]] ... /',
+                               '<br [[gallery ...]] ... /',
+                       ),
+                       array(
+                               '[[gallery ...]]...[[gallery ...]]',
+                               '[[gallery ...]]&#8230;[[gallery ...]]',
+                       ),
+                       array(
+                               '[[gallery ...]...[/gallery]]',
+                               '[[gallery ...]&#8230;[/gallery]]',
+                       ),
+                       array(
+                               '<!-- ... -->',
+                               '<!-- ... -->',
+                       ),
+                       array(
+                               '<!--...-->',
+                               '<!--...-->',
+                       ),
+                       array(
+                               '<!-- ... -- > ...',
+                               '<!-- ... -- > ...',
+                       ),
+                       array(
+                               '<!-- ...', // An unclosed comment is still a comment.
+                               '<!-- ...',
+                       ),
+                       array(
+                               'a<!-->b', // Browsers seem to allow this.
+                               'a<!-->b',
+                       ),
+                       array(
+                               'a<!--->b',
+                               'a<!--->b',
+                       ),
+                       array(
+                               'a<!---->b',
+                               'a<!---->b',
+                       ),
+                       array(
+                               'a<!----->b',
+                               'a<!----->b',
+                       ),
+                       array(
+                               'a<!-- c --->b',
+                               'a<!-- c --->b',
+                       ),
+                       array(
+                               'a<!-- c -- d -->b',
+                               'a<!-- c -- d -->b',
+                       ),
+                       array(
+                               'a<!-- <!-- c --> -->b<!-- close -->',
+                               'a<!-- <!-- c --> &#8211;>b<!-- close -->',
+                       ),
+                       array(
+                               '<!-- <br /> [gallery] ... -->',
+                               '<!-- <br /> [gallery] ... -->',
+                       ),
+                       array(
+                               '...<!-- ... -->...',
+                               '&#8230;<!-- ... -->&#8230;',
+                       ),
+                       array(
+                               '[gallery ...]...<!-- ... -->...<br ... />',
+                               '[gallery ...]&#8230;<!-- ... -->&#8230;<br ... />',
+                       ),
+                       array(
+                               '<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>',
+                               '<ul><li>Hello.</li><!--<li>Goodbye.</li>--></ul>',
+                       ),
+                       array(
+                               'word <img src="http://example.com/wp-content/uploads/2014/06/image-300x216.gif" /> word', // Ensure we are not corrupting image URLs.
+                               'word <img src="http://example.com/wp-content/uploads/2014/06/image-300x216.gif" /> word',
+                       ),
+                       array(
+                               '[ do texturize "[quote]" here ]',
+                               '[ do texturize &#8220;[quote]&#8221; here ]',
+                       ),
+                       array(
+                               '[ regex catches this <a href="[quote]">here</a> ]',
+                               '[ regex catches this <a href="[quote]">here</a> ]',
+                       ),
+                       array(
+                               '[ but also catches the <b>styled "[quote]" here</b> ]',
+                               '[ but also catches the <b>styled &#8220;[quote]&#8221; here</b> ]',
+                       ),
+                       array(
+                               '[Let\'s get crazy<input>[caption code="<a href=\'?a[]=100\'>hello</a>"]</input>world]', // [caption] shortcode is invalid here because it contains '[]' chars.
+                               '[Let&#8217;s get crazy<input>[caption code=&#8221;<a href=\'?a[]=100\'>hello</a>&#8220;]</input>world]',
+                       ),
+                       array(
+                               '<> ... <>',
+                               '<> &#8230; <>',
+                       ),
+                       array(
+                               '<> ... <> ... >',
+                               '<> &#8230; <> &#8230; >',
+                       ),
+                       array(
+                               '<> ... < ... > ... <>',
+                               '<> &#8230; < ... > &#8230; <>',
+                       ),
+               );
+       }
+
+       /**
+        * Year abbreviations consist of exactly two digits.
+        *
+        * @ticket 26850
+        * @dataProvider data_year_abbr
+        */
+       function test_year_abbr( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_year_abbr() {
+               return array(
+                       array(
+                               "word '99 word",
+                               'word &#8217;99 word',
+                       ),
+                       array(
+                               "word '99. word",
+                               'word &#8217;99. word',
+                       ),
+                       array(
+                               "word '99, word",
+                               'word &#8217;99, word',
+                       ),
+                       array(
+                               "word '99; word",
+                               'word &#8217;99; word',
+                       ),
+                       array(
+                               "word '99' word", // For this pattern, prime doesn't make sense. Should get apos and a closing quote.
+                               'word &#8217;99&#8217; word',
+                       ),
+                       array(
+                               "word '99'. word",
+                               'word &#8217;99&#8217;. word',
+                       ),
+                       array(
+                               "word '99', word",
+                               'word &#8217;99&#8217;, word',
+                       ),
+                       array(
+                               "word '99.' word",
+                               'word &#8217;99.&#8217; word',
+                       ),
+                       array(
+                               "word '99",
+                               'word &#8217;99',
+                       ),
+                       array(
+                               "'99 word",
+                               '&#8217;99 word',
+                       ),
+                       array(
+                               "word '999 word", // Does not match the apos pattern, should be opening quote.
+                               'word &#8216;999 word',
+                       ),
+                       array(
+                               "word '99% word",
+                               'word &#8216;99% word',
+                       ),
+                       array(
+                               "word '9 word",
+                               'word &#8216;9 word',
+                       ),
+                       array(
+                               "word '99.9 word",
+                               'word &#8216;99.9 word',
+                       ),
+                       array(
+                               "word '999",
+                               'word &#8216;999',
+                       ),
+                       array(
+                               "word '9",
+                               'word &#8216;9',
+                       ),
+                       array(
+                               "in '4 years, 3 months,' Obama cut the deficit",
+                               'in &#8216;4 years, 3 months,&#8217; Obama cut the deficit',
+                       ),
+                       array(
+                               "testing's '4' through 'quotes'",
+                               'testing&#8217;s &#8216;4&#8217; through &#8216;quotes&#8217;',
+                       ),
+               );
+       }
+
+       /**
+        * Make sure translation actually works.
+        *
+        * Also make sure apostrophes and closing quotes aren't being confused by default.
+        *
+        * @ticket 27426
+        * @dataProvider data_translate
+        */
+       function test_translate( $input, $output ) {
+               add_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 );
+
+               $result = wptexturize( $input, true );
+
+               remove_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 );
+               wptexturize( 'reset', true );
+
+               return $this->assertSame( $output, $result );
+       }
+
+       function filter_translate( $translations, $text, $context, $domain ) {
+               switch ( $text ) {
+                       case '&#8211;':
+                               return '!endash!';
+                       case '&#8212;':
+                               return '!emdash!';
+                       case '&#8216;':
+                               return '!openq1!';
+                       case '&#8217;':
+                               if ( 'apostrophe' === $context ) {
+                                       return '!apos!';
+                               } else {
+                                       return '!closeq1!';
+                               }
+                       case '&#8220;':
+                               return '!openq2!';
+                       case '&#8221;':
+                               return '!closeq2!';
+                       case '&#8242;':
+                               return '!prime1!';
+                       case '&#8243;':
+                               return '!prime2!';
+                       case '&#8217;tain&#8217;t,&#8217;twere,&#8217;twas,&#8217;tis,&#8217;twill,&#8217;til,&#8217;bout,&#8217;nuff,&#8217;round,&#8217;cause,&#8217;em':
+                               return '!apos!tain!apos!t,!apos!twere,!apos!twas,!apos!tis,!apos!twill,!apos!til,!apos!bout,!apos!nuff,!apos!round,!apos!cause,!apos!em';
+                       default:
+                               return $translations;
+               }
+       }
+
+       function data_translate() {
+               return array(
+                       array(
+                               "word '99 word",
+                               'word !apos!99 word',
+                       ),
+                       array(
+                               "word'99 word",
+                               'word!apos!99 word',
+                       ),
+                       array(
+                               "word 'test sentence' word",
+                               'word !openq1!test sentence!closeq1! word',
+                       ),
+                       array(
+                               "'test sentence'",
+                               '!openq1!test sentence!closeq1!',
+                       ),
+                       array(
+                               'word "test sentence" word',
+                               'word !openq2!test sentence!closeq2! word',
+                       ),
+                       array(
+                               '"test sentence"',
+                               '!openq2!test sentence!closeq2!',
+                       ),
+                       array(
+                               "word 'word word",
+                               'word !openq1!word word',
+                       ),
+                       array(
+                               "word ('word word",
+                               'word (!openq1!word word',
+                       ),
+                       array(
+                               "word ['word word",
+                               'word [!openq1!word word',
+                       ),
+                       array(
+                               'word 99" word',
+                               'word 99!prime2! word',
+                       ),
+                       array(
+                               'word 99"word',
+                               'word 99!prime2!word',
+                       ),
+                       array(
+                               'word99" word',
+                               'word99!prime2! word',
+                       ),
+                       array(
+                               'word99"word',
+                               'word99!prime2!word',
+                       ),
+                       array(
+                               "word 99' word",
+                               'word 99!prime1! word',
+                       ),
+                       array(
+                               "word99' word",
+                               'word99!prime1! word',
+                       ),
+                       array(
+                               "word word's word",
+                               'word word!apos!s word',
+                       ),
+                       array(
+                               "word word'. word",
+                               'word word!closeq1!. word',
+                       ),
+                       array(
+                               "word ]'. word",
+                               'word ]!closeq1!. word',
+                       ),
+                       array(
+                               'word "word word',
+                               'word !openq2!word word',
+                       ),
+                       array(
+                               'word ("word word',
+                               'word (!openq2!word word',
+                       ),
+                       array(
+                               'word ["word word',
+                               'word [!openq2!word word',
+                       ),
+                       array(
+                               'word word" word',
+                               'word word!closeq2! word',
+                       ),
+                       array(
+                               'word word") word',
+                               'word word!closeq2!) word',
+                       ),
+                       array(
+                               'word word"] word',
+                               'word word!closeq2!] word',
+                       ),
+                       array(
+                               'word word"',
+                               'word word!closeq2!',
+                       ),
+                       array(
+                               'word word"word',
+                               'word word!closeq2!word',
+                       ),
+                       array(
+                               'test sentence".',
+                               'test sentence!closeq2!.',
+                       ),
+                       array(
+                               'test sentence."',
+                               'test sentence.!closeq2!',
+                       ),
+                       array(
+                               'test sentence." word',
+                               'test sentence.!closeq2! word',
+                       ),
+                       array(
+                               "word word' word",
+                               'word word!closeq1! word',
+                       ),
+                       array(
+                               "word word'. word",
+                               'word word!closeq1!. word',
+                       ),
+                       array(
+                               "word word'.word",
+                               'word word!closeq1!.word',
+                       ),
+                       array(
+                               "word word'",
+                               'word word!closeq1!',
+                       ),
+                       array(
+                               "test sentence'.",
+                               'test sentence!closeq1!.',
+                       ),
+                       array(
+                               "test sentence.'",
+                               'test sentence.!closeq1!',
+                       ),
+                       array(
+                               "test sentence'. word",
+                               'test sentence!closeq1!. word',
+                       ),
+                       array(
+                               "test sentence.' word",
+                               'test sentence.!closeq1! word',
+                       ),
+                       array(
+                               "word 'tain't word",
+                               'word !apos!tain!apos!t word',
+                       ),
+                       array(
+                               "word 'twere word",
+                               'word !apos!twere word',
+                       ),
+                       array(
+                               'word "42.00" word',
+                               'word !openq2!42.00!closeq2! word',
+                       ),
+                       array(
+                               "word '42.00' word",
+                               'word !openq1!42.00!closeq1! word',
+                       ),
+                       array(
+                               "word word'. word",
+                               'word word!closeq1!. word',
+                       ),
+                       array(
+                               "word word'.word",
+                               'word word!closeq1!.word',
+                       ),
+                       array(
+                               "word word', she said",
+                               'word word!closeq1!, she said',
+                       ),
+               );
+       }
+
+       /**
+        * Extra sanity checks for _wptexturize_pushpop_element()
+        *
+        * @ticket 28483
+        * @dataProvider data_element_stack
+        */
+       function test_element_stack( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_element_stack() {
+               return array(
+                       array(
+                               '<span>hello</code>---</span>',
+                               '<span>hello</code>&#8212;</span>',
+                       ),
+                       array(
+                               '</code>hello<span>---</span>',
+                               '</code>hello<span>&#8212;</span>',
+                       ),
+                       array(
+                               '<code>hello</code>---</span>',
+                               '<code>hello</code>&#8212;</span>',
+                       ),
+                       array(
+                               '<span>hello</span>---<code>',
+                               '<span>hello</span>&#8212;<code>',
+                       ),
+                       array(
+                               '<span>hello<code>---</span>',
+                               '<span>hello<code>---</span>',
+                       ),
+                       array(
+                               '<code>hello<span>---</span>',
+                               '<code>hello<span>---</span>',
+                       ),
+                       array(
+                               '<code>hello</span>---</span>',
+                               '<code>hello</span>---</span>',
+                       ),
+                       array(
+                               '<span><code>hello</code>---</span>',
+                               '<span><code>hello</code>&#8212;</span>',
+                       ),
+                       array(
+                               '<code>hello</code>world<span>---</span>',
+                               '<code>hello</code>world<span>&#8212;</span>',
+                       ),
+               );
+       }
+
+       /**
+        * Test disabling shortcode texturization.
+        *
+        * @ticket 29557
+        * @dataProvider data_unregistered_shortcodes
+        */
+       function test_unregistered_shortcodes( $input, $output ) {
+               add_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 );
+
+               $output = $this->assertSame( $output, wptexturize( $input ) );
+
+               remove_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 );
+               return $output;
+       }
+
+       function filter_shortcodes( $disabled ) {
+               $disabled[] = 'audio';
+               return $disabled;
+       }
+
+       function data_unregistered_shortcodes() {
+               return array(
+                       array(
+                               '[a]a--b[audio]---[/audio]a--b[/a]',
+                               '[a]a&#8211;b[audio]---[/audio]a&#8211;b[/a]',
+                       ),
+                       array(
+                               '[code ...]...[/code]',   // '[code]' is not a registered shortcode.
+                               '[code &#8230;]&#8230;[/code]',
+                       ),
+                       array(
+                               '[hello ...]...[/hello]', // '[hello]' is not a registered shortcode.
+                               '[hello &#8230;]&#8230;[/hello]',
+                       ),
+                       array(
+                               '[...]...[/...]',         // These are potentially usable shortcodes.
+                               '[&#8230;]&#8230;[/&#8230;]',
+                       ),
+                       array(
+                               '[gal>ery ...]',
+                               '[gal>ery &#8230;]',
+                       ),
+                       array(
+                               '[randomthing param="test"]',
+                               '[randomthing param=&#8221;test&#8221;]',
+                       ),
+                       array(
+                               '[[audio]...[/audio]...',         // These are potentially usable shortcodes.
+                               '[[audio]&#8230;[/audio]&#8230;', // Unfortunately, the meaning of [[audio] is ambiguous unless we run the entire shortcode regexp.
+                       ),
+                       array(
+                               '[audio]...[/audio]]...', // These are potentially usable shortcodes.
+                               '[audio]...[/audio]]...', // Unfortunately, the meaning of [/audio]] is ambiguous unless we run the entire shortcode regexp.
+                       ),                            // This test would not pass in 3.9 because the extra brace was always ignored by texturize.
+                       array(
+                               '<span>hello[/audio]---</span>',
+                               '<span>hello[/audio]&#8212;</span>',
+                       ),
+                       array(
+                               '[/audio]hello<span>---</span>',
+                               '[/audio]hello<span>&#8212;</span>',
+                       ),
+                       array(
+                               '[audio]hello[/audio]---</span>',
+                               '[audio]hello[/audio]&#8212;</span>',
+                       ),
+                       array(
+                               '<span>hello</span>---[audio]',
+                               '<span>hello</span>&#8212;[audio]',
+                       ),
+                       array(
+                               '<span>hello[audio]---</span>',
+                               '<span>hello[audio]---</span>',
+                       ),
+                       array(
+                               '[audio]hello<span>---</span>',
+                               '[audio]hello<span>---</span>',
+                       ),
+                       array(
+                               '[audio]hello</span>---</span>',
+                               '[audio]hello</span>---</span>',
+                       ),
+               );
+       }
+
+       /**
+        * Ensure primes logic is not too greedy at the end of a quotation.
+        *
+        * @ticket 29256
+        * @dataProvider data_primes_vs_quotes
+        */
+       function test_primes_vs_quotes( $input, $output ) {
+               return $this->assertSame( $output, wptexturize( $input ) );
+       }
+
+       function data_primes_vs_quotes() {
+               return array(
+                       array(
+                               "George's porch is 99' long.",
+                               'George&#8217;s porch is 99&#8242; long.',
+                       ),
+                       array(
+                               'The best year "was that time in 2012" when everyone partied, he said.',
+                               'The best year &#8220;was that time in 2012&#8221; when everyone partied, he said.',
+                       ),
+                       array(
+                               "I need 4 x 20' = 80' of trim.", // Works only with a space before the '=' char.
+                               'I need 4 x 20&#8242; = 80&#8242; of trim.',
+                       ),
+                       array(
+                               '"Lorem ipsum dolor sit amet 1234"',
+                               '&#8220;Lorem ipsum dolor sit amet 1234&#8221;',
+                       ),
+                       array(
+                               "'Etiam eu egestas dui 1234'",
+                               '&#8216;Etiam eu egestas dui 1234&#8217;',
+                       ),
+                       array(
+                               'according to our source, "33% of all students scored less than 50" on the test.',
+                               'according to our source, &#8220;33% of all students scored less than 50&#8221; on the test.',
+                       ),
+                       array(
+                               "The doctor said, 'An average height is between 5' and 6' in study group 7'.  He then produced a 6' chart of averages.  A man of 7', incredibly, is very possible.",
+                               'The doctor said, &#8216;An average height is between 5&#8242; and 6&#8242; in study group 7&#8217;.  He then produced a 6&#8242; chart of averages.  A man of 7&#8242;, incredibly, is very possible.',
+                       ),
+                       array(
+                               'Pirates have voted on "The Expendables 3" with their clicks -- and it turns out the Sylvester Stallone-starrer hasn\'t been astoundingly popular among digital thieves, relatively speaking.
+
+As of Sunday, 5.12 million people worldwide had pirated "Expendables 3" since a high-quality copy hit torrent-sharing sites July 23, according to piracy-tracking firm Excipio.
+
+That likely contributed to the action movie\'s dismal box-office debut this weekend. But over the same July 23-Aug. 18 time period, the movie was No. 4 in downloads, after "Captain America: The Winter Soldier" (7.31 million), "Divergent" (6.29 million) and "The Amazing Spider-Man 2" (5.88 million). Moreover, that\'s despite "Expendables 3" becoming available more than three weeks prior to the film\'s U.S. theatrical debut.
+
+String with a number followed by a single quote \'Expendables 3\' vestibulum in arcu mi.',
+
+                               'Pirates have voted on &#8220;The Expendables 3&#8221; with their clicks &#8212; and it turns out the Sylvester Stallone-starrer hasn&#8217;t been astoundingly popular among digital thieves, relatively speaking.
+
+As of Sunday, 5.12 million people worldwide had pirated &#8220;Expendables 3&#8221; since a high-quality copy hit torrent-sharing sites July 23, according to piracy-tracking firm Excipio.
+
+That likely contributed to the action movie&#8217;s dismal box-office debut this weekend. But over the same July 23-Aug. 18 time period, the movie was No. 4 in downloads, after &#8220;Captain America: The Winter Soldier&#8221; (7.31 million), &#8220;Divergent&#8221; (6.29 million) and &#8220;The Amazing Spider-Man 2&#8221; (5.88 million). Moreover, that&#8217;s despite &#8220;Expendables 3&#8221; becoming available more than three weeks prior to the film&#8217;s U.S. theatrical debut.
+
+String with a number followed by a single quote &#8216;Expendables 3&#8217; vestibulum in arcu mi.',
+                       ),
+               );
+       }
+
+       /**
+        * Make sure translation actually works.
+        *
+        * Also make sure opening and closing quotes are allowed to be identical.
+        *
+        * @ticket 29256
+        * @dataProvider data_primes_quotes_translation
+        */
+       function test_primes_quotes_translation( $input, $output ) {
+               add_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 );
+
+               $result = wptexturize( $input, true );
+
+               remove_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 );
+               wptexturize( 'reset', true );
+
+               return $this->assertSame( $output, $result );
+       }
+
+       function filter_translate2( $translations, $text, $context, $domain ) {
+               switch ( $text ) {
+                       case '&#8211;':
+                               return '!endash!';
+                       case '&#8212;':
+                               return '!emdash!';
+                       case '&#8216;':
+                               return '!q1!';
+                       case '&#8217;':
+                               if ( 'apostrophe' === $context ) {
+                                       return '!apos!';
+                               } else {
+                                       return '!q1!';
+                               }
+                       case '&#8220;':
+                               return '!q2!';
+                       case '&#8221;':
+                               return '!q2!';
+                       case '&#8242;':
+                               return '!prime1!';
+                       case '&#8243;':
+                               return '!prime2!';
+                       default:
+                               return $translations;
+               }
+       }
+
+       function data_primes_quotes_translation() {
+               return array(
+                       array(
+                               "George's porch is 99' long.",
+                               'George!apos!s porch is 99!prime1! long.',
+                       ),
+                       array(
+                               'The best year "was that time in 2012" when everyone partied, he said.',
+                               'The best year !q2!was that time in 2012!q2! when everyone partied, he said.',
+                       ),
+                       array(
+                               "I need 4 x 20' = 80' of trim.", // Works only with a space before the '=' char.
+                               'I need 4 x 20!prime1! = 80!prime1! of trim.',
+                       ),
+                       array(
+                               '"Lorem ipsum dolor sit amet 1234"',
+                               '!q2!Lorem ipsum dolor sit amet 1234!q2!',
+                       ),
+                       array(
+                               "'Etiam eu egestas dui 1234'",
+                               '!q1!Etiam eu egestas dui 1234!q1!',
+                       ),
+                       array(
+                               'according to our source, "33% of all students scored less than 50" on the test.',
+                               'according to our source, !q2!33% of all students scored less than 50!q2! on the test.',
+                       ),
+                       array(
+                               "The doctor said, 'An average height is between 5' and 6' in study group 7'.  He then produced a 6' chart of averages.  A man of 7', incredibly, is very possible.",
+                               'The doctor said, !q1!An average height is between 5!prime1! and 6!prime1! in study group 7!q1!.  He then produced a 6!prime1! chart of averages.  A man of 7!prime1!, incredibly, is very possible.',
+                       ),
+                       array(
+                               'Pirates have voted on "The Expendables 3" with their clicks -- and it turns out the Sylvester Stallone-starrer hasn\'t been astoundingly popular among digital thieves, relatively speaking.
+
+As of Sunday, 5.12 million people worldwide had pirated "Expendables 3" since a high-quality copy hit torrent-sharing sites July 23, according to piracy-tracking firm Excipio.
+
+That likely contributed to the action movie\'s dismal box-office debut this weekend. But over the same July 23-Aug. 18 time period, the movie was No. 4 in downloads, after "Captain America: The Winter Soldier" (7.31 million), "Divergent" (6.29 million) and "The Amazing Spider-Man 2" (5.88 million). Moreover, that\'s despite "Expendables 3" becoming available more than three weeks prior to the film\'s U.S. theatrical debut.
+
+String with a number followed by a single quote \'Expendables 3\' vestibulum in arcu mi.',
+
+                               'Pirates have voted on !q2!The Expendables 3!q2! with their clicks !emdash! and it turns out the Sylvester Stallone-starrer hasn!apos!t been astoundingly popular among digital thieves, relatively speaking.
+
+As of Sunday, 5.12 million people worldwide had pirated !q2!Expendables 3!q2! since a high-quality copy hit torrent-sharing sites July 23, according to piracy-tracking firm Excipio.
+
+That likely contributed to the action movie!apos!s dismal box-office debut this weekend. But over the same July 23-Aug. 18 time period, the movie was No. 4 in downloads, after !q2!Captain America: The Winter Soldier!q2! (7.31 million), !q2!Divergent!q2! (6.29 million) and !q2!The Amazing Spider-Man 2!q2! (5.88 million). Moreover, that!apos!s despite !q2!Expendables 3!q2! becoming available more than three weeks prior to the film!apos!s U.S. theatrical debut.
+
+String with a number followed by a single quote !q1!Expendables 3!q1! vestibulum in arcu mi.',
+                       ),
+               );
+       }
+
+       /**
+        * Automated performance testing of the main regex.
+        *
+        * @dataProvider data_whole_posts
+        */
+       function test_pcre_performance( $input ) {
+               global $shortcode_tags;
+
+               // With shortcodes disabled.
+               $regex  = _get_wptexturize_split_regex();
+               $result = benchmark_pcre_backtracking( $regex, $input, 'split' );
+               $this->assertLessThan( 200, $result );
+
+               // With shortcodes enabled.
+               $shortcode_regex = _get_wptexturize_shortcode_regex( array_keys( $shortcode_tags ) );
+               $regex           = _get_wptexturize_split_regex( $shortcode_regex );
+               $result          = benchmark_pcre_backtracking( $regex, $input, 'split' );
+               return $this->assertLessThan( 200, $result );
+       }
+
+       /**
+        * Ensure that a trailing less-than symbol doesn't cause a PHP warning.
+        *
+        * @ticket 35864
+        */
+       function test_trailing_less_than() {
+               $this->assertSame( 'F&#8211;oo<', wptexturize( 'F--oo<', true ) );
+       }
+
+       function data_whole_posts() {
+               require_once DIR_TESTDATA . '/formatting/whole-posts.php';
+               return data_whole_posts();
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpTrimExcerptphpfromrev51622trunktestsphpunittestsformattingWpTrimExcerptphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpTrimExcerpt.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WpTrimExcerpt.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpTrimExcerpt.php                            (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpTrimExcerpt.php      2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,84 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ * @covers ::wp_trim_excerpt
+ */
+class Tests_Formatting_wpTrimExcerpt extends WP_UnitTestCase {
+       /**
+        * @ticket 25349
+        */
+       public function test_secondary_loop_respect_more() {
+               $post1 = self::factory()->post->create(
+                       array(
+                               'post_content' => 'Post 1 Page 1<!--more-->Post 1 Page 2',
+                       )
+               );
+               $post2 = self::factory()->post->create(
+                       array(
+                               'post_content' => 'Post 2 Page 1<!--more-->Post 2 Page 2',
+                       )
+               );
+
+               $this->go_to( '/?p=' . $post1 );
+               setup_postdata( get_post( $post1 ) );
+
+               $q = new WP_Query(
+                       array(
+                               'post__in' => array( $post2 ),
+                       )
+               );
+               if ( $q->have_posts() ) {
+                       while ( $q->have_posts() ) {
+                               $q->the_post();
+                               $this->assertSame( 'Post 2 Page 1', wp_trim_excerpt() );
+                       }
+               }
+       }
+
+       /**
+        * @ticket 25349
+        */
+       public function test_secondary_loop_respect_nextpage() {
+               $post1 = self::factory()->post->create(
+                       array(
+                               'post_content' => 'Post 1 Page 1<!--nextpage-->Post 1 Page 2',
+                       )
+               );
+               $post2 = self::factory()->post->create(
+                       array(
+                               'post_content' => 'Post 2 Page 1<!--nextpage-->Post 2 Page 2',
+                       )
+               );
+
+               $this->go_to( '/?p=' . $post1 );
+               setup_postdata( get_post( $post1 ) );
+
+               $q = new WP_Query(
+                       array(
+                               'post__in' => array( $post2 ),
+                       )
+               );
+               if ( $q->have_posts() ) {
+                       while ( $q->have_posts() ) {
+                               $q->the_post();
+                               $this->assertSame( 'Post 2 Page 1', wp_trim_excerpt() );
+                       }
+               }
+       }
+
+       /**
+        * @ticket 51042
+        */
+       public function test_should_generate_excerpt_for_empty_values() {
+               $post = self::factory()->post->create(
+                       array(
+                               'post_content' => 'Post content',
+                       )
+               );
+
+               $this->assertSame( 'Post content', wp_trim_excerpt( '', $post ) );
+               $this->assertSame( 'Post content', wp_trim_excerpt( null, $post ) );
+               $this->assertSame( 'Post content', wp_trim_excerpt( false, $post ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingwpTrimWordsphpfromrev51622trunktestsphpunittestsformattingWPTrimWordsphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/wpTrimWords.php (from rev 51622, trunk/tests/phpunit/tests/formatting/WPTrimWords.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/wpTrimWords.php                              (rev 0)
+++ trunk/tests/phpunit/tests/formatting/wpTrimWords.php        2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,88 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_wpTrimWords extends WP_UnitTestCase {
+
+       /**
+        * Long Dummy Text.
+        *
+        * @since 5.0.0
+        *
+        * @var string $long_text
+        */
+       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->assertSame( $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->assertSame( $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->assertSame( $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->assertSame( $trimmed, wp_trim_words( $text, 5 ) );
+       }
+
+       /**
+        * @ticket 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->assertSame( $trimmed, wp_trim_words( $text ) );
+
+               $text = 'This text contains<style>#css { width:expression(alert("css")) }</style>. It should go.';
+               $this->assertSame( $trimmed, wp_trim_words( $text ) );
+       }
+
+       function test_doesnt_trim_short_text() {
+               $text = 'This is some short text.';
+               $this->assertSame( $text, wp_trim_words( $text ) );
+       }
+
+       /**
+        * @ticket 44541
+        */
+       function test_trims_to_20_counted_by_chars() {
+               switch_to_locale( 'ja_JP' );
+               $expected = substr( $this->long_text, 0, 20 ) . '&hellip;';
+               $actual   = wp_trim_words( $this->long_text, 20 );
+               restore_previous_locale();
+               $this->assertSame( $expected, $actual );
+       }
+
+       /**
+        * @ticket 44541
+        */
+       function test_trims_to_20_counted_by_chars_with_double_width_chars() {
+               switch_to_locale( 'ja_JP' );
+               $text     = str_repeat( 'あ', 100 );
+               $expected = str_repeat( 'あ', 19 ) . '&hellip;';
+               $actual   = wp_trim_words( $text, 19 );
+               restore_previous_locale();
+               $this->assertSame( $expected, $actual );
+       }
+
+       /**
+        * @ticket 47867
+        */
+       function test_works_with_non_numeric_num_words() {
+               $this->assertSame( '', wp_trim_words( $this->long_text, '', '' ) );
+               $this->assertSame( '', wp_trim_words( $this->long_text, 'abc', '' ) );
+               $this->assertSame( '', wp_trim_words( $this->long_text, null, '' ) );
+               $this->assertSame( 'Lorem ipsum dolor', wp_trim_words( $this->long_text, '3', '' ) );
+       }
+}
</ins></span></pre></div>
<a id="trunktestsphpunittestsformattingzeroisephpfromrev51622trunktestsphpunittestsformattingZeroisephp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/formatting/zeroise.php (from rev 51622, trunk/tests/phpunit/tests/formatting/Zeroise.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/formatting/zeroise.php                          (rev 0)
+++ trunk/tests/phpunit/tests/formatting/zeroise.php    2021-08-16 21:33:54 UTC (rev 51623)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,14 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_Zeroise extends WP_UnitTestCase {
+       function test_pads_with_leading_zeroes() {
+               $this->assertSame( '00005', zeroise( 5, 5 ) );
+       }
+
+       function test_does_nothing_if_input_is_already_longer() {
+               $this->assertSame( '5000000', zeroise( 5000000, 2 ) );
+       }
+}
</ins></span></pre>
</div>
</div>

</body>
</html>